lib: rename inactivity msg to msg iterator inactivity msg
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 19 Feb 2019 21:12:16 +0000 (16:12 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
This is avoid confusion with stream activity message types.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
19 files changed:
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/graph/message-const.h
include/babeltrace/graph/message-inactivity-const.h [deleted file]
include/babeltrace/graph/message-inactivity-internal.h [deleted file]
include/babeltrace/graph/message-inactivity.h [deleted file]
include/babeltrace/graph/message-internal.h
include/babeltrace/graph/message-message-iterator-inactivity-const.h [new file with mode: 0644]
include/babeltrace/graph/message-message-iterator-inactivity-internal.h [new file with mode: 0644]
include/babeltrace/graph/message-message-iterator-inactivity.h [new file with mode: 0644]
lib/graph/iterator.c
lib/graph/message/Makefile.am
lib/graph/message/inactivity.c [deleted file]
lib/graph/message/message-iterator-inactivity.c [new file with mode: 0644]
lib/lib-logging.c
plugins/text/pretty/pretty.c
plugins/utils/counter/counter.c
plugins/utils/counter/counter.h
plugins/utils/muxer/muxer.c

index 172188f19f81591f5c33e427e0f7921a8ee55595..9e2030378d4e8aefd6fea57e7b2c6712e322d18e 100644 (file)
@@ -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 \
index 5e1e36ec4d7cba1242c53f7d1edb06369f5a6365..903329b905315b6cc03079e1b467cb0641139584 100644 (file)
 #include <babeltrace/graph/message-discarded-packets.h>
 #include <babeltrace/graph/message-event-const.h>
 #include <babeltrace/graph/message-event.h>
-#include <babeltrace/graph/message-inactivity-const.h>
-#include <babeltrace/graph/message-inactivity.h>
 #include <babeltrace/graph/message-iterator-const.h>
+#include <babeltrace/graph/message-message-iterator-inactivity-const.h>
+#include <babeltrace/graph/message-message-iterator-inactivity.h>
 #include <babeltrace/graph/message-packet-beginning-const.h>
 #include <babeltrace/graph/message-packet-beginning.h>
 #include <babeltrace/graph/message-packet-end-const.h>
index 414124bb9af10c74cc3f750a007e6069b2dd87fd..564fdf53456c11d6a7c7cd30fe89cd980a999e05 100644 (file)
@@ -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-inactivity-const.h b/include/babeltrace/graph/message-inactivity-const.h
deleted file mode 100644 (file)
index b473b84..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_CONST_H
-#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_CONST_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* For bt_message, bt_clock_snapshot */
-#include <babeltrace/types.h>
-
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern bt_clock_snapshot_state
-bt_message_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 */
diff --git a/include/babeltrace/graph/message-inactivity-internal.h b/include/babeltrace/graph/message-inactivity-internal.h
deleted file mode 100644 (file)
index 5ac0f55..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H
-#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <glib.h>
-#include <babeltrace/trace-ir/clock-snapshot-internal.h>
-#include <babeltrace/graph/message-const.h>
-
-struct bt_message_inactivity {
-       struct bt_message parent;
-       struct bt_clock_snapshot *default_cs;
-};
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_INACTIVITY_INTERNAL_H */
diff --git a/include/babeltrace/graph/message-inactivity.h b/include/babeltrace/graph/message-inactivity.h
deleted file mode 100644 (file)
index e7d1c40..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H
-#define BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-
-/* For bt_self_message_iterator, bt_message, bt_clock_class */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern
-bt_message *bt_message_inactivity_create(
-               bt_self_message_iterator *message_iterator,
-               const bt_clock_class *default_clock_class, uint64_t raw_value);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_INACTIVITY_H */
index af68723805127820ee12deed52f5e472e09279c7..bfe561e54d598fa32ffb0957a53543157da7f8e8 100644 (file)
@@ -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-message-iterator-inactivity-const.h b/include/babeltrace/graph/message-message-iterator-inactivity-const.h
new file mode 100644 (file)
index 0000000..02f5b00
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_CONST_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/* For bt_message, bt_clock_snapshot */
+#include <babeltrace/types.h>
+
+/* For bt_clock_snapshot_state */
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_clock_snapshot_state
+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_MESSAGE_ITERATOR_INACTIVITY_CONST_H */
diff --git a/include/babeltrace/graph/message-message-iterator-inactivity-internal.h b/include/babeltrace/graph/message-message-iterator-inactivity-internal.h
new file mode 100644 (file)
index 0000000..cd41177
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H
+#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <glib.h>
+#include <babeltrace/trace-ir/clock-snapshot-internal.h>
+#include <babeltrace/graph/message-const.h>
+
+struct bt_message_message_iterator_inactivity {
+       struct bt_message parent;
+       struct bt_clock_snapshot *default_cs;
+};
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H */
diff --git a/include/babeltrace/graph/message-message-iterator-inactivity.h b/include/babeltrace/graph/message-message-iterator-inactivity.h
new file mode 100644 (file)
index 0000000..8b8f83a
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H
+#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+/* For bt_self_message_iterator, bt_message, bt_clock_class */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern
+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);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H */
index c97ec94d94953ce2247fe3900da9864070b19c13..a7c9ea17ea9ca0cb2017879ee6da1b79391edeaf 100644 (file)
@@ -54,7 +54,7 @@
 #include <babeltrace/graph/message-stream-beginning-const.h>
 #include <babeltrace/graph/message-stream-end-const.h>
 #include <babeltrace/graph/message-stream-internal.h>
-#include <babeltrace/graph/message-inactivity-internal.h>
+#include <babeltrace/graph/message-message-iterator-inactivity-internal.h>
 #include <babeltrace/graph/message-discarded-items-internal.h>
 #include <babeltrace/graph/message-stream-activity-internal.h>
 #include <babeltrace/graph/port-const.h>
@@ -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
index 9e2039b44329838c737b3d0046d8c3a9dde73401..9c69099ff448e18878a5bf7f7ae8bd26e3eb9018 100644 (file)
@@ -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/inactivity.c
deleted file mode 100644 (file)
index 9cee20e..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#define BT_LOG_TAG "MSG-INACTIVITY"
-#include <babeltrace/lib-logging-internal.h>
-
-#include <babeltrace/assert-pre-internal.h>
-#include <babeltrace/object-internal.h>
-#include <babeltrace/compiler-internal.h>
-#include <babeltrace/trace-ir/clock-class.h>
-#include <babeltrace/trace-ir/clock-snapshot-internal.h>
-#include <babeltrace/graph/message-internal.h>
-#include <babeltrace/graph/message-inactivity-const.h>
-#include <babeltrace/graph/message-inactivity.h>
-#include <babeltrace/graph/message-inactivity-internal.h>
-
-static
-void bt_message_inactivity_destroy(struct bt_object *obj)
-{
-       struct bt_message_inactivity *message =
-                       (struct bt_message_inactivity *) obj;
-
-       BT_LIB_LOGD("Destroying inactivity message: %!+n", message);
-
-       if (message->default_cs) {
-               bt_clock_snapshot_recycle(message->default_cs);
-               message->default_cs = NULL;
-       }
-
-       g_free(message);
-}
-
-struct bt_message *bt_message_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 *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: "
-               "%![iter-]+i, %![default-cc-]+K, value=%" PRIu64, msg_iter,
-               default_clock_class, value_cycles);
-       message = g_new0(struct bt_message_inactivity, 1);
-       if (!message) {
-               BT_LOGE_STR("Failed to allocate one inactivity message.");
-               goto error;
-       }
-       bt_message_init(&message->parent,
-               BT_MESSAGE_TYPE_INACTIVITY,
-               bt_message_inactivity_destroy, NULL);
-       ret_msg = &message->parent;
-       message->default_cs = bt_clock_snapshot_create(
-               (void *) default_clock_class);
-       if (!message->default_cs) {
-               goto error;
-       }
-       bt_clock_snapshot_set_raw_value(message->default_cs, value_cycles);
-
-       BT_LIB_LOGD("Created inactivity message object: %!+n", ret_msg);
-       goto end;
-
-error:
-       BT_OBJECT_PUT_REF_AND_RESET(ret_msg);
-
-end:
-       return (void *) ret_msg;
-}
-
-extern enum bt_clock_snapshot_state
-bt_message_inactivity_borrow_default_clock_snapshot_const(
-               const bt_message *msg, const bt_clock_snapshot **snapshot)
-{
-       struct bt_message_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);
-       *snapshot = inactivity->default_cs;
-       return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
-}
diff --git a/lib/graph/message/message-iterator-inactivity.c b/lib/graph/message/message-iterator-inactivity.c
new file mode 100644 (file)
index 0000000..26b863f
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define BT_LOG_TAG "MSG-MESSAGE-ITERATOR-INACTIVITY"
+#include <babeltrace/lib-logging-internal.h>
+
+#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/object-internal.h>
+#include <babeltrace/compiler-internal.h>
+#include <babeltrace/trace-ir/clock-class.h>
+#include <babeltrace/trace-ir/clock-snapshot-internal.h>
+#include <babeltrace/graph/message-internal.h>
+#include <babeltrace/graph/message-message-iterator-inactivity-const.h>
+#include <babeltrace/graph/message-message-iterator-inactivity.h>
+#include <babeltrace/graph/message-message-iterator-inactivity-internal.h>
+
+static
+void bt_message_message_iterator_inactivity_destroy(struct bt_object *obj)
+{
+       struct bt_message_message_iterator_inactivity *message =
+                       (struct bt_message_message_iterator_inactivity *) obj;
+
+       BT_LIB_LOGD("Destroying message iterator inactivity message: %!+n",
+                       message);
+
+       if (message->default_cs) {
+               bt_clock_snapshot_recycle(message->default_cs);
+               message->default_cs = NULL;
+       }
+
+       g_free(message);
+}
+
+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_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 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_message_iterator_inactivity, 1);
+       if (!message) {
+               BT_LOGE_STR("Failed to allocate one message iterator "
+                               "inactivity message.");
+               goto error;
+       }
+       bt_message_init(&message->parent,
+               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);
+       if (!message->default_cs) {
+               goto error;
+       }
+       bt_clock_snapshot_set_raw_value(message->default_cs, value_cycles);
+
+       BT_LIB_LOGD("Created message iterator inactivity message object: %!+n",
+                       ret_msg);
+       goto end;
+
+error:
+       BT_OBJECT_PUT_REF_AND_RESET(ret_msg);
+
+end:
+       return (void *) ret_msg;
+}
+
+extern enum bt_clock_snapshot_state
+bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
+               const bt_message *msg, const bt_clock_snapshot **snapshot)
+{
+       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_MESSAGE_ITERATOR_INACTIVITY);
+       *snapshot = inactivity->default_cs;
+       return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+}
index 3fd96dd1ac401ecc2e55931d67b6bb1d340ef88f..4b5557aa02cc1b7d41d67e0a6b966bf7a0c8bb03 100644 (file)
@@ -62,7 +62,7 @@
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/graph/message-event-internal.h>
-#include <babeltrace/graph/message-inactivity-internal.h>
+#include <babeltrace/graph/message-message-iterator-inactivity-internal.h>
 #include <babeltrace/graph/message-internal.h>
 #include <babeltrace/graph/message-iterator-internal.h>
 #include <babeltrace/graph/message-packet-internal.h>
index 1b5729ab30c71081654ea90f7ce225e7fd44717c..63a6c879ac3b2b19fec94c8e34c7723999a9e048 100644 (file)
@@ -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:
index ec0a8dba8633a83641254f9b555ae6a2930fba65..dab2d6bcfc6878a5580bef190a0d05f490e54018 100644 (file)
@@ -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++;
index e4cbdde7885864d891215c4f433bed9f5c5c8666..2994eb479aa787557c450ee2ff6bdcee6bdc3307 100644 (file)
@@ -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;
index aa5cbb23645c1bef5522e5c2cfc0da25b478962d..05c844b0729109e929a8f4ef30e96f2cf5e801a0 100644 (file)
@@ -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:
This page took 0.0365 seconds and 4 git commands to generate.