#define BT_LOG_TAG "LIB/MSG-PACKET"
#include "lib/logging.h"
+#include "lib/assert-pre.h"
+#include "lib/assert-post.h"
#include "compat/compiler.h"
#include <babeltrace2/trace-ir/packet.h>
#include "lib/trace-ir/packet.h"
#include <babeltrace2/graph/message-packet-beginning.h>
#include <babeltrace2/graph/message-packet-end.h>
#include "common/assert.h"
-#include "lib/assert-pre.h"
#include "lib/object.h"
#include <inttypes.h>
message = g_new0(struct bt_message_packet, 1);
if (!message) {
- BT_LOGE_STR("Failed to allocate one packet message.");
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Failed to allocate one packet message.");
goto error;
}
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
+ /*
+ * It's not possible to create a packet from a stream of which
+ * the class indicates that packets are not supported.
+ */
+ BT_ASSERT(stream_class->supports_packets);
+
if (pool == &msg_iter->graph->packet_begin_msg_pool) {
need_cs = stream_class->packets_have_beginning_default_clock_snapshot;
} else {