From be60c7fb60112cdabfcfaae5c50d3b937f454ad8 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 9 May 2011 14:55:57 -0400 Subject: [PATCH] Hide timestamp field if timestamp is 0 Signed-off-by: Mathieu Desnoyers --- formats/ctf-text/ctf-text.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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)); -- 2.34.1