This is avoid confusion with stream activity message types.
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
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 \
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 \
#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>
*/
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,
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
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:
--- /dev/null
+#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 */
--- /dev/null
+#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 */
--- /dev/null
+#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 */
#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>
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;
* 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
packet.c \
event.c \
stream.c \
- inactivity.c \
+ message-iterator-inactivity.c \
stream-activity.c \
discarded-items.c
+++ /dev/null
-/*
- * 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;
-}
--- /dev/null
+/*
+ * 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;
+}
#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>
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:
counter->count.stream_end +
counter->count.packet_begin +
counter->count.packet_end +
- counter->count.inactivity +
+ counter->count.msg_iter_inactivity +
counter->count.other;
}
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",
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++;
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;
}
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: