lib: make trace IR API const-correct
[babeltrace.git] / plugins / lttng-utils / debug-info.h
index 09b2fb4e4960589cc7bde86ff103788f60d6ee68..56f9bc1e8c101cdea6ea95edfab0d3039d5336d9 100644 (file)
 #include <stdint.h>
 #include <stddef.h>
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/ctf-ir/event.h>
-#include <babeltrace/ctf-ir/trace.h>
-#include <babeltrace/ctf-ir/fields.h>
-#include <babeltrace/ctf-ir/event-class.h>
+#include <babeltrace/babeltrace.h>
+
+#define VPID_FIELD_NAME                "vpid"
+#define IP_FIELD_NAME          "ip"
+#define BADDR_FIELD_NAME       "baddr"
+#define CRC32_FIELD_NAME       "crc32"
+#define BUILD_ID_FIELD_NAME    "build_id"
+#define FILENAME_FIELD_NAME    "filename"
+#define IS_PIC_FIELD_NAME      "is_pic"
+#define MEMSZ_FIELD_NAME       "memsz"
+#define PATH_FIELD_NAME                "path"
+
+enum debug_info_stream_state {
+       /*
+        * We know the stream exists but we have never received a
+        * stream_begin notification for it.
+        */
+       DEBUG_INFO_UNKNOWN_STREAM,
+       /* We know this stream is active (between stream_begin and _end). */
+       DEBUG_INFO_ACTIVE_STREAM,
+       /* We have received a stream_end for this stream. */
+       DEBUG_INFO_COMPLETED_STREAM,
+};
 
 struct debug_info_component {
        FILE *err;
@@ -45,8 +64,22 @@ struct debug_info_component {
 
 struct debug_info_iterator {
        struct debug_info_component *debug_info_component;
-       /* Map between struct bt_ctf_trace and struct bt_ctf_writer. */
+       /* Map between struct bt_trace and struct bt_writer. */
        GHashTable *trace_map;
+       /* Input iterators associated with this output iterator. */
+       GPtrArray *input_iterator_group;
+       struct bt_notification *current_notification;
+       struct bt_notification_iterator *input_iterator;
+       FILE *err;
+};
+
+struct debug_info_trace {
+       const struct bt_trace *trace;
+       const struct bt_trace *writer_trace;
+       struct debug_info_component *debug_info_component;
+       struct debug_info_iterator *debug_it;
+       int static_listener_id;
+       int trace_static;
        /* Map between reader and writer stream. */
        GHashTable *stream_map;
        /* Map between reader and writer stream class. */
@@ -55,11 +88,8 @@ struct debug_info_iterator {
        GHashTable *packet_map;
        /* Map between a trace_class and its corresponding debug_info. */
        GHashTable *trace_debug_map;
-       /* Input iterators associated with this output iterator. */
-       GPtrArray *input_iterator_group;
-       struct bt_notification *current_notification;
-       struct bt_notification_iterator *input_iterator;
-       FILE *err;
+       /* Map between a stream and enum debug_info_stream_state. */
+       GHashTable *stream_states;
 };
 
 struct debug_info_source {
@@ -90,7 +120,11 @@ struct debug_info_source *debug_info_query(struct debug_info *debug_info,
                int64_t vpid, uint64_t ip);
 
 BT_HIDDEN
-void debug_info_handle_event(FILE *err, struct bt_ctf_event *event,
+void debug_info_handle_event(FILE *err, const struct bt_event *event,
                struct debug_info *debug_info);
 
+BT_HIDDEN
+void debug_info_close_trace(struct debug_info_iterator *debug_it,
+               struct debug_info_trace *di_trace);
+
 #endif /* BABELTRACE_PLUGIN_DEBUG_INFO_H */
This page took 0.023649 seconds and 4 git commands to generate.