#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/graph/component.h>
#include <babeltrace/graph/clock-class-priority-map.h>
-#include "data-stream.h"
+#include "data-stream-file.h"
BT_HIDDEN
extern bool ctf_fs_debug;
struct ctf_fs_file {
- /* Weak */
- struct ctf_fs_component *ctf_fs;
-
/* Owned by this */
GString *path;
int bo;
};
-struct ctf_fs_stream {
+struct ctf_fs_ds_file_info {
+ GString *path;
+ uint64_t begin_ns;
+};
+
+struct ctf_fs_ds_file {
/* Owned by this */
struct ctf_fs_file *file;
};
struct ctf_fs_component_options {
- uint64_t clock_offset;
- uint64_t clock_offset_ns;
+ int64_t clock_offset;
+ int64_t clock_offset_ns;
};
struct ctf_fs_component {
- /* Weak */
+ /* Weak, guaranteed to exist */
struct bt_private_component *priv_comp;
/* Array of struct ctf_fs_port_data *, owned by this */
GPtrArray *traces;
struct ctf_fs_component_options options;
- FILE *error_fp;
- size_t page_size;
};
struct ctf_fs_trace {
- /* Weak */
- struct ctf_fs_component *ctf_fs;
-
/* Owned by this */
struct ctf_fs_metadata *metadata;
/* Owned by this */
struct bt_clock_class_priority_map *cc_prio_map;
+ /* Array of struct ctf_fs_ds_file_group *, owned by this */
+ GPtrArray *ds_file_groups;
+
/* Owned by this */
GString *path;
GString *name;
};
-struct ctf_fs_port_data {
+struct ctf_fs_ds_file_group {
+ /*
+ * Array of struct ctf_fs_ds_file_info, owned by this.
+ *
+ * This is an _ordered_ array of data stream file infos which
+ * belong to this group (a single stream instance).
+ *
+ * You can call ctf_fs_ds_file_create() with one of those paths
+ * and the CTF IR stream below.
+ */
+ GPtrArray *ds_file_infos;
+
/* Owned by this */
- GString *path;
+ struct bt_ctf_stream *stream;
- /* Weak */
+ /* Weak, belongs to component */
struct ctf_fs_trace *ctf_fs_trace;
};
+struct ctf_fs_port_data {
+ /* Weak, belongs to ctf_fs_trace */
+ struct ctf_fs_ds_file_group *ds_file_group;
+};
+
+struct ctf_fs_notif_iter_data {
+ /* Weak, belongs to ctf_fs_trace */
+ struct ctf_fs_ds_file_group *ds_file_group;
+
+ /* Owned by this */
+ struct ctf_fs_ds_file *ds_file;
+
+ /* Which file the iterator is _currently_ operating on */
+ size_t ds_file_info_index;
+};
+
BT_HIDDEN
enum bt_component_status ctf_fs_init(struct bt_private_component *source,
struct bt_value *params, void *init_method_data);
struct bt_private_notification_iterator *it,
struct bt_private_port *port);
+BT_HIDDEN
+struct bt_value *ctf_fs_query(struct bt_component_class *comp_class,
+ const char *object, struct bt_value *params);
+
+BT_HIDDEN
+int ctf_fs_find_traces(GList **trace_paths, const char *start_path);
+
+BT_HIDDEN
+GList *ctf_fs_create_trace_names(GList *trace_paths, const char *base_path);
+
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_H */