* SOFTWARE.
*/
-#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/component-sink.h>
-#include <babeltrace/graph/port.h>
-#include <babeltrace/graph/private-port.h>
-#include <babeltrace/graph/connection.h>
-#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/notification.h>
-#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/values.h>
#include <babeltrace/compiler-internal.h>
#include <babeltrace/common-internal.h>
#include <stdio.h>
#include <stdbool.h>
#include <glib.h>
-#include <assert.h>
+#include <babeltrace/assert-internal.h>
#include "pretty.h"
+GQuark stream_packet_context_quarks[STREAM_PACKET_CONTEXT_QUARKS_LEN];
+
static
const char *plugin_options[] = {
"color",
{
enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
- assert(pretty);
+ BT_ASSERT(pretty);
switch (bt_notification_get_type(notification)) {
case BT_NOTIFICATION_TYPE_EVENT:
case BT_NOTIFICATION_TYPE_INACTIVITY:
fprintf(stderr, "Inactivity notification\n");
break;
- case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
- case BT_NOTIFICATION_TYPE_PACKET_END:
- case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
- case BT_NOTIFICATION_TYPE_STREAM_END:
- break;
case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
ret = pretty_print_discarded_elements(pretty, notification);
break;
default:
- fprintf(stderr, "Unhandled notification type\n");
+ break;
}
return ret;
enum bt_connection_status conn_status;
struct bt_private_connection *connection;
struct pretty_component *pretty;
- static const enum bt_notification_type notif_types[] = {
- BT_NOTIFICATION_TYPE_EVENT,
- BT_NOTIFICATION_TYPE_DISCARDED_PACKETS,
- BT_NOTIFICATION_TYPE_DISCARDED_EVENTS,
- BT_NOTIFICATION_TYPE_SENTINEL,
- };
pretty = bt_private_component_get_user_data(component);
- assert(pretty);
- assert(!pretty->input_iterator);
+ BT_ASSERT(pretty);
+ BT_ASSERT(!pretty->input_iterator);
connection = bt_private_port_get_private_connection(self_port);
- assert(connection);
+ BT_ASSERT(connection);
conn_status = bt_private_connection_create_notification_iterator(
- connection, notif_types, &pretty->input_iterator);
+ connection, &pretty->input_iterator);
if (conn_status != BT_CONNECTION_STATUS_OK) {
pretty->error = true;
}
}
notification = bt_notification_iterator_get_notification(it);
- assert(notification);
+ BT_ASSERT(notification);
ret = handle_notification(pretty, notification);
end: