X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Fctf-text.c;h=4cb4297e1363bc32afc29231cd47685be39eab83;hb=3a25e036c64003c5778538d7cfef8beccc65d640;hp=3b38ecaca9671fe88815ea5639ef264797f3212b;hpb=4716614abaa127d6d6722c845a413495d9cb2b6f;p=babeltrace.git diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 3b38ecac..4cb4297e 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -236,20 +236,20 @@ int ctf_text_write_event(struct stream_pos *ppos, struct ctf_stream_definition * return -EINVAL; } event_class = g_ptr_array_index(stream_class->events_by_id, id); - if (!event) { - fprintf(stderr, "[error] Event id %" PRIu64 " is unknown.\n", id); + if (!event_class) { + fprintf(stderr, "[error] Event class id %" PRIu64 " is unknown.\n", id); return -EINVAL; } /* Print events discarded */ if (stream->events_discarded) { fflush(pos->fp); - fprintf(stderr, "[warning] Tracer discarded %d events between [", + fprintf(stderr, "[warning] Tracer discarded %" PRIu64 " 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"); + fprintf(stderr, "]. You should consider recording a new trace with larger buffers or with fewer events enabled.\n"); fflush(stderr); stream->events_discarded = 0; } @@ -448,7 +448,6 @@ int ctf_text_write_event(struct stream_pos *ppos, struct ctf_stream_definition * /* newline */ fprintf(pos->fp, "\n"); pos->field_nr = 0; - stream->consumed = 1; return 0;