X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Flttng-live%2Fdata-stream.c;h=1692715139084bd1c70f0a1b3f7c495faec9e02d;hb=40f4ba76dd6f9508ca51b6220eaed57632281a07;hp=10613c8485fbbaf6691c3fe8e715bf21f9671f5b;hpb=9d408fcae74602e3591f66623ceb85f482d948ed;p=babeltrace.git diff --git a/plugins/ctf/lttng-live/data-stream.c b/plugins/ctf/lttng-live/data-stream.c index 10613c84..16927151 100644 --- a/plugins/ctf/lttng-live/data-stream.c +++ b/plugins/ctf/lttng-live/data-stream.c @@ -34,17 +34,17 @@ #include #include #include "../common/notif-iter/notif-iter.h" -#include +#include #include "data-stream.h" static -enum bt_ctf_notif_iter_medium_status medop_request_bytes( +enum bt_notif_iter_medium_status medop_request_bytes( size_t request_sz, uint8_t **buffer_addr, size_t *buffer_sz, void *data) { - enum bt_ctf_notif_iter_medium_status status = - BT_CTF_NOTIF_ITER_MEDIUM_STATUS_OK; + enum bt_notif_iter_medium_status status = + BT_NOTIF_ITER_MEDIUM_STATUS_OK; struct lttng_live_stream_iterator *stream = data; struct lttng_live_trace *trace = stream->trace; struct lttng_live_session *session = trace->session; @@ -57,7 +57,7 @@ enum bt_ctf_notif_iter_medium_status medop_request_bytes( len_left = stream->base_offset + stream->len - stream->offset; if (!len_left) { stream->state = LTTNG_LIVE_STREAM_ACTIVE_NO_DATA; - status = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_AGAIN; + status = BT_NOTIF_ITER_MEDIUM_STATUS_AGAIN; return status; } read_len = MIN(request_sz, stream->buflen); @@ -72,26 +72,26 @@ enum bt_ctf_notif_iter_medium_status medop_request_bytes( } static -struct bt_ctf_stream *medop_get_stream( - struct bt_ctf_stream_class *stream_class, +const struct bt_stream *medop_get_stream( + const struct bt_stream_class *stream_class, uint64_t stream_id, void *data) { struct lttng_live_stream_iterator *lttng_live_stream = data; if (!lttng_live_stream->stream) { int64_t stream_class_id = - bt_ctf_stream_class_get_id(stream_class); + bt_stream_class_get_id(stream_class); BT_LOGD("Creating stream %s (ID: %" PRIu64 ") out of stream class %" PRId64, lttng_live_stream->name, stream_id, stream_class_id); if (stream_id == -1ULL) { /* No stream ID */ - lttng_live_stream->stream = bt_ctf_stream_create( + lttng_live_stream->stream = bt_stream_create( stream_class, lttng_live_stream->name); } else { lttng_live_stream->stream = - bt_ctf_stream_create_with_id(stream_class, + bt_stream_create_with_id(stream_class, lttng_live_stream->name, stream_id); } @@ -105,20 +105,20 @@ struct bt_ctf_stream *medop_get_stream( return lttng_live_stream->stream; } -static struct bt_ctf_notif_iter_medium_ops medops = { +static struct bt_notif_iter_medium_ops medops = { .request_bytes = medop_request_bytes, .get_stream = medop_get_stream, }; BT_HIDDEN -enum bt_ctf_lttng_live_iterator_status lttng_live_lazy_notif_init( +enum bt_lttng_live_iterator_status lttng_live_lazy_notif_init( struct lttng_live_session *session) { struct lttng_live_component *lttng_live = session->lttng_live; struct lttng_live_trace *trace; if (!session->lazy_stream_notif_init) { - return BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_OK; + return BT_LTTNG_LIVE_ITERATOR_STATUS_OK; } bt_list_for_each_entry(trace, &session->traces, node) { @@ -128,7 +128,7 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_lazy_notif_init( if (stream->notif_iter) { continue; } - stream->notif_iter = bt_ctf_notif_iter_create(trace->trace, + stream->notif_iter = bt_notif_iter_create(trace->trace, lttng_live->max_query_size, medops, stream); if (!stream->notif_iter) { @@ -139,10 +139,10 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_lazy_notif_init( session->lazy_stream_notif_init = false; - return BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_OK; + return BT_LTTNG_LIVE_ITERATOR_STATUS_OK; error: - return BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_ERROR; + return BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; } BT_HIDDEN @@ -170,7 +170,7 @@ struct lttng_live_stream_iterator *lttng_live_stream_iterator_create( stream->last_returned_inactivity_timestamp = INT64_MIN; if (trace->trace) { - stream->notif_iter = bt_ctf_notif_iter_create(trace->trace, + stream->notif_iter = bt_notif_iter_create(trace->trace, lttng_live->max_query_size, medops, stream); if (!stream->notif_iter) { @@ -181,7 +181,7 @@ struct lttng_live_stream_iterator *lttng_live_stream_iterator_create( stream->buflen = session->lttng_live->max_query_size; ret = lttng_live_add_port(lttng_live, stream); - assert(!ret); + BT_ASSERT(!ret); bt_list_add(&stream->node, &trace->streams); @@ -206,17 +206,17 @@ void lttng_live_stream_iterator_destroy(struct lttng_live_stream_iterator *strea lttng_live = stream->trace->session->lttng_live; ret = lttng_live_remove_port(lttng_live, stream->port); - assert(!ret); + BT_ASSERT(!ret); if (stream->stream) { - BT_PUT(stream->stream); + BT_OBJECT_PUT_REF_AND_RESET(stream->stream); } if (stream->notif_iter) { - bt_ctf_notif_iter_destroy(stream->notif_iter); + bt_notif_iter_destroy(stream->notif_iter); } g_free(stream->buf); - BT_PUT(stream->packet_end_notif_queue); + BT_OBJECT_PUT_REF_AND_RESET(stream->packet_end_notif_queue); bt_list_del(&stream->node); /* * Ensure we poke the trace metadata in the future, which is