X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Flib-logging.c;h=42eef20864a864f4998bde9dc6f662657e4a86b4;hb=73ea076192095461cdf0e1ef81f703eae95b22ae;hp=33f9d2f5bd2d6d3a11bc7fe5112bac7069ff9059;hpb=6769570a7eb51bfa5c8d1aa3573e636eda47b131;p=babeltrace.git diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index 33f9d2f5..42eef208 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -41,8 +41,8 @@ #include "value.h" #include "integer-range-set.h" #include "object-pool.h" +#include "graph/interrupter.h" #include "graph/component-class.h" -#include "graph/component-class-sink-colander.h" #include "graph/component-filter.h" #include "graph/component.h" #include "graph/component-sink.h" @@ -807,6 +807,12 @@ static inline void format_clock_snapshot(char **buf_ch, bool extended, } } +static inline void format_interrupter(char **buf_ch, bool extended, + const char *prefix, const struct bt_interrupter *intr) +{ + BUF_APPEND(", %sis-set=%d", PRFIELD(intr->is_set)); +} + static inline void format_value(char **buf_ch, bool extended, const char *prefix, const struct bt_value *value) { @@ -1113,9 +1119,7 @@ static inline void format_graph(char **buf_ch, bool extended, { char tmp_prefix[TMP_PREFIX_LEN]; - BUF_APPEND(", %sis-canceled=%d, %scan-consume=%d, " - "%sconfig-state=%s", - PRFIELD(graph->canceled), + BUF_APPEND(", %scan-consume=%d, %sconfig-state=%s", PRFIELD(graph->can_consume), PRFIELD(bt_graph_configuration_state_string(graph->config_state))); @@ -1148,66 +1152,34 @@ static inline void format_message_iterator(char **buf_ch, bool extended, const char *prefix, const struct bt_message_iterator *iterator) { - const char *type; char tmp_prefix[TMP_PREFIX_LEN]; + const struct bt_self_component_port_input_message_iterator * + port_in_iter = (const void *) iterator; - if (iterator->type == BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT) { - type = "BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT"; - } else if (iterator->type == BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT) { - type = "BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT"; - } else { - type = "(unknown)"; + if (port_in_iter->upstream_component) { + SET_TMP_PREFIX("upstream-comp-"); + format_component(buf_ch, false, tmp_prefix, + port_in_iter->upstream_component); } - BUF_APPEND(", %stype=%s", PRFIELD(type)); - - switch (iterator->type) { - case BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT: - { - const struct bt_self_component_port_input_message_iterator * - port_in_iter = (const void *) iterator; - - if (port_in_iter->upstream_component) { - SET_TMP_PREFIX("upstream-comp-"); - format_component(buf_ch, false, tmp_prefix, - port_in_iter->upstream_component); - } - - if (port_in_iter->upstream_port) { - SET_TMP_PREFIX("upstream-port-"); - format_port(buf_ch, false, tmp_prefix, - port_in_iter->upstream_port); - } - - if (port_in_iter->connection) { - SET_TMP_PREFIX("upstream-conn-"); - format_connection(buf_ch, false, tmp_prefix, - port_in_iter->connection); - } - break; + if (!extended) { + goto end; } - case BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT: - { - const struct bt_port_output_message_iterator *port_out_iter = - (const void *) iterator; - - if (port_out_iter->graph) { - SET_TMP_PREFIX("graph-"); - format_graph(buf_ch, false, tmp_prefix, - port_out_iter->graph); - } - if (port_out_iter->colander) { - SET_TMP_PREFIX("colander-comp-"); - format_component(buf_ch, false, tmp_prefix, - (void *) port_out_iter->colander); - } - - break; + if (port_in_iter->upstream_port) { + SET_TMP_PREFIX("upstream-port-"); + format_port(buf_ch, false, tmp_prefix, + port_in_iter->upstream_port); } - default: - break; + + if (port_in_iter->connection) { + SET_TMP_PREFIX("upstream-conn-"); + format_connection(buf_ch, false, tmp_prefix, + port_in_iter->connection); } + +end: + return; } static inline void format_plugin(char **buf_ch, bool extended, @@ -1446,6 +1418,9 @@ static inline void handle_conversion_specifier_bt(void *priv_data, case 'g': format_graph(buf_ch, extended, prefix, obj); break; + case 'z': + format_interrupter(buf_ch, extended, prefix, obj); + break; case 'o': format_object_pool(buf_ch, extended, prefix, obj); break;