X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Fctf-text.c;h=83f0cf9c9ac1e8385e2ed29c2574ba0ab60a2e7e;hb=6743f229982176bfc2bdd2b3ab5c75ca62f45b35;hp=a837f914b436a01f1fce65fab994e4f55e98cc2e;hpb=359d7456178eeebd3f5a11c7ef2050b91f68123b;p=babeltrace.git diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index a837f914..83f0cf9c 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -182,18 +182,26 @@ int ctf_text_write_event(struct stream_pos *ppos, return -EINVAL; } - if (stream->has_timestamp) { - uint64_t ts_sec, ts_nsec; + /* Print events discarded */ + if (stream->events_discarded) { + fflush(pos->fp); + fprintf(stderr, "[warning] Tracer discarded %d events between [", + stream->events_discarded); + ctf_print_timestamp(stderr, stream, stream->prev_timestamp); + fprintf(stderr, "] and ["); + ctf_print_timestamp(stderr, stream, stream->prev_timestamp_end); + fprintf(stderr, "]. You should consider increasing the buffer size.\n"); + fflush(stderr); + stream->events_discarded = 0; + } - ts_sec = stream->timestamp / NSEC_PER_SEC; - ts_nsec = stream->timestamp % NSEC_PER_SEC; + if (stream->has_timestamp) { set_field_names_print(pos, ITEM_HEADER); if (pos->print_names) fprintf(pos->fp, "timestamp = "); else fprintf(pos->fp, "["); - fprintf(pos->fp, "%3" PRIu64 ".%09" PRIu64, - ts_sec, ts_nsec); + ctf_print_timestamp(pos->fp, stream, stream->timestamp); if (!pos->print_names) fprintf(pos->fp, "]");