libctfcopytrace: copy trace's UUID
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 4 Jul 2017 17:51:01 +0000 (13:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 6 Jul 2017 20:24:47 +0000 (16:24 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/libctfcopytrace/ctfcopytrace.c

index aad87b8ac980263e39c578e4dc834155ac07d301..2b408ace8d1765bb73ecdaa4d379a8a71d232e2e 100644 (file)
@@ -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;
 }
This page took 0.024557 seconds and 4 git commands to generate.