X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Flttng-live%2Flttng-live.cpp;h=35cbff95eb713d66a9f67be072d6472bee751b84;hb=e74015680521597497c3218160a9e80081932896;hp=8b4fbb416c1cb8ba6d963a368806ceea5d5872b4;hpb=5cb27175157f132f8204c7b9ad98f383a1023f66;p=babeltrace.git diff --git a/src/plugins/ctf/lttng-live/lttng-live.cpp b/src/plugins/ctf/lttng-live/lttng-live.cpp index 8b4fbb41..35cbff95 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.cpp +++ b/src/plugins/ctf/lttng-live/lttng-live.cpp @@ -8,28 +8,25 @@ * Babeltrace CTF LTTng-live Client Component */ +#include +#include +#include + +#include + #define BT_COMP_LOG_SELF_COMP self_comp #define BT_LOG_OUTPUT_LEVEL log_level #define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE" #include "logging/comp-logging.h" -#include -#include -#include - -#include - #include "common/assert.h" -#include -#include "compat/compiler.h" -#include #include "plugins/common/muxing/muxing.h" #include "plugins/common/param-validation/param-validation.h" #include "data-stream.hpp" -#include "metadata.hpp" #include "lttng-live.hpp" +#include "metadata.hpp" #define MAX_QUERY_SIZE (256 * 1024) #define URL_PARAM "url" @@ -108,7 +105,6 @@ void lttng_live_stream_iterator_set_state(struct lttng_live_stream_iterator *str live_stream_iter->current_inactivity_ts); \ } while (0); -BT_HIDDEN bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter) { bool ret; @@ -195,7 +191,6 @@ end: return trace; } -BT_HIDDEN struct lttng_live_trace * lttng_live_session_borrow_or_create_trace_by_id(struct lttng_live_session *session, uint64_t trace_id) @@ -214,7 +209,6 @@ end: return trace; } -BT_HIDDEN int lttng_live_add_session(struct lttng_live_msg_iter *lttng_live_msg_iter, uint64_t session_id, const char *hostname, const char *session_name) { @@ -321,7 +315,6 @@ end: return; } -BT_HIDDEN void lttng_live_msg_iter_finalize(bt_self_message_iterator *self_msg_iter) { struct lttng_live_msg_iter *lttng_live_msg_iter; @@ -724,11 +717,9 @@ end: return ret; } -static int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, - struct lttng_live_msg_iter *lttng_live_msg_iter, +static int live_get_msg_ts_ns(struct lttng_live_msg_iter *lttng_live_msg_iter, const bt_message *msg, int64_t last_msg_ts_ns, int64_t *ts_ns) { - const bt_clock_class *clock_class = NULL; const bt_clock_snapshot *clock_snapshot = NULL; int ret = 0; bt_logging_level log_level = lttng_live_msg_iter->log_level; @@ -743,37 +734,19 @@ static int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, switch (bt_message_get_type(msg)) { case BT_MESSAGE_TYPE_EVENT: - clock_class = bt_message_event_borrow_stream_class_default_clock_class_const(msg); - BT_ASSERT_DBG(clock_class); - clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const(msg); break; case BT_MESSAGE_TYPE_PACKET_BEGINNING: - clock_class = - bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(msg); - BT_ASSERT(clock_class); - clock_snapshot = bt_message_packet_beginning_borrow_default_clock_snapshot_const(msg); break; case BT_MESSAGE_TYPE_PACKET_END: - clock_class = bt_message_packet_end_borrow_stream_class_default_clock_class_const(msg); - BT_ASSERT(clock_class); - clock_snapshot = bt_message_packet_end_borrow_default_clock_snapshot_const(msg); break; case BT_MESSAGE_TYPE_DISCARDED_EVENTS: - clock_class = - bt_message_discarded_events_borrow_stream_class_default_clock_class_const(msg); - BT_ASSERT(clock_class); - clock_snapshot = bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(msg); break; case BT_MESSAGE_TYPE_DISCARDED_PACKETS: - clock_class = - bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(msg); - BT_ASSERT(clock_class); - clock_snapshot = bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(msg); break; @@ -787,9 +760,6 @@ static int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, goto end; } - clock_class = bt_clock_snapshot_borrow_clock_class_const(clock_snapshot); - BT_ASSERT_DBG(clock_class); - ret = bt_clock_snapshot_get_ns_from_origin(clock_snapshot, ts_ns); if (ret) { BT_COMP_LOGE_APPEND_CAUSE(self_comp, @@ -1139,7 +1109,7 @@ handle_late_message(struct lttng_live_msg_iter *lttng_live_msg_iter, * by this component. We CANNOT send it as is. * * The only expected scenario in which that could happen is the - * following, everything else is a bug in this component, relay deamon, + * following, everything else is a bug in this component, relay daemon, * or CTF parser. * * Expected scenario: The CTF message iterator emitted discarded @@ -1306,10 +1276,10 @@ next_stream_iterator_for_trace(struct lttng_live_msg_iter *lttng_live_msg_iter, /* * Get the timestamp in nanoseconds from origin of this - * messsage. + * message. */ - live_get_msg_ts_ns(stream_iter, lttng_live_msg_iter, msg, - lttng_live_msg_iter->last_msg_ts_ns, &curr_msg_ts_ns); + live_get_msg_ts_ns(lttng_live_msg_iter, msg, lttng_live_msg_iter->last_msg_ts_ns, + &curr_msg_ts_ns); /* * Check if the message of the current live stream @@ -1529,7 +1499,6 @@ static inline void put_messages(bt_message_array_const msgs, uint64_t count) } } -BT_HIDDEN bt_message_iterator_class_next_method_status lttng_live_msg_iter_next(bt_self_message_iterator *self_msg_it, bt_message_array_const msgs, uint64_t capacity, uint64_t *count) @@ -1715,7 +1684,7 @@ lttng_live_msg_iter_next(bt_self_message_iterator *self_msg_it, bt_message_array /* * Insert the next message to the message batch. This will set - * stream iterator current messsage to NULL so that next time + * stream iterator current message to NULL so that next time * we fetch the next message of that stream iterator */ BT_MESSAGE_MOVE_REF(msgs[*count], youngest_stream_iter->current_msg); @@ -1735,7 +1704,7 @@ return_status: /* * If we gathered messages, return _OK even if the graph was * interrupted. This allows for the components downstream to at - * least get the thoses messages. If the graph was indeed + * least get the those messages. If the graph was indeed * interrupted there should not be another _next() call as the * application will tear down the graph. This component class * doesn't support restarting after an interruption. @@ -1806,11 +1775,9 @@ end: return lttng_live_msg_iter; } -BT_HIDDEN bt_message_iterator_class_initialize_method_status lttng_live_msg_iter_init(bt_self_message_iterator *self_msg_it, - bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_message_iterator_configuration *, bt_self_component_port_output *) { bt_message_iterator_class_initialize_method_status status; struct lttng_live_component *lttng_live; @@ -1986,7 +1953,7 @@ lttng_live_query_support_info(const bt_value *params, const bt_value **result, const bt_value *input_type_value; const bt_value *input_value; double weight = 0; - struct bt_common_lttng_live_url_parts parts = {0}; + struct bt_common_lttng_live_url_parts parts = {}; /* Used by the logging macros */ __attribute__((unused)) bt_self_component *self_comp = NULL; @@ -2050,7 +2017,6 @@ end: return status; } -BT_HIDDEN bt_component_class_query_method_status lttng_live_query(bt_self_component_class_source *comp_class, bt_private_query_executor *priv_query_exec, const char *object, const bt_value *params, @@ -2089,7 +2055,6 @@ static void lttng_live_component_destroy_data(struct lttng_live_component *lttng g_free(lttng_live); } -BT_HIDDEN void lttng_live_component_finalize(bt_self_component_source *component) { lttng_live_component *data = (lttng_live_component *) bt_self_component_get_data( @@ -2201,11 +2166,9 @@ end: return status; } -BT_HIDDEN bt_component_class_initialize_method_status lttng_live_component_init(bt_self_component_source *self_comp_src, - bt_self_component_source_configuration *config, const bt_value *params, - __attribute__((unused)) void *init_method_data) + bt_self_component_source_configuration *, const bt_value *params, void *) { struct lttng_live_component *lttng_live; bt_component_class_initialize_method_status ret;