X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fmessage%2Fmessage.h;h=a1e529974594aeb14a9e4308c2c783602318acdb;hb=188edac1113dbbb29030681dbde2de0ada742499;hp=98437707737ce86114254a09003b6b2b82891378;hpb=578e048b5debf169e286e5b5cc747b5d6c16886d;p=babeltrace.git diff --git a/src/lib/graph/message/message.h b/src/lib/graph/message/message.h index 98437707..a1e52997 100644 --- a/src/lib/graph/message/message.h +++ b/src/lib/graph/message/message.h @@ -24,7 +24,12 @@ * SOFTWARE. */ -#include "common/babeltrace.h" +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BT_LIB_LOG_SUPPORTED +# error Please include "lib/logging.h" before including this file. +#endif + +#include "common/macros.h" #include "lib/object.h" #include "common/assert.h" #include @@ -33,6 +38,11 @@ #include "lib/object-pool.h" #include +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BT_LIB_LOG_SUPPORTED +# error Please include "lib/logging.h" before including this file. +#endif + typedef struct bt_stream *(*get_stream_func)( struct bt_message *message); @@ -73,15 +83,14 @@ struct bt_message *bt_message_create_from_pool( { struct bt_message *msg = bt_object_pool_create_object(pool); - if (unlikely(!msg)) { -#ifdef BT_LIB_LOGE - BT_LIB_LOGE("Cannot allocate one message from message pool: " + if (G_UNLIKELY(!msg)) { + BT_LIB_LOGE_APPEND_CAUSE( + "Cannot allocate one message from message pool: " "%![pool-]+o, %![graph-]+g", pool, graph); -#endif goto error; } - if (likely(!msg->graph)) { + if (G_LIKELY(!msg->graph)) { msg->graph = graph; } @@ -124,10 +133,6 @@ const char *bt_message_type_string(enum bt_message_type type) return "BT_MESSAGE_TYPE_PACKET_BEGINNING"; case BT_MESSAGE_TYPE_PACKET_END: return "BT_MESSAGE_TYPE_PACKET_END"; - case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING: - return "BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING"; - case BT_MESSAGE_TYPE_STREAM_ACTIVITY_END: - return "BT_MESSAGE_TYPE_STREAM_ACTIVITY_END"; case BT_MESSAGE_TYPE_DISCARDED_EVENTS: return "BT_MESSAGE_TYPE_DISCARDED_EVENTS"; default: