From 0ac862b485e8c287c1f9b560b357790ae63d110d Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 2 Jun 2017 11:12:52 -0400 Subject: [PATCH] copy_trace: copy the trace name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez 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 a56e8146..54a7fd14 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.c +++ b/plugins/libctfcopytrace/ctfcopytrace.c @@ -808,6 +808,7 @@ enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, int field_count, i, int_ret; struct bt_ctf_field_type *header_type = NULL; enum bt_ctf_byte_order order; + const char *trace_name; field_count = bt_ctf_trace_get_environment_field_count(trace); for (i = 0; i < field_count; i++) { @@ -878,6 +879,16 @@ enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, } } + trace_name = bt_ctf_trace_get_name(trace); + if (trace_name) { + int_ret = bt_ctf_trace_set_name(writer_trace, trace_name); + 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