X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Flib-logging.c;h=ce69b30ddefb301353f5ed5d4629a01a46456517;hb=1094efa4f2edbf019427bf0322dab3f3ea9ec5ab;hp=91db4a31e4cc43fc504c92243db310cff12e6feb;hpb=b70d57a123c4e4a208b988539a7eb8fceb2b63a7;p=babeltrace.git diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index 91db4a31..ce69b30d 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -43,7 +43,6 @@ #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" @@ -194,6 +193,14 @@ static inline void format_field_class(char **buf_ch, bool extended, } switch (field_class->type) { + case BT_FIELD_CLASS_TYPE_BIT_ARRAY: + { + const struct bt_field_class_bit_array *ba_fc = + (const void *) field_class; + + BUF_APPEND(", %slength=%" PRIu64, PRFIELD(ba_fc->length)); + break; + } case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: { @@ -261,6 +268,29 @@ static inline void format_field_class(char **buf_ch, bool extended, break; } + case BT_FIELD_CLASS_TYPE_OPTION: + { + const struct bt_field_class_option *opt_fc = + (const void *) field_class; + + BUF_APPEND(", %scontent-fc-addr=%p, %scontent-fc-type=%s", + PRFIELD(opt_fc->content_fc), + PRFIELD(bt_common_field_class_type_string(opt_fc->content_fc->type))); + + if (opt_fc->selector_fc) { + SET_TMP_PREFIX("selector-fc-"); + format_field_class(buf_ch, extended, tmp_prefix, + opt_fc->selector_fc); + } + + if (opt_fc->selector_field_path) { + SET_TMP_PREFIX("selector-field-path-"); + format_field_path(buf_ch, extended, tmp_prefix, + opt_fc->selector_field_path); + } + + break; + } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: @@ -353,6 +383,21 @@ static inline void format_field(char **buf_ch, bool extended, } switch (field->class->type) { + case BT_FIELD_CLASS_TYPE_BOOL: + { + const struct bt_field_bool *bool_field = (const void *) field; + + BUF_APPEND(", %svalue=%d", PRFIELD(bool_field->value)); + break; + } + case BT_FIELD_CLASS_TYPE_BIT_ARRAY: + { + const struct bt_field_bit_array *ba_field = (const void *) field; + + BUF_APPEND(", %svalue-as-int=%" PRIx64, + PRFIELD(ba_field->value_as_int)); + break; + } case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: @@ -1120,9 +1165,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))); @@ -1155,66 +1198,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,