flt.lttng-utils.debug-info: copy original stream's numeric ID
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 4 Jul 2017 17:51:29 +0000 (13:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 6 Jul 2017 20:25:09 +0000 (16:25 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/lttng-utils/copy.c

index 52d5b4899b7b3f63abaa10ba1da4e4963809eb11..a2250c2c75f28a052878e15e29e5b83d7339a6f5 100644 (file)
@@ -1242,6 +1242,7 @@ struct bt_ctf_stream *insert_new_stream(
        struct bt_ctf_stream *writer_stream = NULL;
        struct bt_ctf_stream_class *stream_class = NULL;
        struct bt_ctf_stream_class *writer_stream_class = NULL;
+       int64_t id;
 
        stream_class = bt_ctf_stream_get_class(stream);
        if (!stream_class) {
@@ -1265,8 +1266,16 @@ struct bt_ctf_stream *insert_new_stream(
        }
        bt_get(writer_stream_class);
 
-       writer_stream = bt_ctf_stream_create(writer_stream_class,
-                       bt_ctf_stream_get_name(stream));
+       id = bt_ctf_stream_get_id(stream);
+       if (id < 0) {
+               writer_stream = bt_ctf_stream_create(writer_stream_class,
+                               bt_ctf_stream_get_name(stream));
+       } else {
+               writer_stream = bt_ctf_stream_create_with_id(
+                       writer_stream_class,
+                       bt_ctf_stream_get_name(stream), id);
+       }
+
        if (!writer_stream) {
                fprintf(debug_it->err, "[error] %s in %s:%d\n",
                                __func__, __FILE__, __LINE__);
This page took 0.025443 seconds and 4 git commands to generate.