From b910013b54a9afa2f41c2449df4fbcc8d36f6320 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 4 Jul 2017 13:51:29 -0400 Subject: [PATCH] flt.lttng-utils.debug-info: copy original stream's numeric ID MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- plugins/lttng-utils/copy.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/lttng-utils/copy.c b/plugins/lttng-utils/copy.c index 52d5b489..a2250c2c 100644 --- a/plugins/lttng-utils/copy.c +++ b/plugins/lttng-utils/copy.c @@ -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__); -- 2.34.1