Rename bt_ctf_X -> bt_X, maintain backward compat. for pre-2.0 CTF writer
[babeltrace.git] / plugins / ctf / fs-src / query.c
index 2b5171af992953361d98d301e36648b161bb31d2..04bf8c5b0e301996d353e2965578d4cba020addd 100644 (file)
@@ -31,7 +31,7 @@
 #include "../common/metadata/decoder.h"
 #include <babeltrace/common-internal.h>
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/ctf-ir/stream.h>
+#include <babeltrace/babeltrace.h>
 #include "fs.h"
 
 #define BT_LOG_TAG "PLUGIN-CTF-FS-QUERY-SRC"
@@ -228,14 +228,14 @@ end:
 }
 
 static
-int add_stream_ids(struct bt_value *info, struct bt_ctf_stream *stream)
+int add_stream_ids(struct bt_value *info, struct bt_stream *stream)
 {
        int ret = 0;
        int64_t stream_class_id, stream_instance_id;
        enum bt_value_status status;
-       struct bt_ctf_stream_class *stream_class = NULL;
+       struct bt_stream_class *stream_class = NULL;
 
-       stream_instance_id = bt_ctf_stream_get_id(stream);
+       stream_instance_id = bt_stream_get_id(stream);
        if (stream_instance_id != -1) {
                status = bt_value_map_insert_integer(info, "id",
                                stream_instance_id);
@@ -245,13 +245,13 @@ int add_stream_ids(struct bt_value *info, struct bt_ctf_stream *stream)
                }
        }
 
-       stream_class = bt_ctf_stream_get_class(stream);
+       stream_class = bt_stream_get_class(stream);
        if (!stream_class) {
                ret = -1;
                goto end;
        }
 
-       stream_class_id = bt_ctf_stream_class_get_id(stream_class);
+       stream_class_id = bt_stream_class_get_id(stream_class);
        if (stream_class_id == -1) {
                ret = -1;
                goto end;
@@ -438,10 +438,13 @@ int populate_trace_info(const char *trace_path, const char *trace_name,
        if (ret) {
                goto end;
        }
-       ret = add_range(trace_info, &trace_intersection,
-                       "intersection-range-ns");
-       if (ret) {
-               goto end;
+
+       if (trace_intersection.begin_ns < trace_intersection.end_ns) {
+               ret = add_range(trace_info, &trace_intersection,
+                               "intersection-range-ns");
+               if (ret) {
+                       goto end;
+               }
        }
 
        status = bt_value_map_insert(trace_info, "streams", file_groups);
This page took 0.028945 seconds and 4 git commands to generate.