+void print_uuid(FILE *fp, unsigned char *uuid)
+{
+ int i;
+
+ for (i = 0; i < BABELTRACE_UUID_LEN; i++)
+ fprintf(fp, "%x", (unsigned int) uuid[i]);
+}
+
+void ctf_print_discarded(FILE *fp, struct ctf_stream_definition *stream,
+ int end_stream)
+{
+ fprintf(fp, "[warning] Tracer discarded %" PRIu64 " events %sbetween [",
+ stream->events_discarded,
+ end_stream ? "at end of stream " : "");
+ if (opt_clock_cycles) {
+ ctf_print_timestamp(fp, stream,
+ stream->prev_cycles_timestamp);
+ fprintf(fp, "] and [");
+ ctf_print_timestamp(fp, stream,
+ stream->prev_cycles_timestamp_end);
+ } else {
+ ctf_print_timestamp(fp, stream,
+ stream->prev_real_timestamp);
+ fprintf(fp, "] and [");
+ ctf_print_timestamp(fp, stream,
+ stream->prev_real_timestamp_end);
+ }
+ fprintf(fp, "] in trace UUID ");
+ print_uuid(fp, stream->stream_class->trace->uuid);
+ if (stream->stream_class->trace->parent.path[0])
+ fprintf(fp, ", at path: \"%s\"",
+ stream->stream_class->trace->parent.path);
+
+ fprintf(fp, ", within stream id %" PRIu64, stream->stream_id);
+ if (stream->path[0])
+ fprintf(fp, ", at relative path: \"%s\"", stream->path);
+ fprintf(fp, ". ");
+ fprintf(fp, "You should consider recording a new trace with larger "
+ "buffers or with fewer events enabled.\n");
+ fflush(fp);
+}
+
+static
+int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream)