X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fnotification-internal.h;h=81f7d660a22482dbfb8968c5e7591926470bc685;hb=108b91d0ffd01cce874850b767c0f358eb642523;hp=3cd905097907691cba25a26e75a9ecc10fcb8e7c;hpb=f7c3ac094e2acbce27394a6165956bcb41ee7d1b;p=babeltrace.git diff --git a/include/babeltrace/graph/notification-internal.h b/include/babeltrace/graph/notification-internal.h index 3cd90509..81f7d660 100644 --- a/include/babeltrace/graph/notification-internal.h +++ b/include/babeltrace/graph/notification-internal.h @@ -27,12 +27,12 @@ * SOFTWARE. */ -#include #include #include +#include #include #include -#include +#include #include #include @@ -78,7 +78,7 @@ struct bt_notification *bt_notification_create_from_pool( { struct bt_notification *notif = bt_object_pool_create_object(pool); - if (!notif) { + if (unlikely(!notif)) { #ifdef BT_LIB_LOGE BT_LIB_LOGE("Cannot allocate one notification from notification pool: " "%![pool-]+o, %![graph-]+g", pool, graph); @@ -86,14 +86,14 @@ struct bt_notification *bt_notification_create_from_pool( goto error; } - if (!notif->graph) { + if (likely(!notif->graph)) { notif->graph = graph; } goto end; error: - BT_PUT(notif); + BT_ASSERT(!notif); end: return notif; @@ -131,10 +131,6 @@ const char *bt_notification_type_string(enum bt_notification_type type) return "BT_NOTIFICATION_TYPE_PACKET_BEGIN"; case BT_NOTIFICATION_TYPE_PACKET_END: return "BT_NOTIFICATION_TYPE_PACKET_END"; - case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS: - return "BT_NOTIFICATION_TYPE_DISCARDED_EVENTS"; - case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS: - return "BT_NOTIFICATION_TYPE_DISCARDED_PACKETS"; default: return "(unknown)"; }