CTF IR -> Trace IR
[babeltrace.git] / include / babeltrace / graph / notification-internal.h
index 3cd905097907691cba25a26e75a9ecc10fcb8e7c..81f7d660a22482dbfb8968c5e7591926470bc685 100644 (file)
  * SOFTWARE.
  */
 
-#include <babeltrace/ref-internal.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
+#include <babeltrace/assert-internal.h>
 #include <babeltrace/graph/graph.h>
 #include <babeltrace/graph/notification.h>
-#include <babeltrace/ctf-ir/stream.h>
+#include <babeltrace/trace-ir/stream.h>
 #include <babeltrace/object-pool-internal.h>
 #include <babeltrace/types.h>
 
@@ -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)";
        }
This page took 0.024552 seconds and 4 git commands to generate.