Fix clock freq
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Feb 2012 21:05:15 +0000 (16:05 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Feb 2012 21:05:15 +0000 (16:05 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
include/babeltrace/ctf-ir/metadata.h

index 5b26ec66c1ab142b02524de7d5f958ff356b9ea4..2d3361cbdc5d3d889cbeed4ff7b281e0c8b2473c 100644 (file)
@@ -2160,7 +2160,7 @@ int ctf_clock_declaration_visit(FILE *fd, int depth, struct ctf_node *node,
                        }
                        clock->name = g_quark_from_string(right);
                        g_free(right);
-                       CTF_EVENT_SET_FIELD(clock, name);
+                       CTF_CLOCK_SET_FIELD(clock, name);
                } else if (!strcmp(left, "uuid")) {
                        char *right;
 
@@ -2191,7 +2191,7 @@ int ctf_clock_declaration_visit(FILE *fd, int depth, struct ctf_node *node,
                        }
                        clock->description = right;
                } else if (!strcmp(left, "freq")) {
-                       if (clock->freq) {
+                       if (CTF_CLOCK_FIELD_IS_SET(clock, freq)) {
                                fprintf(fd, "[error] %s: freq already declared in clock declaration\n", __func__);
                                ret = -EPERM;
                                goto error;
@@ -2202,6 +2202,7 @@ int ctf_clock_declaration_visit(FILE *fd, int depth, struct ctf_node *node,
                                ret = -EINVAL;
                                goto error;
                        }
+                       CTF_CLOCK_SET_FIELD(clock, freq);
                } else if (!strcmp(left, "precision")) {
                        if (clock->precision) {
                                fprintf(fd, "[error] %s: precision already declared in clock declaration\n", __func__);
index 79af77a768c0dda06e02023ba25850a8bde41dac..29d0fd492ec34d72d481d391eeb077b7b52e1919 100644 (file)
@@ -95,6 +95,7 @@ struct ctf_clock {
 
        enum {                                  /* Fields populated mask */
                CTF_CLOCK_name          =       (1U << 0),
+               CTF_CLOCK_freq          =       (1U << 1),
        } field_mask;
 };
 
This page took 0.037181 seconds and 4 git commands to generate.