Store "tracer_name" from the trace's environment
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 12 Sep 2015 03:24:54 +0000 (23:24 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 22 Apr 2016 22:05:58 +0000 (18:05 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
include/babeltrace/ctf-ir/metadata.h

index 4b171984d5b819888c3221d1f0b5c6873c254dda..3b2fc78263b2e55904d89d871939120451dead9f 100644 (file)
@@ -2792,6 +2792,22 @@ int ctf_env_declaration_visit(FILE *fd, int depth, struct ctf_node *node,
                        env->domain[TRACER_ENV_LEN - 1] = '\0';
                        printf_verbose("env.domain = \"%s\"\n", env->domain);
                        g_free(right);
+               } else if (!strcmp(left, "tracer_name")) {
+                       char *right;
+
+                       if (env->tracer_name[0]) {
+                               fprintf(fd, "[warning] %s: duplicated env tracer_name\n", __func__);
+                               goto error;     /* ret is 0, so not an actual error, just warn. */
+                       }
+                       right = concatenate_unary_strings(&node->u.ctf_expression.right);
+                       if (!right) {
+                               fprintf(fd, "[warning] %s: unexpected unary expression for env tracer_name\n", __func__);
+                               goto error;     /* ret is 0, so not an actual error, just warn. */
+                       }
+                       strncpy(env->tracer_name, right, TRACER_ENV_LEN);
+                       env->tracer_name[TRACER_ENV_LEN - 1] = '\0';
+                       printf_verbose("env.tracer_name = \"%s\"\n", env->tracer_name);
+                       g_free(right);
                } else if (!strcmp(left, "sysname")) {
                        char *right;
 
index bc685801daf75617d62cd8bbafdf5caad7ed4ff5..0e16f6218f9ea95d8fb361e75e6714d7eaf2ef76 100644 (file)
@@ -184,6 +184,7 @@ struct ctf_tracer_env {
        char sysname[TRACER_ENV_LEN];
        char release[TRACER_ENV_LEN];
        char version[TRACER_ENV_LEN];
+       char tracer_name[TRACER_ENV_LEN];
 };
 
 struct ctf_trace {
This page took 0.035495 seconds and 4 git commands to generate.