}
}
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__);
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;
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;
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;