lib: have default clock snapshot in event message
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 19 Feb 2019 14:14:55 +0000 (09:14 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
The event message is the only message not having a default clock
snapshot property (it's in an event object). Since an event object is
unique and belongs solely to an event message, make it more consistent
and move the default clock snapshot property to the message instead.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
14 files changed:
include/babeltrace/graph/message-event-const.h
include/babeltrace/graph/message-event-internal.h
include/babeltrace/graph/message-event.h
include/babeltrace/trace-ir/event-const.h
include/babeltrace/trace-ir/event-internal.h
include/babeltrace/trace-ir/event.h
lib/graph/iterator.c
lib/graph/message/event.c
lib/lib-logging.c
lib/trace-ir/event.c
plugins/ctf/common/msg-iter/msg-iter.c
plugins/text/dmesg/dmesg.c
plugins/text/pretty/print.c
plugins/utils/muxer/muxer.c

index 8d0d6fc1a50d993e8eaf1b261d271e3140d677bc..3de48c485f713ab9cd60f97af8cee76ec1c58718 100644 (file)
@@ -27,6 +27,9 @@
 /* For bt_message, bt_event */
 #include <babeltrace/types.h>
 
+/* For bt_clock_snapshot_state */
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -34,6 +37,10 @@ extern "C" {
 extern const bt_event *bt_message_event_borrow_event_const(
                const bt_message *message);
 
+extern bt_clock_snapshot_state
+bt_message_event_borrow_default_clock_snapshot_const(
+               const bt_message *msg, const bt_clock_snapshot **snapshot);
+
 #ifdef __cplusplus
 }
 #endif
index 5727df298757345415a24bc97fe62187255b9612..f0d827b94940f3835c9ab9aec9acd43ecb757858 100644 (file)
@@ -37,6 +37,7 @@ extern "C" {
 struct bt_message_event {
        struct bt_message parent;
        struct bt_event *event;
+       struct bt_clock_snapshot *default_cs;
 };
 
 BT_HIDDEN
index 733d91ad52b76501f1a87216a8009df0f3097830..942a1d84ca3f8c0928a1fd7215ca61fa7758a7bb 100644 (file)
@@ -24,6 +24,8 @@
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
 /*
  * For bt_self_message_iterator, bt_event, bt_packet,
  * bt_event_class, bt_message
@@ -40,6 +42,12 @@ bt_message *bt_message_event_create(
                const bt_event_class *event_class,
                const bt_packet *packet);
 
+extern
+bt_message *bt_message_event_create_with_default_clock_snapshot(
+               bt_self_message_iterator *message_iterator,
+               const bt_event_class *event_class,
+               const bt_packet *packet, uint64_t raw_clock_value);
+
 extern bt_event *bt_message_event_borrow_event(
                bt_message *message);
 
index 1199c40a71aa4ef2bb745261f6e7516d1ae90984..00dff658148d3969fd0101646663125eb98bca0d 100644 (file)
  * http://www.efficios.com/ctf
  */
 
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
-/* For bt_event, bt_clock_snapshot, bt_event_class, bt_field, bt_packet */
+/* For bt_event, bt_event_class, bt_field, bt_packet */
 #include <babeltrace/types.h>
 
 #ifdef __cplusplus
@@ -60,10 +57,6 @@ extern const bt_field *bt_event_borrow_specific_context_field_const(
 extern const bt_field *bt_event_borrow_payload_field_const(
                const bt_event *event);
 
-extern bt_clock_snapshot_state bt_event_borrow_default_clock_snapshot_const(
-               const bt_event *event,
-               const bt_clock_snapshot **clock_snapshot);
-
 #ifdef __cplusplus
 }
 #endif
index cfc30ee1b48fa46c3110f361e2587cff06425378..71356bc3816639e184f17279bb047ff2a5d6d670 100644 (file)
@@ -32,7 +32,6 @@
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/value.h>
-#include <babeltrace/trace-ir/clock-snapshot-internal.h>
 #include <babeltrace/trace-ir/stream-class.h>
 #include <babeltrace/trace-ir/stream.h>
 #include <babeltrace/trace-ir/stream-internal.h>
@@ -62,7 +61,6 @@ struct bt_event {
        struct bt_field *common_context_field;
        struct bt_field *specific_context_field;
        struct bt_field *payload_field;
-       struct bt_clock_snapshot *default_cs;
        bool frozen;
 };
 
@@ -119,11 +117,6 @@ void bt_event_reset(struct bt_event *event)
        BT_ASSERT(event);
        BT_LIB_LOGD("Resetting event: %!+e", event);
        bt_event_set_is_frozen(event, false);
-
-       if (event->default_cs) {
-               bt_clock_snapshot_reset(event->default_cs);
-       }
-
        bt_object_put_no_null_check(&event->packet->base);
        event->packet = NULL;
 }
index e394583babce5f2e66395c032d208e1c1ef107cd..e7c797ca51988b5a4ed159710fe28d44c55919d9 100644 (file)
@@ -51,9 +51,6 @@ bt_event_borrow_specific_context_field(bt_event *event);
 
 extern bt_field *bt_event_borrow_payload_field(bt_event *event);
 
-extern void bt_event_set_default_clock_snapshot(bt_event *event,
-               uint64_t value_cycles);
-
 #ifdef __cplusplus
 }
 #endif
index bc8faf85aa2b7f7320f198d8311cd493708f7c73..094447b6f1f1a28d359616916ce8fc949e8e4c37 100644 (file)
@@ -985,7 +985,7 @@ int get_message_ns_from_origin(const struct bt_message *msg,
                const struct bt_message_event *event_msg =
                        (const void *) msg;
 
-               clk_snapshot = event_msg->event->default_cs;
+               clk_snapshot = event_msg->default_cs;
                BT_ASSERT_PRE(clk_snapshot,
                        "Event has no default clock snapshot: %!+e",
                        event_msg->event);
index 2b4b4ba8d090fd59be141139bfb8766293be3f50..e79eb3de9d58702980780dd5e453bf626d528c8f 100644 (file)
@@ -33,6 +33,7 @@
 #include <babeltrace/trace-ir/event-class-internal.h>
 #include <babeltrace/trace-ir/stream-class-internal.h>
 #include <babeltrace/trace-ir/trace.h>
+#include <babeltrace/trace-ir/clock-snapshot-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/graph/message-event-const.h>
 #include <babeltrace/graph/message-event.h>
@@ -74,15 +75,18 @@ end:
        return (void *) message;
 }
 
-struct bt_message *bt_message_event_create(
+static inline
+struct bt_message *create_event_message(
                struct bt_self_message_iterator *self_msg_iter,
                const struct bt_event_class *c_event_class,
-               const struct bt_packet *c_packet)
+               const struct bt_packet *c_packet, bool with_cs,
+               uint64_t raw_value)
 {
        struct bt_self_component_port_input_message_iterator *msg_iter =
                (void *) self_msg_iter;
        struct bt_message_event *message = NULL;
        struct bt_event_class *event_class = (void *) c_event_class;
+       struct bt_stream_class *stream_class;
        struct bt_packet *packet = (void *) c_packet;
        struct bt_event *event;
 
@@ -91,8 +95,17 @@ struct bt_message *bt_message_event_create(
        BT_ASSERT_PRE_NON_NULL(packet, "Packet");
        BT_ASSERT_PRE(event_class_has_trace(event_class),
                "Event class is not part of a trace: %!+E", event_class);
-       BT_LIB_LOGD("Creating event message object: %![ec-]+E",
-               event_class);
+       stream_class = bt_event_class_borrow_stream_class_inline(event_class);
+       BT_ASSERT(stream_class);
+       BT_ASSERT_PRE((with_cs && stream_class->default_clock_class) ||
+               (!with_cs && !stream_class->default_clock_class),
+               "Creating an event message with a default clock snapshot, but without "
+               "a default clock class, or without a default clock snapshot, "
+               "but with a default clock class: ",
+               "%![ec-]+E, %![sc-]+S, with-cs=%d, "
+               "cs-val=%" PRIu64,
+               event_class, stream_class, with_cs, raw_value);
+       BT_LIB_LOGD("Creating event message object: %![ec-]+E", event_class);
        event = bt_event_create(event_class, packet);
        if (unlikely(!event)) {
                BT_LIB_LOGE("Cannot create event from event class: "
@@ -122,6 +135,17 @@ struct bt_message *bt_message_event_create(
                goto error;
        }
 
+       if (with_cs) {
+               BT_ASSERT(stream_class->default_clock_class);
+               message->default_cs = bt_clock_snapshot_create(
+                       stream_class->default_clock_class);
+               if (!message->default_cs) {
+                       goto error;
+               }
+
+               bt_clock_snapshot_set_raw_value(message->default_cs, raw_value);
+       }
+
        BT_ASSERT(!message->event);
        message->event = event;
        bt_packet_set_is_frozen(packet, true);
@@ -138,6 +162,24 @@ end:
        return (void *) message;
 }
 
+struct bt_message *bt_message_event_create(
+               struct bt_self_message_iterator *msg_iter,
+               const struct bt_event_class *event_class,
+               const struct bt_packet *packet)
+{
+       return create_event_message(msg_iter, event_class, packet, false, 0);
+}
+
+struct bt_message *bt_message_event_create_with_default_clock_snapshot(
+               struct bt_self_message_iterator *msg_iter,
+               const struct bt_event_class *event_class,
+               const struct bt_packet *packet,
+               uint64_t raw_value)
+{
+       return create_event_message(msg_iter, event_class, packet,
+               true, raw_value);
+}
+
 BT_HIDDEN
 void bt_message_event_destroy(struct bt_message *msg)
 {
@@ -151,6 +193,11 @@ void bt_message_event_destroy(struct bt_message *msg)
                event_msg->event = NULL;
        }
 
+       if (event_msg->default_cs) {
+               bt_clock_snapshot_recycle(event_msg->default_cs);
+               event_msg->default_cs = NULL;
+       }
+
        g_free(msg);
 }
 
@@ -173,6 +220,12 @@ void bt_message_event_recycle(struct bt_message *msg)
        BT_ASSERT(event_msg->event);
        bt_event_recycle(event_msg->event);
        event_msg->event = NULL;
+
+       if (event_msg->default_cs) {
+               bt_clock_snapshot_recycle(event_msg->default_cs);
+               event_msg->default_cs = NULL;
+       }
+
        graph = msg->graph;
        msg->graph = NULL;
        bt_object_pool_recycle_object(&graph->event_msg_pool, msg);
@@ -201,3 +254,25 @@ const struct bt_event *bt_message_event_borrow_event_const(
 {
        return borrow_event((void *) message);
 }
+
+enum bt_clock_snapshot_state
+bt_message_event_borrow_default_clock_snapshot_const(
+               const struct bt_message *msg,
+               const struct bt_clock_snapshot **snapshot)
+{
+       struct bt_message_event *event_msg = (void *) msg;
+       struct bt_stream_class *stream_class;
+
+       BT_ASSERT_PRE_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
+       BT_ASSERT(msg);
+       stream_class = bt_event_class_borrow_stream_class(
+               event_msg->event->class);
+       BT_ASSERT(stream_class);
+       BT_ASSERT_PRE(stream_class->default_clock_class,
+               "Message's stream's class has no default clock class: "
+               "%![msg-]+n, %![sc-]+S", msg, stream_class);
+       BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
+       *snapshot = event_msg->default_cs;
+       return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+}
index 0872cc26bbc9af334654026e83e292cf5e95c3c8..ecf217ff1bc119403fd313678a103f69ccc08004 100644 (file)
@@ -712,12 +712,6 @@ static inline void format_event(char **buf_ch, bool extended,
                }
        }
 
-       if (event->default_cs) {
-               SET_TMP_PREFIX("default-cs-");
-               format_clock_snapshot(buf_ch, true, tmp_prefix,
-                       event->default_cs);
-       }
-
        packet = bt_event_borrow_packet_const(event);
        if (!packet) {
                return;
index 1badd83a38b5708904470a6ddd1dc110aa05027a..ec2a7e243d73cd35a30677fa68b0904c571a8230 100644 (file)
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/trace-ir/field-internal.h>
 #include <babeltrace/trace-ir/field-class-internal.h>
-#include <babeltrace/trace-ir/clock-class.h>
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-#include <babeltrace/trace-ir/clock-snapshot-internal.h>
-#include <babeltrace/trace-ir/clock-class-internal.h>
 #include <babeltrace/trace-ir/event-const.h>
 #include <babeltrace/trace-ir/event-internal.h>
 #include <babeltrace/trace-ir/event-class.h>
@@ -123,15 +119,6 @@ struct bt_event *bt_event_new(struct bt_event_class *event_class)
                }
        }
 
-       if (stream_class->default_clock_class) {
-               event->default_cs = bt_clock_snapshot_create(
-                       stream_class->default_clock_class);
-               if (!event->default_cs) {
-                       /* bt_clock_snapshot_create() logs errors */
-                       goto error;
-               }
-       }
-
        goto end;
 
 error:
@@ -233,45 +220,11 @@ void bt_event_destroy(struct bt_event *event)
 
        BT_LOGD_STR("Putting event's class.");
        bt_object_put_ref(event->class);
-
-       if (event->default_cs) {
-               bt_clock_snapshot_recycle(event->default_cs);
-               event->default_cs = NULL;
-       }
-
        BT_LOGD_STR("Putting event's packet.");
        BT_OBJECT_PUT_REF_AND_RESET(event->packet);
        g_free(event);
 }
 
-void bt_event_set_default_clock_snapshot(struct bt_event *event,
-               uint64_t value_cycles)
-{
-       struct bt_stream_class *sc;
-
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
-       BT_ASSERT_PRE_EVENT_HOT(event);
-       sc = bt_event_class_borrow_stream_class_inline(event->class);
-       BT_ASSERT(sc);
-       BT_ASSERT_PRE(sc->default_clock_class,
-               "Event's stream class has no default clock class: "
-               "%![ev-]+e, %![sc-]+S", event, sc);
-       BT_ASSERT(event->default_cs);
-       bt_clock_snapshot_set_raw_value(event->default_cs, value_cycles);
-       BT_LIB_LOGV("Set event's default clock snapshot: %![event-]+e, "
-               "value=%" PRIu64, event, value_cycles);
-}
-
-enum bt_clock_snapshot_state bt_event_borrow_default_clock_snapshot_const(
-               const struct bt_event *event,
-               const struct bt_clock_snapshot **clock_snapshot)
-{
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
-       BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot (output)");
-       *clock_snapshot = event->default_cs;
-       return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
-}
-
 struct bt_packet *bt_event_borrow_packet(struct bt_event *event)
 {
        BT_ASSERT_PRE_NON_NULL(event, "Event");
index 3800d07a3f2cb051b9785d44e98a23a77900f993..d7cb7f37a88d47dbddfad3a1326617eba0769467 100644 (file)
@@ -1183,8 +1183,17 @@ enum bt_msg_iter_status set_current_event_message(
                notit->meta.ec->name->str,
                notit->packet);
        BT_ASSERT(notit->msg_iter);
-       msg = bt_message_event_create(notit->msg_iter,
-               notit->meta.ec->ir_ec, notit->packet);
+       BT_ASSERT(notit->meta.sc);
+
+       if (bt_stream_class_borrow_default_clock_class(notit->meta.sc->ir_sc)) {
+               msg = bt_message_event_create_with_default_clock_snapshot(
+                       notit->msg_iter, notit->meta.ec->ir_ec,
+                       notit->packet, notit->default_clock_snapshot);
+       } else {
+               msg = bt_message_event_create(notit->msg_iter,
+                       notit->meta.ec->ir_ec, notit->packet);
+       }
+
        if (!msg) {
                BT_LOGE("Cannot create event message: "
                        "notit-addr=%p, ec-addr=%p, ec-name=\"%s\", "
@@ -2369,20 +2378,6 @@ end:
        return ret_fc;
 }
 
-static
-void set_event_default_clock_snapshot(struct bt_msg_iter *notit)
-{
-       bt_event *event = bt_message_event_borrow_event(notit->event_msg);
-       bt_stream_class *sc = notit->meta.sc->ir_sc;
-
-       BT_ASSERT(event);
-
-       if (bt_stream_class_borrow_default_clock_class(sc)) {
-               bt_event_set_default_clock_snapshot(event,
-                       notit->default_clock_snapshot);
-       }
-}
-
 static
 void create_msg_stream_beginning(struct bt_msg_iter *notit,
                bt_message **message)
@@ -2778,7 +2773,6 @@ enum bt_msg_iter_status bt_msg_iter_get_next_message(
                switch (notit->state) {
                case STATE_EMIT_MSG_EVENT:
                        BT_ASSERT(notit->event_msg);
-                       set_event_default_clock_snapshot(notit);
                        *message = notit->event_msg;
                        notit->event_msg = NULL;
                        goto end;
index d73d2abe69c537b4896453887f9b468d1a12c187..aac38c23e3fa294a17f08d001a91f115c57ed806 100644 (file)
@@ -516,8 +516,16 @@ skip_ts:
                goto error;
        }
 
-       msg = bt_message_event_create(msg_iter->pc_msg_iter,
-               dmesg_comp->event_class, dmesg_comp->packet);
+       if (dmesg_comp->clock_class) {
+               msg = bt_message_event_create_with_default_clock_snapshot(
+                       msg_iter->pc_msg_iter,
+                       dmesg_comp->event_class, dmesg_comp->packet, ts);
+               msg_iter->last_clock_value = ts;
+       } else {
+               msg = bt_message_event_create(msg_iter->pc_msg_iter,
+                       dmesg_comp->event_class, dmesg_comp->packet);
+       }
+
        if (!msg) {
                BT_LOGE_STR("Cannot create event message.");
                goto error;
@@ -525,12 +533,6 @@ skip_ts:
 
        event = bt_message_event_borrow_event(msg);
        BT_ASSERT(event);
-
-       if (dmesg_comp->clock_class) {
-               bt_event_set_default_clock_snapshot(event, ts);
-               msg_iter->last_clock_value = ts;
-       }
-
        goto end;
 
 error:
index b3afd57387cbb566d08462ed0dea001ae5d0285f..be9b13e9b5a4bffbe87e31f5cd0e68041635e991 100644 (file)
@@ -78,17 +78,9 @@ void print_field_name_equal(struct pretty_component *pretty, const char *name)
 
 static
 void print_timestamp_cycles(struct pretty_component *pretty,
-               const bt_event *event)
+               const bt_clock_snapshot *clock_snapshot)
 {
-       const bt_clock_snapshot *clock_snapshot;
        uint64_t cycles;
-       bt_clock_snapshot_state cs_state;
-
-       cs_state = bt_event_borrow_default_clock_snapshot_const(event, &clock_snapshot);
-       if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN || !clock_snapshot) {
-               g_string_append(pretty->string, "????????????????????");
-               return;
-       }
 
        cycles = bt_clock_snapshot_get_value(clock_snapshot);
        g_string_append_printf(pretty->string, "%020" PRIu64, cycles);
@@ -96,6 +88,7 @@ void print_timestamp_cycles(struct pretty_component *pretty,
        if (pretty->last_cycles_timestamp != -1ULL) {
                pretty->delta_cycles = cycles - pretty->last_cycles_timestamp;
        }
+
        pretty->last_cycles_timestamp = cycles;
 }
 
@@ -216,30 +209,25 @@ end:
 
 static
 int print_event_timestamp(struct pretty_component *pretty,
-               const bt_event *event, bool *start_line)
+               const bt_message *event_msg, bool *start_line)
 {
        bool print_names = pretty->options.print_header_field_names;
        int ret = 0;
        const bt_stream *stream = NULL;
        const bt_stream_class *stream_class = NULL;
        const bt_clock_snapshot *clock_snapshot = NULL;
-       bt_clock_snapshot_state cs_state;
+       const bt_event *event = bt_message_event_borrow_event_const(event_msg);
 
        stream = bt_event_borrow_stream_const(event);
-       if (!stream) {
-               ret = -1;
-               goto end;
-       }
-
        stream_class = bt_stream_borrow_class_const(stream);
-       if (!stream_class) {
-               ret = -1;
+
+       if (!bt_stream_class_borrow_default_clock_class_const(stream_class)) {
+               /* No default clock class: skip the timestamp without an error */
                goto end;
        }
 
-       cs_state = bt_event_borrow_default_clock_snapshot_const(event,
-               &clock_snapshot);
-       if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN || !clock_snapshot) {
+       if (bt_message_event_borrow_default_clock_snapshot_const(event_msg,
+                       &clock_snapshot) != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
                /* No default clock value: skip the timestamp without an error */
                goto end;
        }
@@ -253,11 +241,8 @@ int print_event_timestamp(struct pretty_component *pretty,
                g_string_append(pretty->string, COLOR_TIMESTAMP);
        }
        if (pretty->options.print_timestamp_cycles) {
-               print_timestamp_cycles(pretty, event);
+               print_timestamp_cycles(pretty, clock_snapshot);
        } else {
-               clock_snapshot = NULL;
-               cs_state = bt_event_borrow_default_clock_snapshot_const(event,
-                       &clock_snapshot);
                print_timestamp_wall(pretty, clock_snapshot);
        }
        if (pretty->use_colors) {
@@ -308,7 +293,7 @@ end:
 
 static
 int print_event_header(struct pretty_component *pretty,
-               const bt_event *event)
+               const bt_message *event_msg)
 {
        bool print_names = pretty->options.print_header_field_names;
        int ret = 0;
@@ -318,6 +303,7 @@ int print_event_header(struct pretty_component *pretty,
        const bt_packet *packet = NULL;
        const bt_stream *stream = NULL;
        const bt_trace *trace = NULL;
+       const bt_event *event = bt_message_event_borrow_event_const(event_msg);
        int dom_print = 0;
        bt_property_availability prop_avail;
 
@@ -327,7 +313,7 @@ int print_event_header(struct pretty_component *pretty,
        packet = bt_event_borrow_packet_const(event);
        stream = bt_packet_borrow_stream_const(packet);
        trace = bt_stream_borrow_trace_const(stream);
-       ret = print_event_timestamp(pretty, event, &pretty->start_line);
+       ret = print_event_timestamp(pretty, event_msg, &pretty->start_line);
        if (ret) {
                goto end;
        }
@@ -1180,7 +1166,7 @@ int pretty_print_event(struct pretty_component *pretty,
        BT_ASSERT(event);
        pretty->start_line = true;
        g_string_assign(pretty->string, "");
-       ret = print_event_header(pretty, event);
+       ret = print_event_header(pretty, event_msg);
        if (ret != 0) {
                goto end;
        }
index 032fef41be05dac7bbe47874a839007fc28894e4..700789520fee6d2ea2df02a5da90a708a3106aa9 100644 (file)
@@ -610,7 +610,6 @@ int get_msg_ts_ns(struct muxer_comp *muxer_comp,
 {
        const bt_clock_class *clock_class = NULL;
        const bt_clock_snapshot *clock_snapshot = NULL;
-       const bt_event *event = NULL;
        int ret = 0;
        const unsigned char *cc_uuid;
        const char *cc_name;
@@ -626,10 +625,8 @@ int get_msg_ts_ns(struct muxer_comp *muxer_comp,
 
        switch (bt_message_get_type(msg)) {
        case BT_MESSAGE_TYPE_EVENT:
-               event = bt_message_event_borrow_event_const(msg);
-               BT_ASSERT(event);
-               cs_state = bt_event_borrow_default_clock_snapshot_const(event,
-                       &clock_snapshot);
+               cs_state = bt_message_event_borrow_default_clock_snapshot_const(
+                       msg, &clock_snapshot);
                break;
 
        case BT_MESSAGE_TYPE_INACTIVITY:
This page took 0.04557 seconds and 4 git commands to generate.