Add support for trace:hostname field
[babeltrace.git] / formats / ctf-text / ctf-text.c
index 55158caa427ed6666c017c6259965fa568a217e9..d209eca23f99da6634d6c1680045d8a3bd14f79b 100644 (file)
@@ -46,6 +46,7 @@ int opt_all_field_names,
        opt_trace_domain_field,
        opt_trace_procname_field,
        opt_trace_vpid_field,
+       opt_trace_hostname_field,
        opt_loglevel_field,
        opt_delta_field = 1;
 
@@ -322,6 +323,16 @@ int ctf_text_write_event(struct stream_pos *ppos, struct ctf_stream_definition *
                else
                        fprintf(pos->fp, " ");
        }
+       if ((opt_trace_hostname_field && !opt_all_fields) && stream_class->trace->env.hostname[0] != '\0') {
+               set_field_names_print(pos, ITEM_HEADER);
+               if (pos->print_names) {
+                       fprintf(pos->fp, "trace:hostname = ");
+               }
+               fprintf(pos->fp, "%s", stream_class->trace->env.hostname);
+               if (pos->print_names)
+                       fprintf(pos->fp, ", ");
+               dom_print = 1;
+       }
        if ((opt_trace_domain_field && !opt_all_fields) && stream_class->trace->env.domain[0] != '\0') {
                set_field_names_print(pos, ITEM_HEADER);
                if (pos->print_names) {
This page took 0.031494 seconds and 4 git commands to generate.