+ goto end;
+ }
+
+handle_state:
+ BT_ASSERT(dmesg_comp->trace);
+
+ switch (dmesg_notif_iter->state) {
+ case STATE_EMIT_STREAM_BEGINNING:
+ BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
+ *notif = bt_notification_stream_begin_create(
+ dmesg_comp->graph, dmesg_comp->stream);
+ dmesg_notif_iter->state = STATE_EMIT_PACKET_BEGINNING;
+ break;
+ case STATE_EMIT_PACKET_BEGINNING:
+ BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
+ *notif = bt_notification_packet_begin_create(
+ dmesg_comp->graph, dmesg_comp->packet);
+ dmesg_notif_iter->state = STATE_EMIT_EVENT;
+ break;
+ case STATE_EMIT_EVENT:
+ BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
+ *notif = dmesg_notif_iter->tmp_event_notif;
+ dmesg_notif_iter->tmp_event_notif = NULL;
+ break;
+ case STATE_EMIT_PACKET_END:
+ *notif = bt_notification_packet_end_create(
+ dmesg_comp->graph, dmesg_comp->packet);
+ dmesg_notif_iter->state = STATE_EMIT_STREAM_END;
+ break;
+ case STATE_EMIT_STREAM_END:
+ *notif = bt_notification_stream_end_create(
+ dmesg_comp->graph, dmesg_comp->stream);
+ dmesg_notif_iter->state = STATE_DONE;
+ break;
+ default:
+ break;
+ }
+
+ if (!*notif) {
+ BT_LOGE("Cannot create notification: dmesg-comp-addr=%p",
+ dmesg_comp);
+ status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR;