#include <babeltrace/plugin/plugin-dev.h>
#include <babeltrace/graph/component.h>
#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-component-sink.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/graph/port.h>
#include <babeltrace/graph/private-connection.h>
{
enum bt_component_status ret;
struct dummy *dummy = g_new0(struct dummy, 1);
+ void *priv_port;
if (!dummy) {
ret = BT_COMPONENT_STATUS_NOMEM;
goto end;
}
+ priv_port = bt_private_component_sink_add_input_private_port(component,
+ "in", NULL);
+ if (!priv_port) {
+ ret = BT_COMPONENT_STATUS_NOMEM;
+ goto end;
+ }
+
+ bt_put(priv_port);
dummy->iterators = g_ptr_array_new_with_free_func(
(GDestroyNotify) bt_put);
if (!dummy->iterators) {
connection = bt_private_port_get_private_connection(self_port);
assert(connection);
iterator = bt_private_connection_create_notification_iterator(
- connection);
+ connection, NULL);
if (!iterator) {
dummy->error = true;
goto end;
enum bt_component_status dummy_consume(struct bt_private_component *component)
{
- enum bt_component_status ret;
+ enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
struct bt_notification *notif = NULL;
size_t i;
struct dummy *dummy;
case BT_NOTIFICATION_ITERATOR_STATUS_ERROR:
ret = BT_COMPONENT_STATUS_ERROR;
goto end;
+ case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
+ ret = BT_COMPONENT_STATUS_AGAIN;
+ goto end;
case BT_NOTIFICATION_ITERATOR_STATUS_END:
- ret = BT_COMPONENT_STATUS_END;
g_ptr_array_remove_index(dummy->iterators, i);
i--;
continue;
default:
break;
}
-
- notif = bt_notification_iterator_get_notification(it);
- if (!notif) {
- ret = BT_COMPONENT_STATUS_ERROR;
- goto end;
- }
-
- /*
- * Dummy! I'm doing nothing with this notification,
- * NOTHING.
- */
- BT_PUT(notif);
}
if (dummy->iterators->len == 0) {