lib: internal: graph.h: require logging and BT_ASSERT_{PRE,POST}()
[babeltrace.git] / src / lib / graph / message / event.c
index 00b428c203f9f52e268a4d60657e74d73d77675d..06370c0ba69cb502b8318e0debcb0f32ca98f28f 100644 (file)
  * SOFTWARE.
  */
 
-#define BT_LOG_TAG "MSG-EVENT"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/MSG-EVENT"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
+#include "lib/assert-post.h"
 #include "compat/compiler.h"
 #include "lib/object.h"
 #include <babeltrace2/trace-ir/event.h>
@@ -108,7 +109,7 @@ struct bt_message *create_event_message(
                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)) {
+       if (G_UNLIKELY(!event)) {
                BT_LIB_LOGE("Cannot create event from event class: "
                        "%![ec-]+E", event_class);
                goto error;
@@ -131,7 +132,7 @@ struct bt_message *create_event_message(
         */
        message = (void *) bt_message_create_from_pool(
                &msg_iter->graph->event_msg_pool, msg_iter->graph);
-       if (unlikely(!message)) {
+       if (G_UNLIKELY(!message)) {
                /* bt_message_create_from_pool() logs errors */
                goto error;
        }
@@ -210,7 +211,7 @@ void bt_message_event_recycle(struct bt_message *msg)
 
        BT_ASSERT(event_msg);
 
-       if (unlikely(!msg->graph)) {
+       if (G_UNLIKELY(!msg->graph)) {
                bt_message_event_destroy(msg);
                return;
        }
This page took 0.028847 seconds and 4 git commands to generate.