X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fcallbacks.c;h=b3856cebc7b2449068293639715acc1b473d0bc9;hp=ec6edba80ba76bf434e50964d1f51aba5c6f81aa;hb=fa709ab2ef8c8331fcccb6408fc7740918fc286d;hpb=6f3077a2db5bfeb47ed75b1c7c731a5e8e60aa43 diff --git a/lib/callbacks.c b/lib/callbacks.c index ec6edba8..b3856ceb 100644 --- a/lib/callbacks.c +++ b/lib/callbacks.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -69,7 +70,7 @@ int babeltrace_iter_add_callback(struct babeltrace_iter *iter, int i, stream_id; gpointer *event_id_ptr; unsigned long event_id; - struct trace_collection *tc = iter->tc; + struct trace_collection *tc = iter->ctx->tc; for (i = 0; i < tc->array->len; i++) { struct ctf_trace *tin; @@ -102,7 +103,7 @@ int babeltrace_iter_add_callback(struct babeltrace_iter *iter, (gconstpointer) (unsigned long) event); /* event not found in this stream class */ if (!event_id_ptr) { - printf("event not found\n"); + fprintf(stderr, "event not found\n"); continue; } event_id = (uint64_t)(unsigned long) *event_id_ptr; @@ -150,17 +151,17 @@ struct ctf_stream_event *extract_ctf_stream_event(struct ctf_stream *stream) uint64_t id = stream->event_id; if (id >= stream_class->events_by_id->len) { - fprintf(stdout, "[error] Event id %" PRIu64 " is outside range.\n", id); + fprintf(stderr, "[error] Event id %" PRIu64 " is outside range.\n", id); return NULL; } event = g_ptr_array_index(stream->events_by_id, id); if (!event) { - fprintf(stdout, "[error] Event id %" PRIu64 " is unknown.\n", id); + fprintf(stderr, "[error] Event id %" PRIu64 " is unknown.\n", id); return NULL; } event_class = g_ptr_array_index(stream_class->events_by_id, id); if (!event_class) { - fprintf(stdout, "[error] Event id %" PRIu64 " is unknown.\n", id); + fprintf(stderr, "[error] Event id %" PRIu64 " is unknown.\n", id); return NULL; }