Hide timestamp field if timestamp is 0
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 9 May 2011 18:55:57 +0000 (14:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 9 May 2011 18:55:57 +0000 (14:55 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf-text/ctf-text.c

index 70e0e92ab6604a7535724b520808247b7dc43489..9c44958996deca5503c701601e5355b86f3ce9a3 100644 (file)
@@ -93,18 +93,20 @@ int ctf_text_write_event(struct stream_pos *ppos,
                return -EINVAL;
        }
 
-       if (pos->print_names)
-               fprintf(pos->fp, "timestamp = ");
-       else
-               fprintf(pos->fp, "[");
-       fprintf(pos->fp, "%12" PRIu64, stream->timestamp);
-       if (!pos->print_names)
-               fprintf(pos->fp, "]");
+       if (stream->timestamp) {
+               if (pos->print_names)
+                       fprintf(pos->fp, "timestamp = ");
+               else
+                       fprintf(pos->fp, "[");
+               fprintf(pos->fp, "%12" PRIu64, stream->timestamp);
+               if (!pos->print_names)
+                       fprintf(pos->fp, "]");
 
-       if (pos->print_names)
-               fprintf(pos->fp, ", ");
-       else
-               fprintf(pos->fp, " ");
+               if (pos->print_names)
+                       fprintf(pos->fp, ", ");
+               else
+                       fprintf(pos->fp, " ");
+       }
        if (pos->print_names)
                fprintf(pos->fp, "name = ");
        fprintf(pos->fp, "%s", g_quark_to_string(event_class->name));
This page took 0.024502 seconds and 4 git commands to generate.