X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs%2Ffs.h;h=0e286f1770c8431c75d6bcfec8f812f624cdbe0a;hb=1487a16a42ca7be6b85ef210644d9ac398d7c0dd;hp=f3d442e466bbf7e33d6be8c8822c394b3b6ebaec;hpb=043e202066787ef4d63c587375c1d58753245d82;p=babeltrace.git diff --git a/plugins/ctf/fs/fs.h b/plugins/ctf/fs/fs.h index f3d442e4..0e286f17 100644 --- a/plugins/ctf/fs/fs.h +++ b/plugins/ctf/fs/fs.h @@ -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 @@ -29,15 +29,15 @@ */ #include -#include +#include +#include +#include "data-stream.h" -#define CTF_FS_COMPONENT_NAME "fs" #define CTF_FS_COMPONENT_DESCRIPTION \ "Component used to read a CTF trace located on a file system." -static bool ctf_fs_debug; - -struct bt_notification_heap; +BT_HIDDEN +extern bool ctf_fs_debug; struct ctf_fs_file { struct ctf_fs_component *ctf_fs; @@ -57,39 +57,67 @@ struct ctf_fs_metadata { struct ctf_fs_stream { struct ctf_fs_file *file; struct bt_ctf_stream *stream; - /* FIXME There should be many and ctf_fs_stream should not own them. */ struct bt_ctf_notif_iter *notif_iter; + /* A stream is assumed to be indexed. */ + struct index index; 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 ctf_fs_component_options { + uint64_t clock_offset; + uint64_t clock_offset_ns; }; -struct ctf_fs_component_options { - bool opt_dummy : 1; +struct ctf_fs_port_data { + GString *path; }; struct ctf_fs_component { + struct bt_private_component *priv_comp; 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; + struct bt_clock_class_priority_map *cc_prio_map; + + /* Array of struct ctf_fs_port_data *, owned by this */ + GPtrArray *port_data; }; BT_HIDDEN -enum bt_component_status ctf_fs_init(struct bt_component *source, - struct bt_value *params); +enum bt_component_status ctf_fs_init(struct bt_private_component *source, + struct bt_value *params, void *init_method_data); + +BT_HIDDEN +void ctf_fs_finalize(struct bt_private_component *component); + +BT_HIDDEN +enum bt_notification_iterator_status ctf_fs_iterator_init( + struct bt_private_notification_iterator *it, + struct bt_private_port *port); + +void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it); + +struct bt_notification_iterator_next_return ctf_fs_iterator_next( + struct bt_private_notification_iterator *iterator); + +BT_HIDDEN +struct bt_value *ctf_fs_query(struct bt_component_class *comp_class, + const char *object, struct bt_value *params); -#endif /* BABELTRACE_PLUGIN_CTF_FS_INTERNAL_H */ +#endif /* BABELTRACE_PLUGIN_CTF_FS_H */