From b9fd9cbba60297c02bea7473d4347c588d9724d7 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 19 Feb 2019 16:12:16 -0500 Subject: [PATCH] lib: rename inactivity msg to msg iterator inactivity msg This is avoid confusion with stream activity message types. Signed-off-by: Francis Deslauriers --- include/Makefile.am | 6 +-- include/babeltrace/babeltrace.h | 4 +- include/babeltrace/graph/message-const.h | 2 +- include/babeltrace/graph/message-internal.h | 4 +- ...ssage-message-iterator-inactivity-const.h} | 8 ++-- ...ge-message-iterator-inactivity-internal.h} | 8 ++-- ... => message-message-iterator-inactivity.h} | 8 ++-- lib/graph/iterator.c | 8 ++-- lib/graph/message/Makefile.am | 2 +- ...tivity.c => message-iterator-inactivity.c} | 41 ++++++++++--------- lib/lib-logging.c | 2 +- plugins/text/pretty/pretty.c | 4 +- plugins/utils/counter/counter.c | 9 ++-- plugins/utils/counter/counter.h | 2 +- plugins/utils/muxer/muxer.c | 4 +- 15 files changed, 58 insertions(+), 54 deletions(-) rename include/babeltrace/graph/{message-inactivity-const.h => message-message-iterator-inactivity-const.h} (83%) rename include/babeltrace/graph/{message-inactivity-internal.h => message-message-iterator-inactivity-internal.h} (83%) rename include/babeltrace/graph/{message-inactivity.h => message-message-iterator-inactivity.h} (85%) rename lib/graph/message/{inactivity.c => message-iterator-inactivity.c} (67%) diff --git a/include/Makefile.am b/include/Makefile.am index 172188f1..9e203037 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -174,8 +174,8 @@ babeltracegraphinclude_HEADERS = \ babeltrace/graph/message-discarded-packets.h \ babeltrace/graph/message-event-const.h \ babeltrace/graph/message-event.h \ - babeltrace/graph/message-inactivity-const.h \ - babeltrace/graph/message-inactivity.h \ + babeltrace/graph/message-message-iterator-inactivity-const.h \ + babeltrace/graph/message-message-iterator-inactivity.h \ babeltrace/graph/message-iterator-const.h \ babeltrace/graph/message-packet-beginning-const.h \ babeltrace/graph/message-packet-beginning.h \ @@ -286,7 +286,7 @@ noinst_HEADERS = \ babeltrace/graph/graph-internal.h \ babeltrace/graph/message-discarded-items-internal.h \ babeltrace/graph/message-event-internal.h \ - babeltrace/graph/message-inactivity-internal.h \ + babeltrace/graph/message-message-iterator-inactivity-internal.h \ babeltrace/graph/message-internal.h \ babeltrace/graph/message-iterator-internal.h \ babeltrace/graph/message-packet-internal.h \ diff --git a/include/babeltrace/babeltrace.h b/include/babeltrace/babeltrace.h index 5e1e36ec..903329b9 100644 --- a/include/babeltrace/babeltrace.h +++ b/include/babeltrace/babeltrace.h @@ -116,9 +116,9 @@ #include #include #include -#include -#include #include +#include +#include #include #include #include diff --git a/include/babeltrace/graph/message-const.h b/include/babeltrace/graph/message-const.h index 414124bb..564fdf53 100644 --- a/include/babeltrace/graph/message-const.h +++ b/include/babeltrace/graph/message-const.h @@ -36,7 +36,7 @@ extern "C" { */ typedef enum bt_message_type { BT_MESSAGE_TYPE_EVENT = 0, - BT_MESSAGE_TYPE_INACTIVITY = 1, + BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY = 1, BT_MESSAGE_TYPE_STREAM_BEGINNING = 2, BT_MESSAGE_TYPE_STREAM_END = 3, BT_MESSAGE_TYPE_PACKET_BEGINNING = 4, diff --git a/include/babeltrace/graph/message-internal.h b/include/babeltrace/graph/message-internal.h index af687238..bfe561e5 100644 --- a/include/babeltrace/graph/message-internal.h +++ b/include/babeltrace/graph/message-internal.h @@ -114,8 +114,8 @@ const char *bt_message_type_string(enum bt_message_type type) switch (type) { case BT_MESSAGE_TYPE_EVENT: return "BT_MESSAGE_TYPE_EVENT"; - case BT_MESSAGE_TYPE_INACTIVITY: - return "BT_MESSAGE_TYPE_INACTIVITY"; + case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: + return "BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY"; case BT_MESSAGE_TYPE_STREAM_BEGINNING: return "BT_MESSAGE_TYPE_STREAM_BEGINNING"; case BT_MESSAGE_TYPE_STREAM_END: diff --git a/include/babeltrace/graph/message-inactivity-const.h b/include/babeltrace/graph/message-message-iterator-inactivity-const.h similarity index 83% rename from include/babeltrace/graph/message-inactivity-const.h rename to include/babeltrace/graph/message-message-iterator-inactivity-const.h index b473b849..02f5b008 100644 --- a/include/babeltrace/graph/message-inactivity-const.h +++ b/include/babeltrace/graph/message-message-iterator-inactivity-const.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_CONST_H -#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_CONST_H +#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_CONST_H +#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_CONST_H /* * Copyright 2017-2018 Philippe Proulx @@ -34,11 +34,11 @@ extern "C" { #endif extern bt_clock_snapshot_state -bt_message_inactivity_borrow_default_clock_snapshot_const( +bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( const bt_message *msg, const bt_clock_snapshot **snapshot); #ifdef __cplusplus } #endif -#endif /* BABELTRACE_GRAPH_MESSAGE_INACTIVITY_CONST_H */ +#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_CONST_H */ diff --git a/include/babeltrace/graph/message-inactivity-internal.h b/include/babeltrace/graph/message-message-iterator-inactivity-internal.h similarity index 83% rename from include/babeltrace/graph/message-inactivity-internal.h rename to include/babeltrace/graph/message-message-iterator-inactivity-internal.h index 5ac0f55e..cd41177a 100644 --- a/include/babeltrace/graph/message-inactivity-internal.h +++ b/include/babeltrace/graph/message-message-iterator-inactivity-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H +#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H +#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H /* * Copyright 2017-2018 Philippe Proulx @@ -27,9 +27,9 @@ #include #include -struct bt_message_inactivity { +struct bt_message_message_iterator_inactivity { struct bt_message parent; struct bt_clock_snapshot *default_cs; }; -#endif /* BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H */ +#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H */ diff --git a/include/babeltrace/graph/message-inactivity.h b/include/babeltrace/graph/message-message-iterator-inactivity.h similarity index 85% rename from include/babeltrace/graph/message-inactivity.h rename to include/babeltrace/graph/message-message-iterator-inactivity.h index e7d1c404..8b8f83a1 100644 --- a/include/babeltrace/graph/message-inactivity.h +++ b/include/babeltrace/graph/message-message-iterator-inactivity.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H -#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H +#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H +#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H /* * Copyright 2017-2018 Philippe Proulx @@ -33,7 +33,7 @@ extern "C" { #endif extern -bt_message *bt_message_inactivity_create( +bt_message *bt_message_message_iterator_inactivity_create( bt_self_message_iterator *message_iterator, const bt_clock_class *default_clock_class, uint64_t raw_value); @@ -41,4 +41,4 @@ bt_message *bt_message_inactivity_create( } #endif -#endif /* BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H */ +#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H */ diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index c97ec94d..a7c9ea17 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include #include @@ -1003,9 +1003,9 @@ int get_message_ns_from_origin(const struct bt_message *msg, event_msg); break; } - case BT_MESSAGE_TYPE_INACTIVITY: + case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: { - const struct bt_message_inactivity *inactivity_msg = + const struct bt_message_message_iterator_inactivity *inactivity_msg = (const void *) msg; clk_snapshot = inactivity_msg->default_cs; @@ -1174,7 +1174,7 @@ enum bt_message_iterator_status find_message_ge_ns_from_origin( * Find first message which has a default clock snapshot * that is greater than or equal to the requested value. * - * For event and inactivity messages, compare with the + * For event and message iterator inactivity messages, compare with the * default clock snapshot. * * For packet beginning messages, compare with the diff --git a/lib/graph/message/Makefile.am b/lib/graph/message/Makefile.am index 9e2039b4..9c69099f 100644 --- a/lib/graph/message/Makefile.am +++ b/lib/graph/message/Makefile.am @@ -5,6 +5,6 @@ libgraph_message_la_SOURCES = \ packet.c \ event.c \ stream.c \ - inactivity.c \ + message-iterator-inactivity.c \ stream-activity.c \ discarded-items.c diff --git a/lib/graph/message/inactivity.c b/lib/graph/message/message-iterator-inactivity.c similarity index 67% rename from lib/graph/message/inactivity.c rename to lib/graph/message/message-iterator-inactivity.c index 9cee20e6..26b863f4 100644 --- a/lib/graph/message/inactivity.c +++ b/lib/graph/message/message-iterator-inactivity.c @@ -20,7 +20,7 @@ * SOFTWARE. */ -#define BT_LOG_TAG "MSG-INACTIVITY" +#define BT_LOG_TAG "MSG-MESSAGE-ITERATOR-INACTIVITY" #include #include @@ -29,17 +29,18 @@ #include #include #include -#include -#include -#include +#include +#include +#include static -void bt_message_inactivity_destroy(struct bt_object *obj) +void bt_message_message_iterator_inactivity_destroy(struct bt_object *obj) { - struct bt_message_inactivity *message = - (struct bt_message_inactivity *) obj; + struct bt_message_message_iterator_inactivity *message = + (struct bt_message_message_iterator_inactivity *) obj; - BT_LIB_LOGD("Destroying inactivity message: %!+n", message); + BT_LIB_LOGD("Destroying message iterator inactivity message: %!+n", + message); if (message->default_cs) { bt_clock_snapshot_recycle(message->default_cs); @@ -49,29 +50,30 @@ void bt_message_inactivity_destroy(struct bt_object *obj) g_free(message); } -struct bt_message *bt_message_inactivity_create( +struct bt_message *bt_message_message_iterator_inactivity_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_clock_class *default_clock_class, uint64_t value_cycles) { struct bt_self_component_port_input_message_iterator *msg_iter = (void *) self_msg_iter; - struct bt_message_inactivity *message; + struct bt_message_message_iterator_inactivity *message; struct bt_message *ret_msg = NULL; BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); BT_ASSERT_PRE_NON_NULL(default_clock_class, "Default clock class"); - BT_LIB_LOGD("Creating inactivity message object: " + BT_LIB_LOGD("Creating message iterator inactivity message object: " "%![iter-]+i, %![default-cc-]+K, value=%" PRIu64, msg_iter, default_clock_class, value_cycles); - message = g_new0(struct bt_message_inactivity, 1); + message = g_new0(struct bt_message_message_iterator_inactivity, 1); if (!message) { - BT_LOGE_STR("Failed to allocate one inactivity message."); + BT_LOGE_STR("Failed to allocate one message iterator " + "inactivity message."); goto error; } bt_message_init(&message->parent, - BT_MESSAGE_TYPE_INACTIVITY, - bt_message_inactivity_destroy, NULL); + BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY, + bt_message_message_iterator_inactivity_destroy, NULL); ret_msg = &message->parent; message->default_cs = bt_clock_snapshot_create( (void *) default_clock_class); @@ -80,7 +82,8 @@ struct bt_message *bt_message_inactivity_create( } bt_clock_snapshot_set_raw_value(message->default_cs, value_cycles); - BT_LIB_LOGD("Created inactivity message object: %!+n", ret_msg); + BT_LIB_LOGD("Created message iterator inactivity message object: %!+n", + ret_msg); goto end; error: @@ -91,14 +94,14 @@ end: } extern enum bt_clock_snapshot_state -bt_message_inactivity_borrow_default_clock_snapshot_const( +bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( const bt_message *msg, const bt_clock_snapshot **snapshot) { - struct bt_message_inactivity *inactivity = (void *) msg; + struct bt_message_message_iterator_inactivity *inactivity = (void *) msg; BT_ASSERT_PRE_NON_NULL(msg, "Message"); BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)"); - BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_INACTIVITY); + BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY); *snapshot = inactivity->default_cs; return BT_CLOCK_SNAPSHOT_STATE_KNOWN; } diff --git a/lib/lib-logging.c b/lib/lib-logging.c index 3fd96dd1..4b5557aa 100644 --- a/lib/lib-logging.c +++ b/lib/lib-logging.c @@ -62,7 +62,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/plugins/text/pretty/pretty.c b/plugins/text/pretty/pretty.c index 1b5729ab..63a6c879 100644 --- a/plugins/text/pretty/pretty.c +++ b/plugins/text/pretty/pretty.c @@ -138,8 +138,8 @@ bt_self_component_status handle_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: + fprintf(stderr, "Message iterator inactivity message\n"); break; case BT_MESSAGE_TYPE_DISCARDED_EVENTS: case BT_MESSAGE_TYPE_DISCARDED_PACKETS: diff --git a/plugins/utils/counter/counter.c b/plugins/utils/counter/counter.c index ec0a8dba..dab2d6bc 100644 --- a/plugins/utils/counter/counter.c +++ b/plugins/utils/counter/counter.c @@ -50,7 +50,7 @@ uint64_t get_total_count(struct counter *counter) counter->count.stream_end + counter->count.packet_begin + counter->count.packet_end + - counter->count.inactivity + + counter->count.msg_iter_inactivity + counter->count.other; } @@ -64,7 +64,8 @@ void print_count(struct counter *counter) PRINTF_COUNT("stream end", "stream ends", stream_end); PRINTF_COUNT("packet beginning", "packet beginnings", packet_begin); PRINTF_COUNT("packet end", "packet ends", packet_end); - PRINTF_COUNT("inactivity", "inactivities", inactivity); + PRINTF_COUNT("message iterator inactivity", + "message iterator inactivities", msg_iter_inactivity); if (counter->count.other > 0) { PRINTF_COUNT(" other (unknown) message", @@ -245,8 +246,8 @@ bt_self_component_status counter_consume( case BT_MESSAGE_TYPE_EVENT: counter->count.event++; break; - case BT_MESSAGE_TYPE_INACTIVITY: - counter->count.inactivity++; + case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: + counter->count.msg_iter_inactivity++; break; case BT_MESSAGE_TYPE_STREAM_BEGINNING: counter->count.stream_begin++; diff --git a/plugins/utils/counter/counter.h b/plugins/utils/counter/counter.h index e4cbdde7..2994eb47 100644 --- a/plugins/utils/counter/counter.h +++ b/plugins/utils/counter/counter.h @@ -36,7 +36,7 @@ struct counter { uint64_t stream_end; uint64_t packet_begin; uint64_t packet_end; - uint64_t inactivity; + uint64_t msg_iter_inactivity; uint64_t other; } count; uint64_t last_printed_total; diff --git a/plugins/utils/muxer/muxer.c b/plugins/utils/muxer/muxer.c index aa5cbb23..05c844b0 100644 --- a/plugins/utils/muxer/muxer.c +++ b/plugins/utils/muxer/muxer.c @@ -577,9 +577,9 @@ int get_msg_ts_ns(struct muxer_comp *muxer_comp, } break; - case BT_MESSAGE_TYPE_INACTIVITY: + case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY: cs_state = - bt_message_inactivity_borrow_default_clock_snapshot_const( + bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const( msg, &clock_snapshot); break; default: -- 2.34.1