#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>
{
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);
goto error;
}
- if (!notif->graph) {
+ if (likely(!notif->graph)) {
notif->graph = graph;
}
goto end;
error:
- BT_PUT(notif);
+ BT_ASSERT(!notif);
end:
return notif;
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)";
}