X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Flib-logging.c;h=403c2a173a98107dc582fd9fc76aa722a55d5502;hb=605e1019783967f33d86967e7c98dd52cbd69a4c;hp=46ac3a54d490d31c588dcaf18df1d140d2f5bb08;hpb=c6bd8523ba4a37b61a1591c03e23614112b155ba;p=babeltrace.git diff --git a/lib/lib-logging.c b/lib/lib-logging.c index 46ac3a54..403c2a17 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,12 +61,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -111,8 +113,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); @@ -531,14 +533,14 @@ 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-begin-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_cs), + PRFIELD(stream_class->packets_have_default_end_cs)); BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); SET_TMP_PREFIX("trace-class-"); format_trace_class(buf_ch, false, tmp_prefix, trace_class); @@ -669,16 +671,16 @@ static inline void format_packet(char **buf_ch, bool extended, 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_beginning_cs) { + SET_TMP_PREFIX("default-begin-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + packet->default_beginning_cs); } - 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->default_end_cs) { + SET_TMP_PREFIX("default-end-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + packet->default_end_cs); } if (packet->discarded_event_counter_snapshot.base.avail) { @@ -753,10 +755,10 @@ 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); + if (event->default_cs) { + SET_TMP_PREFIX("default-cs-"); + format_clock_snapshot(buf_ch, true, tmp_prefix, + event->default_cs); } packet = bt_event_borrow_packet_const(event); @@ -811,30 +813,30 @@ static inline void format_clock_class(char **buf_ch, bool extended, PRFIELD(clock_class->is_absolute), 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, 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]; 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); } } @@ -898,78 +900,78 @@ 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]; 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); } break; } - case BT_NOTIFICATION_TYPE_STREAM_BEGINNING: + case BT_MESSAGE_TYPE_STREAM_BEGINNING: { - const struct bt_notification_stream_beginning *notif_stream = - (const void *) notif; + const struct bt_message_stream_beginning *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_END: { - const struct bt_notification_stream_end *notif_stream = - (const void *) notif; + const struct bt_message_stream_end *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_PACKET_BEGINNING: + case BT_MESSAGE_TYPE_PACKET_BEGINNING: { - const struct bt_notification_packet_beginning *notif_packet = - (const void *) notif; + const struct bt_message_packet_beginning *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); } break; } - case BT_NOTIFICATION_TYPE_PACKET_END: + case BT_MESSAGE_TYPE_PACKET_END: { - const struct bt_notification_packet_end *notif_packet = - (const void *) notif; + const struct bt_message_packet_end *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); } break; @@ -1111,26 +1113,26 @@ 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); + &graph->event_msg_pool); SET_TMP_PREFIX("pbn-pool-"); format_object_pool(buf_ch, extended, prefix, - &graph->packet_begin_notif_pool); + &graph->packet_begin_msg_pool); SET_TMP_PREFIX("pen-pool-"); format_object_pool(buf_ch, extended, prefix, - &graph->packet_end_notif_pool); + &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]; - 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 +1140,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 +1164,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) { @@ -1330,16 +1332,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);