X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fmessage%2Fevent.c;h=0f7a8a0a561ffc05d2016bf50fa81e9015656ab5;hb=43c59509042845f8d42c3e99ec74d45fa2dc0908;hp=54254e77fb27e133b66e0922aa5ab44265d5280f;hpb=bdb288b3e94e412a33c8647d44f6cfac66ca0665;p=babeltrace.git diff --git a/src/lib/graph/message/event.c b/src/lib/graph/message/event.c index 54254e77..0f7a8a0a 100644 --- a/src/lib/graph/message/event.c +++ b/src/lib/graph/message/event.c @@ -36,22 +36,20 @@ #include #include "lib/trace-ir/clock-snapshot.h" #include "lib/graph/graph.h" -#include -#include +#include #include #include #include #include "event.h" -BT_ASSERT_PRE_FUNC 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_inline(event_class); - BT_ASSERT(stream_class); - return bt_stream_class_borrow_trace_class(stream_class) != NULL; + BT_ASSERT_DBG(stream_class); + return bt_stream_class_borrow_trace_class(stream_class); } BT_HIDDEN @@ -86,7 +84,7 @@ struct bt_message *create_event_message( const struct bt_stream *c_stream, bool with_cs, uint64_t raw_value) { - struct bt_self_component_port_input_message_iterator *msg_iter = + struct bt_message_iterator *msg_iter = (void *) self_msg_iter; struct bt_message_event *message = NULL; struct bt_event_class *event_class = (void *) c_event_class; @@ -95,13 +93,13 @@ struct bt_message *create_event_message( struct bt_stream *stream = (void *) c_stream; struct bt_event *event; - BT_ASSERT(stream); + BT_ASSERT_DBG(stream); BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); BT_ASSERT_PRE_NON_NULL(event_class, "Event class"); BT_ASSERT_PRE(event_class_has_trace(event_class), "Event class is not part of a trace: %!+E", event_class); stream_class = bt_event_class_borrow_stream_class_inline(event_class); - BT_ASSERT(stream_class); + BT_ASSERT_DBG(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 " @@ -142,7 +140,7 @@ struct bt_message *create_event_message( } if (with_cs) { - BT_ASSERT(stream_class->default_clock_class); + BT_ASSERT_DBG(stream_class->default_clock_class); message->default_cs = bt_clock_snapshot_create( stream_class->default_clock_class); if (!message->default_cs) { @@ -152,7 +150,7 @@ struct bt_message *create_event_message( bt_clock_snapshot_set_raw_value(message->default_cs, raw_value); } - BT_ASSERT(!message->event); + BT_ASSERT_DBG(!message->event); message->event = event; if (packet) { @@ -178,6 +176,7 @@ struct bt_message *bt_message_event_create( const struct bt_event_class *event_class, const struct bt_stream *stream) { + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(stream, "Stream"); return create_event_message(msg_iter, event_class, NULL, stream, false, 0); } @@ -187,6 +186,7 @@ struct bt_message *bt_message_event_create_with_packet( const struct bt_event_class *event_class, const struct bt_packet *packet) { + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(packet, "Packet"); return create_event_message(msg_iter, event_class, packet, packet->stream, false, 0); @@ -198,6 +198,7 @@ struct bt_message *bt_message_event_create_with_default_clock_snapshot( const struct bt_stream *stream, uint64_t raw_value) { + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(stream, "Stream"); return create_event_message(msg_iter, event_class, NULL, stream, true, raw_value); @@ -210,6 +211,7 @@ bt_message_event_create_with_packet_and_default_clock_snapshot( const struct bt_packet *packet, uint64_t raw_value) { + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(packet, "Packet"); return create_event_message(msg_iter, event_class, packet, packet->stream, true, raw_value); @@ -242,7 +244,7 @@ void bt_message_event_recycle(struct bt_message *msg) struct bt_message_event *event_msg = (void *) msg; struct bt_graph *graph; - BT_ASSERT(event_msg); + BT_ASSERT_DBG(event_msg); if (G_UNLIKELY(!msg->graph)) { bt_message_event_destroy(msg); @@ -252,7 +254,7 @@ void bt_message_event_recycle(struct bt_message *msg) BT_LIB_LOGD("Recycling event message: %![msg-]+n, %![event-]+e", msg, event_msg->event); bt_message_reset(msg); - BT_ASSERT(event_msg->event); + BT_ASSERT_DBG(event_msg->event); bt_event_recycle(event_msg->event); event_msg->event = NULL; @@ -301,7 +303,7 @@ bt_message_event_borrow_default_clock_snapshot_const( BT_ASSERT_PRE_DEV_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); + BT_ASSERT_DBG(stream_class); BT_ASSERT_PRE_DEV(stream_class->default_clock_class, "Message's stream's class has no default clock class: " "%![msg-]+n, %![sc-]+S", msg, stream_class); @@ -319,6 +321,6 @@ bt_message_event_borrow_stream_class_default_clock_class_const( BT_ASSERT_PRE_DEV_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); + BT_ASSERT_DBG(stream_class); return stream_class->default_clock_class; }