fprintf(fp, " (or set BABELTRACE_DEBUG environment variable)\n");
fprintf(fp, " -n, --names name1<,name2,...> Print field names.\n");
fprintf(fp, " Available field names:\n");
- fprintf(fp, " payload OR args OR arg\n");
- fprintf(fp, " all, scope, header, context OR ctx\n");
+ fprintf(fp, " (payload OR args OR arg)\n");
+ fprintf(fp, " all, scope, header, (context OR ctx)\n");
+ fprintf(fp, " trace\n");
fprintf(fp, " (payload active by default)\n");
list_formats(fp);
fprintf(fp, "\n");
opt_header_field_names = 1;
else if (!strcmp(str, "payload") || !strcmp(str, "args") || !strcmp(str, "arg"))
opt_payload_field_names = 1;
+ else if (!strcmp(str, "trace"))
+ opt_trace_name = 1;
else {
fprintf(stdout, "[error] unknown field name type %s\n", str);
return -EINVAL;
opt_scope_field_names,
opt_header_field_names,
opt_context_field_names,
- opt_payload_field_names;
+ opt_payload_field_names,
+ opt_trace_name;
enum field_item {
ITEM_SCOPE,
else
fprintf(pos->fp, " ");
}
+ if ((opt_trace_name || opt_all_field_names) && stream_class->trace->path[0] != '\0') {
+ set_field_names_print(pos, ITEM_HEADER);
+ if (pos->print_names)
+ fprintf(pos->fp, "trace = ");
+
+ fprintf(pos->fp, "%s", stream_class->trace->path);
+
+ if (pos->print_names)
+ fprintf(pos->fp, ", ");
+ else
+ fprintf(pos->fp, " ");
+ }
set_field_names_print(pos, ITEM_HEADER);
if (pos->print_names)
fprintf(pos->fp, "name = ");