X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fcallbacks.c;h=8e0d61e62e36d2c2de9ff451ace8ebcc91cf7551;hp=f4e0a1451c84974deba2b279563ba663e71aac14;hb=8a4722b0ccf5cf30ee76a85bdf6bea2fa0515153;hpb=634d474be8d4262f5a3e549cdb6891de239f4fe4 diff --git a/formats/ctf/callbacks.c b/formats/ctf/callbacks.c index f4e0a145..8e0d61e6 100644 --- a/formats/ctf/callbacks.c +++ b/formats/ctf/callbacks.c @@ -64,7 +64,7 @@ struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...) */ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, bt_intern_str event, void *private_data, int flags, - enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, + enum bt_cb_ret (*callback)(struct ctf_event_definition *ctf_data, void *private_data), struct bt_dependencies *depends, struct bt_dependencies *weak_depends, @@ -83,7 +83,7 @@ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, tin = container_of(td_read, struct ctf_trace, parent); for (stream_id = 0; stream_id < tin->streams->len; stream_id++) { - struct ctf_stream_class *stream; + struct ctf_stream_declaration *stream; struct bt_stream_callbacks *bt_stream_cb = NULL; struct bt_callback_chain *bt_chain = NULL; struct bt_callback new_callback; @@ -106,7 +106,7 @@ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, (gconstpointer) (unsigned long) event); /* event not found in this stream class */ if (!event_id_ptr) { - fprintf(stderr, "event not found\n"); + fprintf(stderr, "[error] Event ID not found in stream class\n"); continue; } event_id = (uint64_t)(unsigned long) *event_id_ptr; @@ -146,11 +146,11 @@ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, } static -struct ctf_stream_event *extract_ctf_stream_event(struct ctf_stream *stream) +struct ctf_event_definition *extract_ctf_stream_event(struct ctf_stream_definition *stream) { - struct ctf_stream_class *stream_class = stream->stream_class; - struct ctf_event *event_class; - struct ctf_stream_event *event; + struct ctf_stream_declaration *stream_class = stream->stream_class; + struct ctf_event_declaration *event_class; + struct ctf_event_definition *event; uint64_t id = stream->event_id; if (id >= stream_class->events_by_id->len) { @@ -172,17 +172,16 @@ struct ctf_stream_event *extract_ctf_stream_event(struct ctf_stream *stream) } void process_callbacks(struct bt_ctf_iter *iter, - struct ctf_stream *stream) + struct ctf_stream_definition *stream) { struct bt_stream_callbacks *bt_stream_cb; struct bt_callback_chain *bt_chain; struct bt_callback *cb; int i; enum bt_cb_ret ret; - struct bt_ctf_event ctf_data; + struct ctf_event_definition *ctf_data; - ctf_data.event = extract_ctf_stream_event(stream); - ctf_data.stream = stream; + ctf_data = extract_ctf_stream_event(stream); /* process all events callback first */ if (iter->main_callbacks.callback) { @@ -190,7 +189,7 @@ void process_callbacks(struct bt_ctf_iter *iter, cb = &g_array_index(iter->main_callbacks.callback, struct bt_callback, i); if (!cb) goto end; - ret = cb->callback(&ctf_data, cb->private_data); + ret = cb->callback(ctf_data, cb->private_data); switch (ret) { case BT_CB_OK_STOP: case BT_CB_ERROR_STOP: @@ -218,7 +217,7 @@ void process_callbacks(struct bt_ctf_iter *iter, cb = &g_array_index(bt_chain->callback, struct bt_callback, i); if (!cb) goto end; - ret = cb->callback(&ctf_data, cb->private_data); + ret = cb->callback(ctf_data, cb->private_data); switch (ret) { case BT_CB_OK_STOP: case BT_CB_ERROR_STOP: