X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Flib-logging.c;h=683df22eb2d009d1b968f611e18bde28fa85dc61;hb=7fe92073394104c8ffe575b1b05ee4fe1df356ea;hp=46ac3a54d490d31c588dcaf18df1d140d2f5bb08;hpb=c6bd8523ba4a37b61a1591c03e23614112b155ba;p=babeltrace.git diff --git a/lib/lib-logging.c b/lib/lib-logging.c index 46ac3a54..683df22e 100644 --- a/lib/lib-logging.c +++ b/lib/lib-logging.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -48,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -59,19 +61,21 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #define LIB_LOGGING_BUF_SIZE (4096 * 4) -static char __thread lib_logging_buf[LIB_LOGGING_BUF_SIZE]; +static __thread char lib_logging_buf[LIB_LOGGING_BUF_SIZE]; #define BUF_APPEND(_fmt, ...) \ do { \ @@ -96,10 +100,12 @@ static char __thread lib_logging_buf[LIB_LOGGING_BUF_SIZE]; #define PRFIELD_GSTRING(_expr) PRFIELD((_expr) ? (_expr)->str : NULL) +#define TMP_PREFIX_LEN 64 #define SET_TMP_PREFIX(_prefix2) \ do { \ - strcpy(tmp_prefix, prefix); \ - strcat(tmp_prefix, (_prefix2)); \ + snprintf(tmp_prefix, TMP_PREFIX_LEN - 1, "%s%s", \ + prefix, (_prefix2)); \ + tmp_prefix[TMP_PREFIX_LEN - 1] = '\0'; \ } while (0) static inline void format_component(char **buf_ch, bool extended, @@ -111,8 +117,8 @@ static inline void format_port(char **buf_ch, bool extended, static inline void format_connection(char **buf_ch, bool extended, const char *prefix, const struct bt_connection *connection); -static inline void format_clock_value(char **buf_ch, bool extended, - const char *prefix, const struct bt_clock_value *clock_value); +static inline void format_clock_snapshot(char **buf_ch, bool extended, + const char *prefix, const struct bt_clock_snapshot *clock_snapshot); static inline void format_field_path(char **buf_ch, bool extended, const char *prefix, const struct bt_field_path *field_path); @@ -181,7 +187,7 @@ static inline void format_array_field_class(char **buf_ch, static inline void format_field_class(char **buf_ch, bool extended, const char *prefix, const struct bt_field_class *field_class) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s", PRFIELD(bt_common_field_class_type_string(field_class->type))); @@ -405,24 +411,34 @@ static inline void format_field_path(char **buf_ch, bool extended, { uint64_t i; - if (field_path->indexes) { - BT_ASSERT(field_path->indexes); - BUF_APPEND(", %sindex-count=%u", - PRFIELD(field_path->indexes->len)); + if (field_path->items) { + BT_ASSERT(field_path->items); + BUF_APPEND(", %sitem-count=%u", + PRFIELD(field_path->items->len)); } - if (!extended || !field_path->indexes) { + if (!extended || !field_path->items) { return; } BUF_APPEND(", %spath=[%s", PRFIELD(bt_common_scope_string(field_path->root))); - for (i = 0; i < field_path->indexes->len; i++) { - uint64_t index = bt_field_path_get_index_by_index_inline( - field_path, i); - - BUF_APPEND(", %" PRIu64, index); + for (i = 0; i < bt_field_path_get_item_count(field_path); i++) { + const struct bt_field_path_item *fp_item = + bt_field_path_borrow_item_by_index_const(field_path, i); + + switch (bt_field_path_item_get_type(fp_item)) { + case BT_FIELD_PATH_ITEM_TYPE_INDEX: + BUF_APPEND(", %" PRIu64, + bt_field_path_item_index_get_index(fp_item)); + break; + case BT_FIELD_PATH_ITEM_TYPE_CURRENT_ARRAY_ELEMENT: + BUF_APPEND("%s", ", "); + break; + default: + abort(); + } } BUF_APPEND("%s", "]"); @@ -431,8 +447,6 @@ static inline void format_field_path(char **buf_ch, bool extended, static inline void format_trace_class(char **buf_ch, bool extended, const char *prefix, const struct bt_trace_class *trace_class) { - char tmp_prefix[64]; - if (trace_class->name.value) { BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace_class->name.value)); @@ -453,19 +467,14 @@ static inline void format_trace_class(char **buf_ch, bool extended, PRFIELD(trace_class->stream_classes->len)); } - BUF_APPEND(", %spacket-header-fc-addr=%p, " - "%sassigns-auto-sc-id=%d", - PRFIELD(trace_class->packet_header_fc), + BUF_APPEND(", %sassigns-auto-sc-id=%d", PRFIELD(trace_class->assigns_automatic_stream_class_id)); - SET_TMP_PREFIX("phf-pool-"); - format_object_pool(buf_ch, extended, prefix, - &trace_class->packet_header_field_pool); } static inline void format_trace(char **buf_ch, bool extended, const char *prefix, const struct bt_trace *trace) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; if (trace->name.value) { BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace->name.value)); @@ -482,8 +491,6 @@ static inline void format_trace(char **buf_ch, bool extended, PRFIELD(trace->streams->len)); } - BUF_APPEND(", %sis-static=%d", PRFIELD(trace->is_static)); - if (!trace->class) { return; } @@ -498,7 +505,7 @@ static inline void format_stream_class(char **buf_ch, bool extended, const struct bt_stream_class *stream_class) { const struct bt_trace_class *trace_class; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream_class->id)); @@ -519,9 +526,8 @@ static inline void format_stream_class(char **buf_ch, bool extended, } BUF_APPEND(", %spacket-context-fc-addr=%p, " - "%sevent-header-fc-addr=%p, %sevent-common-context-fc-addr=%p", + "%sevent-common-context-fc-addr=%p", PRFIELD(stream_class->packet_context_fc), - PRFIELD(stream_class->event_header_fc), PRFIELD(stream_class->event_common_context_fc)); trace_class = bt_stream_class_borrow_trace_class_inline(stream_class); if (!trace_class) { @@ -529,24 +535,17 @@ static inline void format_stream_class(char **buf_ch, bool extended, } BUF_APPEND(", %sassigns-auto-ec-id=%d, %sassigns-auto-stream-id=%d, " - "%spackets-have-discarded-ev-counter-snapshot=%d, " - "%spackets-have-packet-counter-snapshot=%d, " - "%spackets-have-default-begin-cv=%d, " - "%spackets-have-default-end-cv=%d", + "%spackets-have-default-beginning-cs=%d, " + "%spackets-have-default-end-cs=%d, ", PRFIELD(stream_class->assigns_automatic_event_class_id), PRFIELD(stream_class->assigns_automatic_stream_id), - PRFIELD(stream_class->packets_have_discarded_event_counter_snapshot), - PRFIELD(stream_class->packets_have_packet_counter_snapshot), - PRFIELD(stream_class->packets_have_default_beginning_cv), - PRFIELD(stream_class->packets_have_default_end_cv)); + PRFIELD(stream_class->packets_have_default_beginning_clock_snapshot), + PRFIELD(stream_class->packets_have_default_end_clock_snapshot)); BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); SET_TMP_PREFIX("trace-class-"); format_trace_class(buf_ch, false, tmp_prefix, trace_class); - SET_TMP_PREFIX("ehf-pool-"); - format_object_pool(buf_ch, extended, prefix, - &stream_class->event_header_field_pool); SET_TMP_PREFIX("pcf-pool-"); - format_object_pool(buf_ch, extended, prefix, + format_object_pool(buf_ch, extended, tmp_prefix, &stream_class->packet_context_field_pool); } @@ -555,7 +554,7 @@ static inline void format_event_class(char **buf_ch, bool extended, { const struct bt_stream_class *stream_class; const struct bt_trace_class *trace_class; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %sid=%" PRIu64, PRFIELD(event_class->id)); @@ -602,7 +601,8 @@ static inline void format_event_class(char **buf_ch, bool extended, SET_TMP_PREFIX("trace-class-"); format_trace_class(buf_ch, false, tmp_prefix, trace_class); SET_TMP_PREFIX("event-pool-"); - format_object_pool(buf_ch, extended, prefix, &event_class->event_pool); + format_object_pool(buf_ch, extended, tmp_prefix, + &event_class->event_pool); } static inline void format_stream(char **buf_ch, bool extended, @@ -611,7 +611,7 @@ static inline void format_stream(char **buf_ch, bool extended, const struct bt_stream_class *stream_class; const struct bt_trace_class *trace_class = NULL; const struct bt_trace *trace = NULL; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream->id)); @@ -645,7 +645,7 @@ static inline void format_stream(char **buf_ch, bool extended, } SET_TMP_PREFIX("packet-pool-"); - format_object_pool(buf_ch, extended, prefix, &stream->packet_pool); + format_object_pool(buf_ch, extended, tmp_prefix, &stream->packet_pool); } static inline void format_packet(char **buf_ch, bool extended, @@ -653,44 +653,20 @@ static inline void format_packet(char **buf_ch, bool extended, { const struct bt_stream *stream; const struct bt_trace_class *trace_class; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; if (!extended) { return; } - BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, " - "%scontext-field-addr=%p", + BUF_APPEND(", %sis-frozen=%d, %scontext-field-addr=%p", PRFIELD(packet->frozen), - PRFIELD(packet->header_field ? packet->header_field->field : NULL), PRFIELD(packet->context_field ? packet->context_field->field : NULL)); stream = bt_packet_borrow_stream_const(packet); if (!stream) { return; } - if (packet->default_beginning_cv) { - SET_TMP_PREFIX("default-begin-cv-"); - format_clock_value(buf_ch, true, tmp_prefix, - packet->default_beginning_cv); - } - - if (packet->default_end_cv) { - SET_TMP_PREFIX("default-end-cv-"); - format_clock_value(buf_ch, true, tmp_prefix, - packet->default_end_cv); - } - - if (packet->discarded_event_counter_snapshot.base.avail) { - BUF_APPEND(", %sdiscarded-ev-counter-snapshot=%" PRIu64, - PRFIELD(packet->discarded_event_counter_snapshot.value)); - } - - if (packet->packet_counter_snapshot.base.avail) { - BUF_APPEND(", %spacket-counter-snapshot=%" PRIu64, - PRFIELD(packet->packet_counter_snapshot.value)); - } - BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream)); SET_TMP_PREFIX("stream-"); format_stream(buf_ch, false, tmp_prefix, stream); @@ -711,19 +687,17 @@ static inline void format_event(char **buf_ch, bool extended, const struct bt_stream *stream; const struct bt_trace_class *trace_class; const struct bt_stream_class *stream_class; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; if (!extended) { return; } - BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, " + BUF_APPEND(", %sis-frozen=%d, " "%scommon-context-field-addr=%p, " "%sspecific-context-field-addr=%p, " "%spayload-field-addr=%p, ", PRFIELD(event->frozen), - PRFIELD(event->header_field ? - event->header_field->field : NULL), PRFIELD(event->common_context_field), PRFIELD(event->specific_context_field), PRFIELD(event->payload_field)); @@ -753,12 +727,6 @@ static inline void format_event(char **buf_ch, bool extended, } } - if (event->default_cv) { - SET_TMP_PREFIX("default-cv-"); - format_clock_value(buf_ch, true, tmp_prefix, - event->default_cv); - } - packet = bt_event_borrow_packet_const(event); if (!packet) { return; @@ -780,7 +748,7 @@ static inline void format_event(char **buf_ch, bool extended, static inline void format_clock_class(char **buf_ch, bool extended, const char *prefix, const struct bt_clock_class *clock_class) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; if (clock_class->name.value) { BUF_APPEND(", %sname=\"%s\"", PRFIELD(clock_class->name.value)); @@ -803,38 +771,39 @@ static inline void format_clock_class(char **buf_ch, bool extended, BUF_APPEND(", %sis-frozen=%d, %sprecision=%" PRIu64 ", " "%soffset-s=%" PRId64 ", " - "%soffset-cycles=%" PRIu64 ", %sis-absolute=%d, " + "%soffset-cycles=%" PRIu64 ", %sorigin-is-unix-epoch=%d, " "%sbase-offset-ns=%" PRId64, PRFIELD(clock_class->frozen), PRFIELD(clock_class->precision), PRFIELD(clock_class->offset_seconds), PRFIELD(clock_class->offset_cycles), - PRFIELD(clock_class->is_absolute), + PRFIELD(clock_class->origin_is_unix_epoch), PRFIELD(clock_class->base_offset.value_ns)); - SET_TMP_PREFIX("cv-pool-"); - format_object_pool(buf_ch, extended, prefix, &clock_class->cv_pool); + SET_TMP_PREFIX("cs-pool-"); + format_object_pool(buf_ch, extended, tmp_prefix, + &clock_class->cs_pool); } -static inline void format_clock_value(char **buf_ch, bool extended, - const char *prefix, const struct bt_clock_value *clock_value) +static inline void format_clock_snapshot(char **buf_ch, bool extended, + const char *prefix, const struct bt_clock_snapshot *clock_snapshot) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %svalue=%" PRIu64 ", %sns-from-origin=%" PRId64, - PRFIELD(clock_value->value_cycles), - PRFIELD(clock_value->ns_from_origin)); + PRFIELD(clock_snapshot->value_cycles), + PRFIELD(clock_snapshot->ns_from_origin)); if (!extended) { return; } - BUF_APPEND(", %sis-set=%d", PRFIELD(clock_value->is_set)); + BUF_APPEND(", %sis-set=%d", PRFIELD(clock_snapshot->is_set)); - if (clock_value->clock_class) { + if (clock_snapshot->clock_class) { BUF_APPEND(", %sclock-class-addr=%p", - PRFIELD(clock_value->clock_class)); + PRFIELD(clock_snapshot->clock_class)); SET_TMP_PREFIX("clock-class-"); format_clock_class(buf_ch, false, tmp_prefix, - clock_value->clock_class); + clock_snapshot->clock_class); } } @@ -856,11 +825,16 @@ static inline void format_value(char **buf_ch, bool extended, BUF_APPEND(", %svalue=%d", PRFIELD(val)); break; } - case BT_VALUE_TYPE_INTEGER: + case BT_VALUE_TYPE_UNSIGNED_INTEGER: { - int64_t val = bt_value_integer_get(value); - - BUF_APPEND(", %svalue=%" PRId64, PRFIELD(val)); + BUF_APPEND(", %svalue=%" PRIu64, + PRFIELD(bt_value_unsigned_integer_get(value))); + break; + } + case BT_VALUE_TYPE_SIGNED_INTEGER: + { + BUF_APPEND(", %svalue=%" PRId64, + PRFIELD(bt_value_signed_integer_get(value))); break; } case BT_VALUE_TYPE_REAL: @@ -898,78 +872,124 @@ static inline void format_value(char **buf_ch, bool extended, } } -static inline void format_notification(char **buf_ch, bool extended, - const char *prefix, const struct bt_notification *notif) +static inline void format_message(char **buf_ch, bool extended, + const char *prefix, const struct bt_message *msg) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s", - PRFIELD(bt_notification_type_string(notif->type))); + PRFIELD(bt_message_type_string(msg->type))); if (!extended) { return; } BUF_APPEND(", %sis-frozen=%d, %sgraph-addr=%p", - PRFIELD(notif->frozen), PRFIELD(notif->graph)); + PRFIELD(msg->frozen), PRFIELD(msg->graph)); - switch (notif->type) { - case BT_NOTIFICATION_TYPE_EVENT: + switch (msg->type) { + case BT_MESSAGE_TYPE_EVENT: { - const struct bt_notification_event *notif_event = - (const void *) notif; + const struct bt_message_event *msg_event = + (const void *) msg; - if (notif_event->event) { + if (msg_event->event) { SET_TMP_PREFIX("event-"); - format_event(buf_ch, true, tmp_prefix, notif_event->event); + format_event(buf_ch, true, tmp_prefix, + msg_event->event); + } + + if (msg_event->default_cs) { + SET_TMP_PREFIX("default-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + msg_event->default_cs); } break; } - case BT_NOTIFICATION_TYPE_STREAM_BEGINNING: + case BT_MESSAGE_TYPE_STREAM_BEGINNING: + case BT_MESSAGE_TYPE_STREAM_END: { - const struct bt_notification_stream_beginning *notif_stream = - (const void *) notif; + const struct bt_message_stream *msg_stream = (const void *) msg; - if (notif_stream->stream) { + if (msg_stream->stream) { SET_TMP_PREFIX("stream-"); - format_stream(buf_ch, true, tmp_prefix, notif_stream->stream); + format_stream(buf_ch, true, tmp_prefix, + msg_stream->stream); } break; } - case BT_NOTIFICATION_TYPE_STREAM_END: + case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING: + case BT_MESSAGE_TYPE_STREAM_ACTIVITY_END: { - const struct bt_notification_stream_end *notif_stream = - (const void *) notif; + const struct bt_message_stream_activity *msg_stream_activity = + (const void *) msg; - if (notif_stream->stream) { + if (msg_stream_activity->stream) { SET_TMP_PREFIX("stream-"); - format_stream(buf_ch, true, tmp_prefix, notif_stream->stream); + format_stream(buf_ch, true, tmp_prefix, + msg_stream_activity->stream); + } + + BUF_APPEND(", %sdefault-cs-state=%s", + PRFIELD(bt_message_stream_activity_clock_snapshot_state_string( + msg_stream_activity->default_cs_state))); + + if (msg_stream_activity->default_cs) { + SET_TMP_PREFIX("default-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + msg_stream_activity->default_cs); } break; } - case BT_NOTIFICATION_TYPE_PACKET_BEGINNING: + case BT_MESSAGE_TYPE_PACKET_BEGINNING: + case BT_MESSAGE_TYPE_PACKET_END: { - const struct bt_notification_packet_beginning *notif_packet = - (const void *) notif; + const struct bt_message_packet *msg_packet = (const void *) msg; - if (notif_packet->packet) { + if (msg_packet->packet) { SET_TMP_PREFIX("packet-"); - format_packet(buf_ch, true, tmp_prefix, notif_packet->packet); + format_packet(buf_ch, true, tmp_prefix, + msg_packet->packet); + } + + if (msg_packet->default_cs) { + SET_TMP_PREFIX("default-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + msg_packet->default_cs); } break; } - case BT_NOTIFICATION_TYPE_PACKET_END: + case BT_MESSAGE_TYPE_DISCARDED_EVENTS: + case BT_MESSAGE_TYPE_DISCARDED_PACKETS: { - const struct bt_notification_packet_end *notif_packet = - (const void *) notif; + const struct bt_message_discarded_items *msg_disc_items = + (const void *) msg; - if (notif_packet->packet) { - SET_TMP_PREFIX("packet-"); - format_packet(buf_ch, true, tmp_prefix, notif_packet->packet); + if (msg_disc_items->stream) { + SET_TMP_PREFIX("stream-"); + format_stream(buf_ch, true, tmp_prefix, + msg_disc_items->stream); + } + + if (msg_disc_items->default_begin_cs) { + SET_TMP_PREFIX("default-begin-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + msg_disc_items->default_begin_cs); + } + + if (msg_disc_items->default_end_cs) { + SET_TMP_PREFIX("default-end-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + msg_disc_items->default_end_cs); + } + + if (msg_disc_items->count.base.avail) { + BUF_APPEND(", %scount=%" PRIu64, + PRFIELD(msg_disc_items->count.value)); } break; @@ -994,7 +1014,7 @@ static inline void format_component_class(char **buf_ch, bool extended, const char *prefix, const struct bt_component_class *comp_class) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s, %sname=\"%s\"", PRFIELD(bt_component_class_type_string(comp_class->type)), @@ -1021,7 +1041,7 @@ static inline void format_component_class(char **buf_ch, bool extended, static inline void format_component(char **buf_ch, bool extended, const char *prefix, const struct bt_component *component) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %sname=\"%s\"", PRFIELD_GSTRING(component->name)); @@ -1050,7 +1070,7 @@ static inline void format_component(char **buf_ch, bool extended, static inline void format_port(char **buf_ch, bool extended, const char *prefix, const struct bt_port *port) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s, %sname=\"%s\"", PRFIELD(bt_port_type_string(port->type)), @@ -1069,7 +1089,7 @@ static inline void format_port(char **buf_ch, bool extended, static inline void format_connection(char **buf_ch, bool extended, const char *prefix, const struct bt_connection *connection) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; if (!extended) { return; @@ -1091,9 +1111,13 @@ static inline void format_connection(char **buf_ch, bool extended, static inline void format_graph(char **buf_ch, bool extended, const char *prefix, const struct bt_graph *graph) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; - BUF_APPEND(", %sis-canceled=%d", PRFIELD(graph->canceled)); + BUF_APPEND(", %sis-canceled=%d, %scan-consume=%d, " + "%sconfig-state=%s", + PRFIELD(graph->canceled), + PRFIELD(graph->can_consume), + PRFIELD(bt_graph_configuration_state_string(graph->config_state))); if (!extended) { return; @@ -1110,27 +1134,27 @@ static inline void format_graph(char **buf_ch, bool extended, } SET_TMP_PREFIX("en-pool-"); - format_object_pool(buf_ch, extended, prefix, - &graph->event_notif_pool); + format_object_pool(buf_ch, extended, tmp_prefix, + &graph->event_msg_pool); SET_TMP_PREFIX("pbn-pool-"); - format_object_pool(buf_ch, extended, prefix, - &graph->packet_begin_notif_pool); + format_object_pool(buf_ch, extended, tmp_prefix, + &graph->packet_begin_msg_pool); SET_TMP_PREFIX("pen-pool-"); - format_object_pool(buf_ch, extended, prefix, - &graph->packet_end_notif_pool); + format_object_pool(buf_ch, extended, tmp_prefix, + &graph->packet_end_msg_pool); } -static inline void format_notification_iterator(char **buf_ch, +static inline void format_message_iterator(char **buf_ch, bool extended, const char *prefix, - const struct bt_notification_iterator *iterator) + const struct bt_message_iterator *iterator) { const char *type; - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; - if (iterator->type == BT_NOTIFICATION_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT) { - type = "BT_NOTIFICATION_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT"; - } else if (iterator->type == BT_NOTIFICATION_ITERATOR_TYPE_PORT_OUTPUT) { - type = "BT_NOTIFICATION_ITERATOR_TYPE_PORT_OUTPUT"; + 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)"; } @@ -1138,9 +1162,9 @@ static inline void format_notification_iterator(char **buf_ch, BUF_APPEND(", %stype=%s", PRFIELD(type)); switch (iterator->type) { - case BT_NOTIFICATION_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT: + case BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT: { - const struct bt_self_component_port_input_notification_iterator * + const struct bt_self_component_port_input_message_iterator * port_in_iter = (const void *) iterator; if (port_in_iter->upstream_component) { @@ -1162,9 +1186,9 @@ static inline void format_notification_iterator(char **buf_ch, } break; } - case BT_NOTIFICATION_ITERATOR_TYPE_PORT_OUTPUT: + case BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT: { - const struct bt_port_output_notification_iterator *port_out_iter = + const struct bt_port_output_message_iterator *port_out_iter = (const void *) iterator; if (port_out_iter->graph) { @@ -1189,7 +1213,7 @@ static inline void format_notification_iterator(char **buf_ch, static inline void format_plugin(char **buf_ch, bool extended, const char *prefix, const struct bt_plugin *plugin) { - char tmp_prefix[64]; + char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s", PRFIELD(bt_plugin_type_string(plugin->type))); @@ -1330,16 +1354,16 @@ static inline void handle_conversion_specifier_bt(void *priv_data, format_clock_class(buf_ch, extended, prefix, obj); break; case 'k': - format_clock_value(buf_ch, extended, prefix, obj); + format_clock_snapshot(buf_ch, extended, prefix, obj); break; case 'v': format_value(buf_ch, extended, prefix, obj); break; case 'n': - format_notification(buf_ch, extended, prefix, obj); + format_message(buf_ch, extended, prefix, obj); break; case 'i': - format_notification_iterator(buf_ch, extended, prefix, obj); + format_message_iterator(buf_ch, extended, prefix, obj); break; case 'C': format_component_class(buf_ch, extended, prefix, obj); @@ -1374,7 +1398,6 @@ update_fmt: *out_fmt_ch = fmt_ch; } -BT_HIDDEN void bt_lib_log(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, ...) {