X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Ftext%2Fpretty%2Fpretty.c;h=7c548391ab79e4cecf8d33a0fccd47715b011cf6;hb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;hp=ef1224b781bea6b829ca72f350355d58e7c51a7e;hpb=4cdfc5e86b64137d96c31495cbdea99801714c2b;p=babeltrace.git diff --git a/plugins/text/pretty/pretty.c b/plugins/text/pretty/pretty.c index ef1224b7..7c548391 100644 --- a/plugins/text/pretty/pretty.c +++ b/plugins/text/pretty/pretty.c @@ -23,14 +23,17 @@ * SOFTWARE. */ -#include -#include -#include +#define BT_LOG_TAG "PLUGIN-TEXT-PRETTY-SINK" +#include "logging.h" + +#include +#include +#include #include #include #include #include -#include +#include #include "pretty.h" @@ -62,6 +65,9 @@ const char *plugin_options[] = { "field-callsite", }; +static +const char * const in_port_name = "in"; + static void destroy_pretty_data(struct pretty_component *pretty) { @@ -130,18 +136,19 @@ bt_self_component_status handle_message( BT_ASSERT(pretty); switch (bt_message_get_type(message)) { - case BT_MESSAGE_TYPE_PACKET_BEGINNING: - if (pretty_print_packet(pretty, message)) { - ret = BT_SELF_COMPONENT_STATUS_ERROR; - } - break; case BT_MESSAGE_TYPE_EVENT: if (pretty_print_event(pretty, message)) { ret = BT_SELF_COMPONENT_STATUS_ERROR; } break; - case BT_MESSAGE_TYPE_INACTIVITY: - fprintf(stderr, "Inactivity message\n"); + case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: + BT_LOGD_STR("Message iterator inactivity message."); + break; + case BT_MESSAGE_TYPE_DISCARDED_EVENTS: + case BT_MESSAGE_TYPE_DISCARDED_PACKETS: + if (pretty_print_discarded_items(pretty, message)) { + ret = BT_SELF_COMPONENT_STATUS_ERROR; + } break; default: break; @@ -151,10 +158,8 @@ bt_self_component_status handle_message( } BT_HIDDEN -bt_self_component_status pretty_port_connected( - bt_self_component_sink *comp, - bt_self_component_port_input *self_port, - const bt_port_output *other_port) +bt_self_component_status pretty_graph_is_configured( + bt_self_component_sink *comp) { bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK; struct pretty_component *pretty; @@ -164,7 +169,8 @@ bt_self_component_status pretty_port_connected( BT_ASSERT(pretty); BT_ASSERT(!pretty->iterator); pretty->iterator = bt_self_component_port_input_message_iterator_create( - self_port); + bt_self_component_sink_borrow_input_port_by_name(comp, + in_port_name)); if (!pretty->iterator) { status = BT_SELF_COMPONENT_STATUS_NOMEM; } @@ -649,7 +655,8 @@ bt_self_component_status pretty_init( goto end; } - ret = bt_self_component_sink_add_input_port(comp, "in", NULL, NULL); + ret = bt_self_component_sink_add_input_port(comp, in_port_name, + NULL, NULL); if (ret != BT_SELF_COMPONENT_STATUS_OK) { goto end; }