copy_trace: copy the trace name
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 2 Jun 2017 15:12:52 +0000 (11:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:02:58 +0000 (17:02 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/libctfcopytrace/ctfcopytrace.c

index a56e8146a306940af406b420e8a3906f863a4ed2..54a7fd14d175221989e01cf9ecabd0915d4a3f28 100644 (file)
@@ -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;
 }
This page took 0.024636 seconds and 4 git commands to generate.