Fix: ctf_fs debug variable should be extern
[babeltrace.git] / plugins / ctf / fs / fs.h
index f3d442e466bbf7e33d6be8c8822c394b3b6ebaec..b3bd3544245e74a2bb1da5ce97ca6cf861c775a7 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef BABELTRACE_PLUGIN_CTF_FS_INTERNAL_H
-#define BABELTRACE_PLUGIN_CTF_FS_INTERNAL_H
+#ifndef BABELTRACE_PLUGIN_CTF_FS_H
+#define BABELTRACE_PLUGIN_CTF_FS_H
 
 /*
  * BabelTrace - CTF on File System Component
@@ -35,7 +35,8 @@
 #define CTF_FS_COMPONENT_DESCRIPTION \
        "Component used to read a CTF trace located on a file system."
 
-static bool ctf_fs_debug;
+BT_HIDDEN
+extern bool ctf_fs_debug;
 
 struct bt_notification_heap;
 
@@ -60,18 +61,34 @@ struct ctf_fs_stream {
        /* FIXME There should be many and ctf_fs_stream should not own them. */
        struct bt_ctf_notif_iter *notif_iter;
        void *mmap_addr;
+       /* Max length of chunk to mmap() when updating the current mapping. */
+       size_t mmap_max_len;
+       /* Length of the current mapping. */
        size_t mmap_len;
+       /* Length of the current mapping which *exists* in the backing file. */
+       size_t mmap_valid_len;
+       /* Offset in the file where the current mapping starts. */
        off_t mmap_offset;
+       /*
+        * Offset, in the current mapping, of the address to return on the next
+        * request.
+        */
        off_t request_offset;
        bool end_reached;
 };
 
-struct ctf_fs_data_stream {
-       GPtrArray *streams;
-};
-
 struct ctf_fs_iterator {
        struct bt_notification_heap *pending_notifications;
+       struct bt_notification *current_notification;
+       /*
+        * struct ctf_fs_data_stream* which have not yet been associated to a
+        * bt_ctf_stream. The association is performed on the first packet
+        * read by the stream (since, at that point, we have read a packet
+        * header).
+        */
+       GPtrArray *pending_streams;
+       /* bt_ctf_stream -> ctf_fs_stream */
+       GHashTable *stream_ht;
 };
 
 struct ctf_fs_component_options {
@@ -82,14 +99,12 @@ struct ctf_fs_component {
        GString *trace_path;
        FILE *error_fp;
        size_t page_size;
-       struct bt_notification *current_notification;
-       struct ctf_fs_metadata metadata;
-       struct ctf_fs_data_stream data_stream;
        struct ctf_fs_component_options options;
+       struct ctf_fs_metadata *metadata;
 };
 
 BT_HIDDEN
 enum bt_component_status ctf_fs_init(struct bt_component *source,
                struct bt_value *params);
 
-#endif /* BABELTRACE_PLUGIN_CTF_FS_INTERNAL_H */
+#endif /* BABELTRACE_PLUGIN_CTF_FS_H */
This page took 0.024037 seconds and 4 git commands to generate.