X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fctf%2Flttng-live%2Flttng-live.c;h=9fd35b2a21d15b9a410e741fc2633dc019953794;hb=0d2d7e51d3280b67a5ce118ef4545ebb77e09aab;hp=833c2ab62a4f7be8378dbd8c67276812e9219bf9;hpb=28e6ca8b6e08d1cdd1af81ae819aa39baa206eaf;p=babeltrace.git diff --git a/plugins/ctf/lttng-live/lttng-live.c b/plugins/ctf/lttng-live/lttng-live.c index 833c2ab6..9fd35b2a 100644 --- a/plugins/ctf/lttng-live/lttng-live.c +++ b/plugins/ctf/lttng-live/lttng-live.c @@ -68,7 +68,7 @@ static const char *print_state(struct lttng_live_stream_iterator *s) static void print_stream_state(struct lttng_live_stream_iterator *stream) { - struct bt_port *port; + const bt_port *port; port = bt_port_from_private(stream->port); print_dbg("stream %s state %s last_inact_ts %" PRId64 " cur_inact_ts %" PRId64, @@ -76,14 +76,14 @@ void print_stream_state(struct lttng_live_stream_iterator *stream) print_state(stream), stream->last_returned_inactivity_timestamp, stream->current_inactivity_timestamp); - bt_object_put_ref(port); + bt_port_put_ref(port); } BT_HIDDEN bt_bool lttng_live_is_canceled(struct lttng_live_component *lttng_live) { - struct bt_component *component; - struct bt_graph *graph; + bt_component *component; + const bt_graph *graph; bt_bool ret; if (!lttng_live) { @@ -92,9 +92,9 @@ bt_bool lttng_live_is_canceled(struct lttng_live_component *lttng_live) component = bt_component_from_private(lttng_live->private_component); graph = bt_component_get_graph(component); - ret = bt_private_graph_is_canceled(graph); - bt_object_put_ref(graph); - bt_object_put_ref(component); + ret = bt_graph_is_canceled(graph); + bt_graph_put_ref(graph); + bt_component_put_ref(component); return ret; } @@ -105,7 +105,7 @@ int lttng_live_add_port(struct lttng_live_component *lttng_live, int ret; struct bt_private_port *private_port; char name[STREAM_NAME_MAX_LEN]; - enum bt_component_status status; + bt_component_status status; ret = sprintf(name, STREAM_NAME_PREFIX "%" PRIu64, stream_iter->viewer_stream_id); BT_ASSERT(ret > 0); @@ -113,7 +113,7 @@ int lttng_live_add_port(struct lttng_live_component *lttng_live, if (lttng_live_is_canceled(lttng_live)) { return 0; } - status = bt_private_component_source_add_output_port( + status = bt_self_component_source_add_output_port( lttng_live->private_component, name, stream_iter, &private_port); switch (status) { @@ -145,7 +145,7 @@ BT_HIDDEN int lttng_live_remove_port(struct lttng_live_component *lttng_live, struct bt_private_port *port) { - struct bt_component *component; + bt_component *component; int64_t nr_ports; int ret; @@ -154,16 +154,16 @@ int lttng_live_remove_port(struct lttng_live_component *lttng_live, if (nr_ports < 0) { return -1; } - BT_OBJECT_PUT_REF_AND_RESET(component); + BT_COMPONENT_PUT_REF_AND_RESET(component); if (nr_ports == 1) { - enum bt_component_status status; + bt_component_status status; BT_ASSERT(!lttng_live->no_stream_port); if (lttng_live_is_canceled(lttng_live)) { return 0; } - status = bt_private_component_source_add_output_port(lttng_live->private_component, + status = bt_self_component_source_add_output_port(lttng_live->private_component, "no-stream", lttng_live->no_stream_iter, <tng_live->no_stream_port); switch (status) { @@ -201,7 +201,7 @@ struct lttng_live_trace *lttng_live_find_trace(struct lttng_live_session *sessio } static -void lttng_live_destroy_trace(struct bt_object *obj) +void lttng_live_destroy_trace(bt_object *obj) { struct lttng_live_trace *trace = container_of(obj, struct lttng_live_trace, obj); @@ -214,7 +214,7 @@ void lttng_live_destroy_trace(struct bt_object *obj) retval = bt_trace_set_is_static(trace->trace); BT_ASSERT(!retval); - BT_OBJECT_PUT_REF_AND_RESET(trace->trace); + BT_TRACE_PUT_REF_AND_RESET(trace->trace); } lttng_live_metadata_fini(trace); BT_OBJECT_PUT_REF_AND_RESET(trace->cc_prio_map); @@ -339,10 +339,10 @@ void lttng_live_destroy_session(struct lttng_live_session *session) } BT_HIDDEN -void lttng_live_iterator_finalize(struct bt_private_connection_private_notification_iterator *it) +void lttng_live_iterator_finalize(bt_self_message_iterator *it) { struct lttng_live_stream_iterator_generic *s = - bt_private_connection_private_notification_iterator_get_user_data(it); + bt_self_message_iterator_get_user_data(it); switch (s->type) { case LIVE_STREAM_TYPE_NO_STREAM: @@ -362,7 +362,7 @@ void lttng_live_iterator_finalize(struct bt_private_connection_private_notificat } static -enum bt_lttng_live_iterator_status lttng_live_iterator_next_check_stream_state( +bt_lttng_live_iterator_status lttng_live_iterator_next_check_stream_state( struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *lttng_live_stream) { @@ -393,11 +393,11 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_check_stream_state( * return EOF. */ static -enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_no_data_stream( +bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_no_data_stream( struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *lttng_live_stream) { - enum bt_lttng_live_iterator_status ret = + bt_lttng_live_iterator_status ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; struct packet_index index; enum lttng_live_stream_state orig_state = lttng_live_stream->state; @@ -442,18 +442,18 @@ end: } /* - * Creation of the notification requires the ctf trace to be created + * Creation of the message requires the ctf trace to be created * beforehand, but the live protocol gives us all streams (including * metadata) at once. So we split it in three steps: getting streams, * getting metadata (which creates the ctf trace), and then creating the - * per-stream notifications. + * per-stream messages. */ static -enum bt_lttng_live_iterator_status lttng_live_get_session( +bt_lttng_live_iterator_status lttng_live_get_session( struct lttng_live_component *lttng_live, struct lttng_live_session *session) { - enum bt_lttng_live_iterator_status status; + bt_lttng_live_iterator_status status; struct lttng_live_trace *trace, *t; if (lttng_live_attach_session(session)) { @@ -475,7 +475,7 @@ enum bt_lttng_live_iterator_status lttng_live_get_session( return status; } } - return lttng_live_lazy_notif_init(session); + return lttng_live_lazy_msg_init(session); } BT_HIDDEN @@ -504,10 +504,10 @@ void lttng_live_force_new_streams_and_metadata(struct lttng_live_component *lttn } static -enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_new_streams_and_metadata( +bt_lttng_live_iterator_status lttng_live_iterator_next_handle_new_streams_and_metadata( struct lttng_live_component *lttng_live) { - enum bt_lttng_live_iterator_status ret = + bt_lttng_live_iterator_status ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; unsigned int nr_sessions_opened = 0; struct lttng_live_session *session, *s; @@ -553,18 +553,18 @@ end: } static -enum bt_lttng_live_iterator_status emit_inactivity_notification( +bt_lttng_live_iterator_status emit_inactivity_message( struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *lttng_live_stream, - struct bt_notification **notification, + const bt_message **message, uint64_t timestamp) { - enum bt_lttng_live_iterator_status ret = + bt_lttng_live_iterator_status ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; struct lttng_live_trace *trace; - struct bt_clock_class *clock_class = NULL; - struct bt_clock_value *clock_value = NULL; - struct bt_notification *notif = NULL; + const bt_clock_class *clock_class = NULL; + bt_clock_snapshot *clock_snapshot = NULL; + const bt_message *msg = NULL; int retval; trace = lttng_live_stream->trace; @@ -575,40 +575,40 @@ enum bt_lttng_live_iterator_status emit_inactivity_notification( if (!clock_class) { goto error; } - clock_value = bt_clock_value_create(clock_class, timestamp); - if (!clock_value) { + clock_snapshot = bt_clock_snapshot_create(clock_class, timestamp); + if (!clock_snapshot) { goto error; } - notif = bt_notification_inactivity_create(trace->cc_prio_map); - if (!notif) { + msg = bt_message_inactivity_create(trace->cc_prio_map); + if (!msg) { goto error; } - retval = bt_notification_inactivity_set_clock_value(notif, clock_value); + retval = bt_message_inactivity_set_clock_snapshot(msg, clock_snapshot); if (retval) { goto error; } - *notification = notif; + *message = msg; end: - bt_object_put_ref(clock_value); - bt_object_put_ref(clock_class); + bt_object_put_ref(clock_snapshot); + bt_clock_class_put_ref(clock_class); return ret; error: ret = BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; - bt_object_put_ref(notif); + bt_message_put_ref(msg); goto end; } static -enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_quiescent_stream( +bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_quiescent_stream( struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *lttng_live_stream, - struct bt_notification **notification) + const bt_message **message) { - enum bt_lttng_live_iterator_status ret = + bt_lttng_live_iterator_status ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; - struct bt_clock_class *clock_class = NULL; - struct bt_clock_value *clock_value = NULL; + const bt_clock_class *clock_class = NULL; + bt_clock_snapshot *clock_snapshot = NULL; if (lttng_live_stream->state != LTTNG_LIVE_STREAM_QUIESCENT) { return BT_LTTNG_LIVE_ITERATOR_STATUS_OK; @@ -621,26 +621,26 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_quiescent goto end; } - ret = emit_inactivity_notification(lttng_live, lttng_live_stream, notification, + ret = emit_inactivity_message(lttng_live, lttng_live_stream, message, (uint64_t) lttng_live_stream->current_inactivity_timestamp); lttng_live_stream->last_returned_inactivity_timestamp = lttng_live_stream->current_inactivity_timestamp; end: - bt_object_put_ref(clock_value); - bt_object_put_ref(clock_class); + bt_object_put_ref(clock_snapshot); + bt_clock_class_put_ref(clock_class); return ret; } static -enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_data_stream( +bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_data_stream( struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *lttng_live_stream, - struct bt_notification **notification) + const bt_message **message) { - enum bt_lttng_live_iterator_status ret = + bt_lttng_live_iterator_status ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; - enum bt_notif_iter_status status; + enum bt_msg_iter_status status; struct lttng_live_session *session; bt_list_for_each_entry(session, <tng_live->sessions, node) { @@ -659,36 +659,36 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_da if (lttng_live_stream->state != LTTNG_LIVE_STREAM_ACTIVE_DATA) { return BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; } - if (lttng_live_stream->packet_end_notif_queue) { - *notification = lttng_live_stream->packet_end_notif_queue; - lttng_live_stream->packet_end_notif_queue = NULL; - status = BT_NOTIF_ITER_STATUS_OK; + if (lttng_live_stream->packet_end_msg_queue) { + *message = lttng_live_stream->packet_end_msg_queue; + lttng_live_stream->packet_end_msg_queue = NULL; + status = BT_MSG_ITER_STATUS_OK; } else { - status = bt_notif_iter_get_next_notification( - lttng_live_stream->notif_iter, + status = bt_msg_iter_get_next_message( + lttng_live_stream->msg_iter, lttng_live_stream->trace->cc_prio_map, - notification); - if (status == BT_NOTIF_ITER_STATUS_OK) { + message); + if (status == BT_MSG_ITER_STATUS_OK) { /* * Consider empty packets as inactivity. */ - if (bt_notification_get_type(*notification) == BT_NOTIFICATION_TYPE_PACKET_END) { - lttng_live_stream->packet_end_notif_queue = *notification; - *notification = NULL; - return emit_inactivity_notification(lttng_live, - lttng_live_stream, notification, + if (bt_message_get_type(*message) == BT_MESSAGE_TYPE_PACKET_END) { + lttng_live_stream->packet_end_msg_queue = *message; + *message = NULL; + return emit_inactivity_message(lttng_live, + lttng_live_stream, message, lttng_live_stream->current_packet_end_timestamp); } } } switch (status) { - case BT_NOTIF_ITER_STATUS_EOF: + case BT_MSG_ITER_STATUS_EOF: ret = BT_LTTNG_LIVE_ITERATOR_STATUS_END; break; - case BT_NOTIF_ITER_STATUS_OK: + case BT_MSG_ITER_STATUS_OK: ret = BT_LTTNG_LIVE_ITERATOR_STATUS_OK; break; - case BT_NOTIF_ITER_STATUS_AGAIN: + case BT_MSG_ITER_STATUS_AGAIN: /* * Continue immediately (end of packet). The next * get_index may return AGAIN to delay the following @@ -696,9 +696,9 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_da */ ret = BT_LTTNG_LIVE_ITERATOR_STATUS_CONTINUE; break; - case BT_NOTIF_ITER_STATUS_INVAL: + case BT_MSG_ITER_STATUS_INVAL: /* No argument provided by the user, so don't return INVAL. */ - case BT_NOTIF_ITER_STATUS_ERROR: + case BT_MSG_ITER_STATUS_ERROR: default: ret = BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; break; @@ -741,7 +741,7 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_da * handle_active_data_streams() * - if at least one stream is ACTIVE_DATA: * - get stream event with lowest timestamp from heap - * - make that stream event the current notification. + * - make that stream event the current message. * - move this stream heap position to its next event * - if we need to fetch data from relayd, move * stream to ACTIVE_NO_DATA. @@ -755,18 +755,18 @@ enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_da * When disconnected from relayd: try to re-connect endlessly. */ static -struct bt_notification_iterator_next_method_return lttng_live_iterator_next_stream( - struct bt_private_connection_private_notification_iterator *iterator, +bt_message_iterator_next_method_return lttng_live_iterator_next_stream( + bt_self_message_iterator *iterator, struct lttng_live_stream_iterator *stream_iter) { - enum bt_lttng_live_iterator_status status; - struct bt_notification_iterator_next_method_return next_return; + bt_lttng_live_iterator_status status; + bt_message_iterator_next_method_return next_return; struct lttng_live_component *lttng_live; lttng_live = stream_iter->trace->session->lttng_live; retry: print_stream_state(stream_iter); - next_return.notification = NULL; + next_return.message = NULL; status = lttng_live_iterator_next_handle_new_streams_and_metadata(lttng_live); if (status != BT_LTTNG_LIVE_ITERATOR_STATUS_OK) { goto end; @@ -777,18 +777,18 @@ retry: goto end; } status = lttng_live_iterator_next_handle_one_quiescent_stream( - lttng_live, stream_iter, &next_return.notification); + lttng_live, stream_iter, &next_return.message); if (status != BT_LTTNG_LIVE_ITERATOR_STATUS_OK) { - BT_ASSERT(next_return.notification == NULL); + BT_ASSERT(next_return.message == NULL); goto end; } - if (next_return.notification) { + if (next_return.message) { goto end; } status = lttng_live_iterator_next_handle_one_active_data_stream(lttng_live, - stream_iter, &next_return.notification); + stream_iter, &next_return.message); if (status != BT_LTTNG_LIVE_ITERATOR_STATUS_OK) { - BT_ASSERT(next_return.notification == NULL); + BT_ASSERT(next_return.message == NULL); } end: @@ -797,47 +797,47 @@ end: print_dbg("continue"); goto retry; case BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_AGAIN; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_AGAIN; print_dbg("again"); break; case BT_LTTNG_LIVE_ITERATOR_STATUS_END: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_END; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_END; print_dbg("end"); break; case BT_LTTNG_LIVE_ITERATOR_STATUS_OK: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_OK; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_OK; print_dbg("ok"); break; case BT_LTTNG_LIVE_ITERATOR_STATUS_INVAL: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_INVALID; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_INVALID; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_NOMEM: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_NOMEM; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_NOMEM; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_UNSUPPORTED: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_UNSUPPORTED; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR: default: /* fall-through */ - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_ERROR; break; } return next_return; } static -struct bt_notification_iterator_next_method_return lttng_live_iterator_next_no_stream( - struct bt_private_connection_private_notification_iterator *iterator, +bt_message_iterator_next_method_return lttng_live_iterator_next_no_stream( + bt_self_message_iterator *iterator, struct lttng_live_no_stream_iterator *no_stream_iter) { - enum bt_lttng_live_iterator_status status; - struct bt_notification_iterator_next_method_return next_return; + bt_lttng_live_iterator_status status; + bt_message_iterator_next_method_return next_return; struct lttng_live_component *lttng_live; lttng_live = no_stream_iter->lttng_live; retry: lttng_live_force_new_streams_and_metadata(lttng_live); - next_return.notification = NULL; + next_return.message = NULL; status = lttng_live_iterator_next_handle_new_streams_and_metadata(lttng_live); if (status != BT_LTTNG_LIVE_ITERATOR_STATUS_OK) { goto end; @@ -852,35 +852,35 @@ end: case BT_LTTNG_LIVE_ITERATOR_STATUS_CONTINUE: goto retry; case BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_AGAIN; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_AGAIN; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_END: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_END; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_END; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_INVAL: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_INVALID; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_INVALID; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_NOMEM: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_NOMEM; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_NOMEM; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_UNSUPPORTED: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_UNSUPPORTED; break; case BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR: default: /* fall-through */ - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_ERROR; break; } return next_return; } BT_HIDDEN -struct bt_notification_iterator_next_method_return lttng_live_iterator_next( - struct bt_private_connection_private_notification_iterator *iterator) +bt_message_iterator_next_method_return lttng_live_iterator_next( + bt_self_message_iterator *iterator) { struct lttng_live_stream_iterator_generic *s = - bt_private_connection_private_notification_iterator_get_user_data(iterator); - struct bt_notification_iterator_next_method_return next_return; + bt_self_message_iterator_get_user_data(iterator); + bt_message_iterator_next_method_return next_return; switch (s->type) { case LIVE_STREAM_TYPE_NO_STREAM: @@ -892,19 +892,19 @@ struct bt_notification_iterator_next_method_return lttng_live_iterator_next( container_of(s, struct lttng_live_stream_iterator, p)); break; default: - next_return.status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR; + next_return.status = BT_MESSAGE_ITERATOR_STATUS_ERROR; break; } return next_return; } BT_HIDDEN -enum bt_notification_iterator_status lttng_live_iterator_init( - struct bt_private_connection_private_notification_iterator *it, +bt_message_iterator_status lttng_live_iterator_init( + bt_self_message_iterator *it, struct bt_private_port *port) { - enum bt_notification_iterator_status ret = - BT_NOTIFICATION_ITERATOR_STATUS_OK; + bt_message_iterator_status ret = + BT_MESSAGE_ITERATOR_STATUS_OK; struct lttng_live_stream_iterator_generic *s; BT_ASSERT(it); @@ -916,7 +916,7 @@ enum bt_notification_iterator_status lttng_live_iterator_init( { struct lttng_live_no_stream_iterator *no_stream_iter = container_of(s, struct lttng_live_no_stream_iterator, p); - ret = bt_private_connection_private_notification_iterator_set_user_data(it, no_stream_iter); + ret = bt_self_message_iterator_set_user_data(it, no_stream_iter); if (ret) { goto error; } @@ -926,39 +926,39 @@ enum bt_notification_iterator_status lttng_live_iterator_init( { struct lttng_live_stream_iterator *stream_iter = container_of(s, struct lttng_live_stream_iterator, p); - ret = bt_private_connection_private_notification_iterator_set_user_data(it, stream_iter); + ret = bt_self_message_iterator_set_user_data(it, stream_iter); if (ret) { goto error; } break; } default: - ret = BT_NOTIFICATION_ITERATOR_STATUS_ERROR; + ret = BT_MESSAGE_ITERATOR_STATUS_ERROR; goto end; } end: return ret; error: - if (bt_private_connection_private_notification_iterator_set_user_data(it, NULL) - != BT_NOTIFICATION_ITERATOR_STATUS_OK) { + if (bt_self_message_iterator_set_user_data(it, NULL) + != BT_MESSAGE_ITERATOR_STATUS_OK) { BT_LOGE("Error setting private data to NULL"); } goto end; } static -struct bt_component_class_query_method_return lttng_live_query_list_sessions( - struct bt_component_class *comp_class, - struct bt_query_executor *query_exec, - struct bt_value *params) +bt_component_class_query_method_return lttng_live_query_list_sessions( + const bt_component_class *comp_class, + const bt_query_executor *query_exec, + bt_value *params) { - struct bt_component_class_query_method_return query_ret = { + bt_component_class_query_method_return query_ret = { .result = NULL, .status = BT_QUERY_STATUS_OK, }; - struct bt_value *url_value = NULL; + bt_value *url_value = NULL; const char *url; struct bt_live_viewer_connection *viewer_connection = NULL; @@ -999,17 +999,17 @@ end: if (viewer_connection) { bt_live_viewer_connection_destroy(viewer_connection); } - BT_OBJECT_PUT_REF_AND_RESET(url_value); + BT_VALUE_PUT_REF_AND_RESET(url_value); return query_ret; } BT_HIDDEN -struct bt_component_class_query_method_return lttng_live_query( - struct bt_component_class *comp_class, - struct bt_query_executor *query_exec, - const char *object, struct bt_value *params) +bt_component_class_query_method_return lttng_live_query( + const bt_component_class *comp_class, + const bt_query_executor *query_exec, + const char *object, bt_value *params) { - struct bt_component_class_query_method_return ret = { + bt_component_class_query_method_return ret = { .result = NULL, .status = BT_QUERY_STATUS_OK, }; @@ -1049,9 +1049,9 @@ void lttng_live_component_destroy_data(struct lttng_live_component *lttng_live) } BT_HIDDEN -void lttng_live_component_finalize(struct bt_private_component *component) +void lttng_live_component_finalize(bt_self_component *component) { - void *data = bt_private_component_get_user_data(component); + void *data = bt_self_component_get_user_data(component); if (!data) { return; @@ -1060,13 +1060,13 @@ void lttng_live_component_finalize(struct bt_private_component *component) } static -struct lttng_live_component *lttng_live_component_create(struct bt_value *params, - struct bt_private_component *private_component) +struct lttng_live_component *lttng_live_component_create(bt_value *params, + bt_self_component *private_component) { struct lttng_live_component *lttng_live; - struct bt_value *value = NULL; + bt_value *value = NULL; const char *url; - enum bt_value_status ret; + bt_value_status ret; lttng_live = g_new0(struct lttng_live_component, 1); if (!lttng_live) { @@ -1085,7 +1085,7 @@ struct lttng_live_component *lttng_live_component_create(struct bt_value *params if (!lttng_live->url) { goto error; } - BT_OBJECT_PUT_REF_AND_RESET(value); + BT_VALUE_PUT_REF_AND_RESET(value); lttng_live->viewer_connection = bt_live_viewer_connection_create(lttng_live->url->str, lttng_live); if (!lttng_live->viewer_connection) { @@ -1106,12 +1106,12 @@ end: } BT_HIDDEN -enum bt_component_status lttng_live_component_init( - struct bt_private_component *private_component, - struct bt_value *params, void *init_method_data) +bt_component_status lttng_live_component_init( + bt_self_component *private_component, + bt_value *params, void *init_method_data) { struct lttng_live_component *lttng_live; - enum bt_component_status ret = BT_COMPONENT_STATUS_OK; + bt_component_status ret = BT_COMPONENT_STATUS_OK; /* Passes ownership of iter ref to lttng_live_component_create. */ lttng_live = lttng_live_component_create(params, private_component); @@ -1128,7 +1128,7 @@ enum bt_component_status lttng_live_component_init( if (lttng_live_is_canceled(lttng_live)) { goto end; } - ret = bt_private_component_source_add_output_port( + ret = bt_self_component_source_add_output_port( lttng_live->private_component, "no-stream", lttng_live->no_stream_iter, <tng_live->no_stream_port); @@ -1138,7 +1138,7 @@ enum bt_component_status lttng_live_component_init( bt_object_put_ref(lttng_live->no_stream_port); /* weak */ lttng_live->no_stream_iter->port = lttng_live->no_stream_port; - ret = bt_private_component_set_user_data(private_component, lttng_live); + ret = bt_self_component_set_user_data(private_component, lttng_live); if (ret != BT_COMPONENT_STATUS_OK) { goto error; } @@ -1146,25 +1146,25 @@ enum bt_component_status lttng_live_component_init( end: return ret; error: - (void) bt_private_component_set_user_data(private_component, NULL); + (void) bt_self_component_set_user_data(private_component, NULL); lttng_live_component_destroy_data(lttng_live); return ret; } BT_HIDDEN -enum bt_component_status lttng_live_accept_port_connection( - struct bt_private_component *private_component, +bt_component_status lttng_live_accept_port_connection( + bt_self_component *private_component, struct bt_private_port *self_private_port, - struct bt_port *other_port) + const bt_port *other_port) { struct lttng_live_component *lttng_live = - bt_private_component_get_user_data(private_component); - struct bt_component *other_component; - enum bt_component_status status = BT_COMPONENT_STATUS_OK; - struct bt_port *self_port = bt_port_from_private(self_private_port); + bt_self_component_get_user_data(private_component); + bt_component *other_component; + bt_component_status status = BT_COMPONENT_STATUS_OK; + const bt_port *self_port = bt_port_from_private(self_private_port); other_component = bt_port_get_component(other_port); - bt_object_put_ref(other_component); /* weak */ + bt_component_put_ref(other_component); /* weak */ if (!lttng_live->downstream_component) { lttng_live->downstream_component = other_component; @@ -1184,6 +1184,6 @@ enum bt_component_status lttng_live_accept_port_connection( goto end; } end: - bt_object_put_ref(self_port); + bt_port_put_ref(self_port); return status; }