#include <babeltrace/ctf-ir/event-class.h>
#include <babeltrace/ctf-ir/event.h>
#include <babeltrace/ctf-ir/field-types.h>
#include <babeltrace/ctf-ir/event-class.h>
#include <babeltrace/ctf-ir/event.h>
#include <babeltrace/ctf-ir/field-types.h>
src_event_class = bt_event_class_create("my-event-class");
ret = bt_event_class_set_context_field_type(src_event_class,
empty_struct_ft);
src_event_class = bt_event_class_create("my-event-class");
ret = bt_event_class_set_context_field_type(src_event_class,
empty_struct_ft);
ret = bt_private_connection_private_notification_iterator_set_user_data(
priv_notif_iter, user_data);
ret = bt_private_connection_private_notification_iterator_set_user_data(
priv_notif_iter, user_data);
next_return.notification =
bt_notification_inactivity_create(graph,
src_empty_cc_prio_map);
next_return.notification =
bt_notification_inactivity_create(graph,
src_empty_cc_prio_map);
break;
case SEQ_STREAM1_BEGIN:
next_return.notification =
bt_notification_stream_begin_create(graph, src_stream1);
break;
case SEQ_STREAM1_BEGIN:
next_return.notification =
bt_notification_stream_begin_create(graph, src_stream1);
break;
case SEQ_STREAM2_BEGIN:
next_return.notification =
bt_notification_stream_begin_create(graph, src_stream2);
break;
case SEQ_STREAM2_BEGIN:
next_return.notification =
bt_notification_stream_begin_create(graph, src_stream2);
break;
case SEQ_STREAM1_END:
next_return.notification =
bt_notification_stream_end_create(graph, src_stream1);
break;
case SEQ_STREAM1_END:
next_return.notification =
bt_notification_stream_end_create(graph, src_stream1);
break;
case SEQ_STREAM2_END:
next_return.notification =
bt_notification_stream_end_create(graph, src_stream2);
break;
case SEQ_STREAM2_END:
next_return.notification =
bt_notification_stream_end_create(graph, src_stream2);
break;
case SEQ_STREAM1_PACKET1_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream1_packet1);
break;
case SEQ_STREAM1_PACKET1_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream1_packet1);
break;
case SEQ_STREAM1_PACKET2_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream1_packet2);
break;
case SEQ_STREAM1_PACKET2_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream1_packet2);
break;
case SEQ_STREAM2_PACKET1_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream2_packet1);
break;
case SEQ_STREAM2_PACKET1_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream2_packet1);
break;
case SEQ_STREAM2_PACKET2_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream2_packet2);
break;
case SEQ_STREAM2_PACKET2_BEGIN:
next_return.notification =
bt_notification_packet_begin_create(graph,
src_stream2_packet2);
break;
case SEQ_STREAM1_PACKET1_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream1_packet1);
break;
case SEQ_STREAM1_PACKET1_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream1_packet1);
break;
case SEQ_STREAM1_PACKET2_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream1_packet2);
break;
case SEQ_STREAM1_PACKET2_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream1_packet2);
break;
case SEQ_STREAM2_PACKET1_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream2_packet1);
break;
case SEQ_STREAM2_PACKET1_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream2_packet1);
break;
case SEQ_STREAM2_PACKET2_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream2_packet2);
break;
case SEQ_STREAM2_PACKET2_END:
next_return.notification =
bt_notification_packet_end_create(graph,
src_stream2_packet2);
if (event_packet) {
next_return.notification =
bt_notification_event_create(graph, src_event_class,
if (event_packet) {
next_return.notification =
bt_notification_event_create(graph, src_event_class,
- event_packet, src_empty_cc_prio_map);
- assert(next_return.notification);
+ event_packet, src_empty_cc_prio_map);
+ BT_ASSERT(next_return.notification);
struct src_iter_user_data *user_data =
bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
struct src_iter_user_data *user_data =
bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
ret = bt_private_component_source_add_output_private_port(
private_component, "out", NULL, NULL);
ret = bt_private_component_source_add_output_private_port(
private_component, "out", NULL, NULL);
struct bt_notification *notification = NULL;
struct test_event test_event = { 0 };
bool do_append_test_event = true;
struct bt_notification *notification = NULL;
struct test_event test_event = { 0 };
bool do_append_test_event = true;
test_event.type = TEST_EV_TYPE_NOTIF_EVENT;
event = bt_notification_event_borrow_event(notification);
test_event.type = TEST_EV_TYPE_NOTIF_EVENT;
event = bt_notification_event_borrow_event(notification);
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN;
test_event.stream =
bt_notification_stream_begin_borrow_stream(notification);
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN;
test_event.stream =
bt_notification_stream_begin_borrow_stream(notification);
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_END;
test_event.stream =
bt_notification_stream_end_borrow_stream(notification);
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_END;
test_event.stream =
bt_notification_stream_end_borrow_stream(notification);
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN;
test_event.packet =
bt_notification_packet_begin_borrow_packet(notification);
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN;
test_event.packet =
bt_notification_packet_begin_borrow_packet(notification);
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_END;
test_event.packet =
bt_notification_packet_end_borrow_packet(notification);
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_END;
test_event.packet =
bt_notification_packet_end_borrow_packet(notification);
conn_status = bt_private_connection_create_notification_iterator(
priv_conn, &user_data->notif_iter);
conn_status = bt_private_connection_create_notification_iterator(
priv_conn, &user_data->notif_iter);
ret = bt_private_component_sink_add_input_private_port(
private_component, "in", NULL, NULL);
ret = bt_private_component_sink_add_input_private_port(
private_component, "in", NULL, NULL);
ret = bt_component_class_source_set_notification_iterator_init_method(
src_comp_class, src_iter_init);
ret = bt_component_class_source_set_notification_iterator_init_method(
src_comp_class, src_iter_init);
ret = bt_component_class_source_set_notification_iterator_finalize_method(
src_comp_class, src_iter_finalize);
ret = bt_component_class_source_set_notification_iterator_finalize_method(
src_comp_class, src_iter_finalize);
ret = bt_graph_add_component(graph, src_comp_class, "source",
NULL, source);
ret = bt_graph_add_component(graph, src_comp_class, "source",
NULL, source);
ret = bt_component_class_set_finalize_method(sink_comp_class,
sink_finalize);
ret = bt_component_class_set_port_connected_method(
sink_comp_class, sink_port_connected);
ret = bt_component_class_set_finalize_method(sink_comp_class,
sink_finalize);
ret = bt_component_class_set_port_connected_method(
sink_comp_class, sink_port_connected);
ret = bt_graph_add_component(graph, sink_comp_class, "sink",
NULL, sink);
ret = bt_graph_add_component(graph, sink_comp_class, "sink",
NULL, sink);
create_source_sink(graph, &src_comp, &sink_comp);
/* Connect source to sink */
upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
create_source_sink(graph, &src_comp, &sink_comp);
/* Connect source to sink */
upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
clear_test_events();
current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
diag("test: output port notification iterator");
clear_test_events();
current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
diag("test: output port notification iterator");
create_source_sink(graph, &src_comp, NULL);
/* Create notification iterator on source's output port */
create_source_sink(graph, &src_comp, NULL);
/* Create notification iterator on source's output port */
clear_test_events();
current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
diag("test: cannot consume graph with existing output port notification iterator");
clear_test_events();
current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
diag("test: cannot consume graph with existing output port notification iterator");
create_source_sink(graph, &src_comp, NULL);
/* Create notification iterator on source's output port */
upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
notif_iter = bt_output_port_notification_iterator_create(upstream_port,
NULL);
create_source_sink(graph, &src_comp, NULL);
/* Create notification iterator on source's output port */
upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
notif_iter = bt_output_port_notification_iterator_create(upstream_port,
NULL);