From: Mathieu Desnoyers Date: Mon, 9 May 2011 18:55:57 +0000 (-0400) Subject: Hide timestamp field if timestamp is 0 X-Git-Tag: v0.1~59 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=be60c7fb60112cdabfcfaae5c50d3b937f454ad8 Hide timestamp field if timestamp is 0 Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 70e0e92a..9c449589 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -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));