From 40b9ea676c5490358df4955d4938999d1814d9b2 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 4 Jul 2017 13:51:01 -0400 Subject: [PATCH] libctfcopytrace: copy trace's UUID 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/libctfcopytrace/ctfcopytrace.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/libctfcopytrace/ctfcopytrace.c b/plugins/libctfcopytrace/ctfcopytrace.c index aad87b8a..2b408ace 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.c +++ b/plugins/libctfcopytrace/ctfcopytrace.c @@ -855,6 +855,7 @@ enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, struct bt_ctf_field_type *header_type = NULL; enum bt_ctf_byte_order order; const char *trace_name; + const unsigned char *trace_uuid; field_count = bt_ctf_trace_get_environment_field_count(trace); for (i = 0; i < field_count; i++) { @@ -935,6 +936,16 @@ enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, } } + trace_uuid = bt_ctf_trace_get_uuid(trace); + if (trace_uuid) { + int_ret = bt_ctf_trace_set_uuid(writer_trace, trace_uuid); + if (int_ret < 0) { + fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, __LINE__); + ret = BT_COMPONENT_STATUS_ERROR; + goto end; + } + } + end: return ret; } -- 2.34.1