lib: create_packet_message(): use pool to determine beginning or end msg
[babeltrace.git] / lib / graph / message / event.c
index e79eb3de9d58702980780dd5e453bf626d528c8f..d8e2b8ce6fc0821fb6abdb14558ab0f6430a1cc8 100644 (file)
@@ -47,7 +47,7 @@ static inline bool event_class_has_trace(struct bt_event_class *event_class)
 {
        struct bt_stream_class *stream_class;
 
-       stream_class = bt_event_class_borrow_stream_class(event_class);
+       stream_class = bt_event_class_borrow_stream_class_inline(event_class);
        BT_ASSERT(stream_class);
        return bt_stream_class_borrow_trace_class(stream_class) != NULL;
 }
@@ -255,24 +255,35 @@ const struct bt_event *bt_message_event_borrow_event_const(
        return borrow_event((void *) message);
 }
 
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
 bt_message_event_borrow_default_clock_snapshot_const(
-               const struct bt_message *msg,
-               const struct bt_clock_snapshot **snapshot)
+               const struct bt_message *msg)
 {
        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(
+       stream_class = bt_event_class_borrow_stream_class_inline(
                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;
+       return event_msg->default_cs;
+}
+
+const bt_clock_class *
+bt_message_event_borrow_stream_class_default_clock_class_const(
+               const bt_message *msg)
+{
+       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);
+       stream_class = bt_event_class_borrow_stream_class_inline(
+               event_msg->event->class);
+       BT_ASSERT(stream_class);
+       return stream_class->default_clock_class;
 }
This page took 0.023743 seconds and 4 git commands to generate.