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, "]");