ax_lib_elfutils -> bt_lib_elfutils
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-generate-io-struct.c
index 40ba4aa03ba6222802d6ae55f5aa39167478a658..097a482e171891d42f7f0c07aa864fa16a189fd3 100644 (file)
@@ -1114,7 +1114,7 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
                        }
                }
                if (!container_type) {
-                       declaration = bt_lookup_declaration(g_quark_from_static_string("int"),
+                       declaration = bt_lookup_declaration(g_quark_from_string("int"),
                                                         declaration_scope);
                        if (!declaration) {
                                fprintf(fd, "[error] %s: \"int\" type declaration missing for enumeration\n", __func__);
@@ -2075,7 +2075,7 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
        if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
                /* check that packet header has stream_id field. */
                if (!trace->packet_header_decl
-                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("stream_id")) < 0) {
+                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("stream_id")) < 0) {
                        ret = -EPERM;
                        fprintf(fd, "[error] %s: missing stream_id field in packet header declaration, but stream_id attribute is declared for stream.\n", __func__);
                        goto error;
@@ -2293,7 +2293,7 @@ int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
        if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
                /* check that the packet header contains a "magic" field */
                if (!trace->packet_header_decl
-                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("magic")) < 0) {
+                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("magic")) < 0) {
                        ret = -EPERM;
                        fprintf(fd, "[error] %s: missing both byte_order and packet header magic number in trace declaration\n", __func__);
                        goto error;
@@ -2791,6 +2791,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;
 
This page took 0.024808 seconds and 4 git commands to generate.