Add time delta to ctf-text
[babeltrace.git] / converter / babeltrace-lib.c
index d62565c02c88c173b4e95939f9ec4c4c54944367..518ec6129dcaf622e072ebeac0613cd5ad8c6361 100644 (file)
@@ -34,6 +34,8 @@
 #include <babeltrace/ctf-ir/metadata.h>
 #include <stdarg.h>
 
+int babeltrace_verbose, babeltrace_debug;
+
 struct stream_saved_pos {
        /*
         * Use file_stream pointer to check if the trace collection we
@@ -277,7 +279,7 @@ static int babeltrace_filestream_seek(struct ctf_file_stream *file_stream,
                 */
                break;
        case BT_SEEK_BEGIN:
-               ctf_move_pos_slow(&file_stream->pos, 0, SEEK_SET);
+               file_stream->pos.move_pos_slow(&file_stream->pos, 0, SEEK_SET);
                ret = stream_read_event(file_stream);
                break;
        case BT_SEEK_TIME:
@@ -505,6 +507,7 @@ void process_callbacks(struct babeltrace_iter *iter,
        struct bt_ctf_data ctf_data;
 
        ctf_data.event = extract_ctf_stream_event(stream);
+       ctf_data.stream = stream;
 
        /* process all events callback first */
        if (iter->main_callbacks.callback) {
@@ -608,3 +611,12 @@ end:
        babeltrace_iter_destroy(iter);
        return ret;
 }
+
+static
+void __attribute__((constructor)) init_babeltrace_lib(void)
+{
+       if (getenv("BABELTRACE_VERBOSE"))
+               babeltrace_verbose = 1;
+       if (getenv("BABELTRACE_DEBUG"))
+               babeltrace_debug = 1;
+}
This page took 0.024494 seconds and 4 git commands to generate.