trace_uuid -> uuid and add packet metadata support
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-generate-io-struct.c
index ecd9ffd9217b88873e6523ebd4b8027e4d47a5cb..9a5cda096f321509527492b24d0510dc613dda4b 100644 (file)
@@ -1887,17 +1887,19 @@ int ctf_trace_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru
                        }
                        CTF_TRACE_SET_FIELD(trace, minor);
                } else if (!strcmp(left, "uuid")) {
-                       if (CTF_TRACE_FIELD_IS_SET(trace, uuid)) {
-                               fprintf(fd, "[error] %s: uuid already declared in trace declaration\n", __func__);
-                               ret = -EPERM;
-                               goto error;
-                       }
+                       uuid_t uuid;
                        ret = get_unary_uuid(&node->u.ctf_expression.right, &trace->uuid);
                        if (ret) {
                                fprintf(fd, "[error] %s: unexpected unary expression for trace uuid\n", __func__);
                                ret = -EINVAL;
                                goto error;
                        }
+                       if (CTF_TRACE_FIELD_IS_SET(trace, uuid)
+                               && uuid_compare(uuid, trace->uuid)) {
+                               fprintf(fd, "[error] %s: uuid mismatch\n", __func__);
+                               ret = -EPERM;
+                               goto error;
+                       }
                        CTF_TRACE_SET_FIELD(trace, uuid);
                } else if (!strcmp(left, "byte_order")) {
                        struct ctf_node *right;
This page took 0.024098 seconds and 4 git commands to generate.