X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Flttng-live%2Flttng-live.c;h=24544a307ace6d2fcb273ef557480020a7a342c2;hb=c8bc855f3c47d85dfe071d94e6f614d668cbb711;hp=d7c1b458336b0bf33d14f917e434668c006ff0c7;hpb=059e394034f95701ecf2fe7fe43911bdf038bf97;p=babeltrace.git diff --git a/plugins/ctf/lttng-live/lttng-live.c b/plugins/ctf/lttng-live/lttng-live.c index d7c1b458..24544a30 100644 --- a/plugins/ctf/lttng-live/lttng-live.c +++ b/plugins/ctf/lttng-live/lttng-live.c @@ -35,10 +35,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "data-stream.h" @@ -615,7 +615,6 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, const bt_clock_class *clock_class = NULL; const bt_clock_snapshot *clock_snapshot = NULL; int ret = 0; - bt_clock_snapshot_state cs_state = BT_CLOCK_SNAPSHOT_STATE_KNOWN; bt_message_stream_activity_clock_snapshot_state sa_cs_state; BT_ASSERT(msg); @@ -632,8 +631,8 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, msg); BT_ASSERT(clock_class); - cs_state = bt_message_event_borrow_default_clock_snapshot_const( - msg, &clock_snapshot); + clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const( + msg); break; case BT_MESSAGE_TYPE_PACKET_BEGINNING: clock_class = @@ -641,8 +640,8 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, msg); BT_ASSERT(clock_class); - cs_state = bt_message_packet_beginning_borrow_default_clock_snapshot_const( - msg, &clock_snapshot); + clock_snapshot = bt_message_packet_beginning_borrow_default_clock_snapshot_const( + msg); break; case BT_MESSAGE_TYPE_PACKET_END: clock_class = @@ -650,8 +649,8 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, msg); BT_ASSERT(clock_class); - cs_state = bt_message_packet_end_borrow_default_clock_snapshot_const( - msg, &clock_snapshot); + clock_snapshot = bt_message_packet_end_borrow_default_clock_snapshot_const( + msg); break; case BT_MESSAGE_TYPE_DISCARDED_EVENTS: clock_class = @@ -659,8 +658,8 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, msg); BT_ASSERT(clock_class); - cs_state = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const( - msg, &clock_snapshot); + clock_snapshot = bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const( + msg); break; case BT_MESSAGE_TYPE_DISCARDED_PACKETS: clock_class = @@ -668,8 +667,8 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, msg); BT_ASSERT(clock_class); - cs_state = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const( - msg, &clock_snapshot); + clock_snapshot = bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const( + msg); break; case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING: clock_class = @@ -698,9 +697,9 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, break; case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: - cs_state = + clock_snapshot = bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( - msg, &clock_snapshot); + msg); break; default: /* All the other messages have a higher priority */ @@ -709,12 +708,6 @@ int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, goto end; } - if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN) { - BT_LOGE_STR("Unsupported unknown clock snapshot."); - ret = -1; - goto end; - } - clock_class = bt_clock_snapshot_borrow_clock_class_const(clock_snapshot); BT_ASSERT(clock_class);