babeltrace/graph/message-inactivity-const.h \
babeltrace/graph/message-inactivity.h \
babeltrace/graph/message-iterator-const.h \
- babeltrace/graph/message-packet-const.h \
- babeltrace/graph/message-packet.h \
- babeltrace/graph/message-stream-const.h \
- babeltrace/graph/message-stream.h \
+ babeltrace/graph/message-packet-beginning-const.h \
+ babeltrace/graph/message-packet-beginning.h \
+ babeltrace/graph/message-packet-end-const.h \
+ babeltrace/graph/message-packet-end.h \
+ babeltrace/graph/message-stream-activity-beginning.h \
+ babeltrace/graph/message-stream-activity-const.h \
+ babeltrace/graph/message-stream-activity-end.h \
+ babeltrace/graph/message-stream-beginning-const.h \
+ babeltrace/graph/message-stream-beginning.h \
+ babeltrace/graph/message-stream-end-const.h \
+ babeltrace/graph/message-stream-end.h \
babeltrace/graph/port-const.h \
babeltrace/graph/port-input-const.h \
babeltrace/graph/port-output-const.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-packet-const.h>
-#include <babeltrace/graph/message-packet.h>
-#include <babeltrace/graph/message-stream-const.h>
-#include <babeltrace/graph/message-stream.h>
+#include <babeltrace/graph/message-packet-beginning-const.h>
+#include <babeltrace/graph/message-packet-beginning.h>
+#include <babeltrace/graph/message-packet-end-const.h>
+#include <babeltrace/graph/message-packet-end.h>
+#include <babeltrace/graph/message-stream-activity-beginning.h>
+#include <babeltrace/graph/message-stream-activity-end.h>
+#include <babeltrace/graph/message-stream-beginning-const.h>
+#include <babeltrace/graph/message-stream-beginning.h>
+#include <babeltrace/graph/message-stream-end-const.h>
+#include <babeltrace/graph/message-stream-end.h>
#include <babeltrace/graph/port-const.h>
#include <babeltrace/graph/port-input-const.h>
#include <babeltrace/graph/port-output-const.h>
* Message types. Unhandled message types should be ignored.
*/
typedef enum bt_message_type {
- BT_MESSAGE_TYPE_EVENT = 0,
- BT_MESSAGE_TYPE_INACTIVITY = 1,
- BT_MESSAGE_TYPE_STREAM_BEGINNING = 2,
- BT_MESSAGE_TYPE_STREAM_END = 3,
- BT_MESSAGE_TYPE_PACKET_BEGINNING = 4,
- BT_MESSAGE_TYPE_PACKET_END = 5,
+ BT_MESSAGE_TYPE_EVENT = 0,
+ BT_MESSAGE_TYPE_INACTIVITY = 1,
+ BT_MESSAGE_TYPE_STREAM_BEGINNING = 2,
+ BT_MESSAGE_TYPE_STREAM_END = 3,
+ BT_MESSAGE_TYPE_PACKET_BEGINNING = 4,
+ BT_MESSAGE_TYPE_PACKET_END = 5,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING = 6,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_END = 7,
} bt_message_type;
/**
return "BT_MESSAGE_TYPE_PACKET_BEGINNING";
case BT_MESSAGE_TYPE_PACKET_END:
return "BT_MESSAGE_TYPE_PACKET_END";
+ case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING:
+ return "BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING";
+ case BT_MESSAGE_TYPE_STREAM_ACTIVITY_END:
+ return "BT_MESSAGE_TYPE_STREAM_ACTIVITY_END";
default:
return "(unknown)";
}
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_CONST_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_packet */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_H
+#define BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_packet */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern
+bt_message *bt_message_packet_beginning_create(
+ bt_self_message_iterator *message_iterator,
+ bt_packet *packet);
+
+extern bt_packet *bt_message_packet_beginning_borrow_packet(
+ bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_BEGINNING_H */
+++ /dev/null
-#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_CONST_H
-#define BABELTRACE_GRAPH_MESSAGE_PACKET_CONST_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_packet */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
- const bt_message *message);
-
-extern const bt_packet *bt_message_packet_end_borrow_packet_const(
- const bt_message *message);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_END_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_PACKET_END_CONST_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_packet */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const bt_packet *bt_message_packet_end_borrow_packet_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_END_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_END_H
+#define BABELTRACE_GRAPH_MESSAGE_PACKET_END_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_packet */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern
+bt_message *bt_message_packet_end_create(
+ bt_self_message_iterator *message_iterator,
+ bt_packet *packet);
+
+extern bt_packet *bt_message_packet_end_borrow_packet(
+ bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_END_H */
#include <babeltrace/graph/message-internal.h>
#include <babeltrace/assert-internal.h>
-struct bt_message_packet_beginning {
+struct bt_message_packet {
struct bt_message parent;
struct bt_packet *packet;
};
-struct bt_message_packet_end {
- struct bt_message parent;
- struct bt_packet *packet;
-};
+BT_HIDDEN
+void bt_message_packet_destroy(struct bt_message *msg);
BT_HIDDEN
struct bt_message *bt_message_packet_beginning_new(
BT_HIDDEN
void bt_message_packet_beginning_recycle(struct bt_message *msg);
-BT_HIDDEN
-void bt_message_packet_beginning_destroy(struct bt_message *msg);
-
BT_HIDDEN
struct bt_message *bt_message_packet_end_new(struct bt_graph *graph);
BT_HIDDEN
void bt_message_packet_end_recycle(struct bt_message *msg);
-BT_HIDDEN
-void bt_message_packet_end_destroy(struct bt_message *msg);
-
#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_H
-#define BABELTRACE_GRAPH_MESSAGE_PACKET_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_packet */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern
-bt_message *bt_message_packet_beginning_create(
- bt_self_message_iterator *message_iterator,
- bt_packet *packet);
-
-extern
-bt_message *bt_message_packet_end_create(
- bt_self_message_iterator *message_iterator,
- bt_packet *packet);
-
-extern bt_packet *bt_message_packet_beginning_borrow_packet(
- bt_message *message);
-
-extern bt_packet *bt_message_packet_end_borrow_packet(
- bt_message *message);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_CONST_H
+
+/*
+ * Copyright 2019 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, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_message_stream_activity_clock_snapshot_state */
+#include <babeltrace/graph/message-stream-activity-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_message_stream_activity_clock_snapshot_state
+bt_message_stream_activity_beginning_borrow_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot);
+
+extern const bt_stream *
+bt_message_stream_activity_beginning_borrow_stream_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_H
+
+/*
+ * Copyright 2019 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_self_message_iterator, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_message_stream_activity_clock_snapshot_state */
+#include <babeltrace/graph/message-stream-activity-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_message *bt_message_stream_activity_beginning_create(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream);
+
+extern bt_stream *bt_message_stream_activity_beginning_borrow_stream(
+ bt_message *message);
+
+extern void bt_message_stream_activity_beginning_set_default_clock_snapshot_state(
+ bt_message *msg,
+ bt_message_stream_activity_clock_snapshot_state state);
+
+extern void bt_message_stream_activity_beginning_set_default_clock_snapshot(
+ bt_message *msg, uint64_t raw_value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_BEGINNING_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_CONST_H
+
+/*
+ * Copyright 2019 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum bt_message_stream_activity_clock_snapshot_state {
+ BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN,
+ BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN,
+ BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE,
+} bt_message_stream_activity_clock_snapshot_state;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_CONST_H
+
+/*
+ * Copyright 2019 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, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_message_stream_activity_clock_snapshot_state */
+#include <babeltrace/graph/message-stream-activity-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_message_stream_activity_clock_snapshot_state
+bt_message_stream_activity_end_borrow_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot);
+
+extern const bt_stream *
+bt_message_stream_activity_end_borrow_stream_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_H
+
+/*
+ * Copyright 2019 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_self_message_iterator, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_message_stream_activity_clock_snapshot_state */
+#include <babeltrace/graph/message-stream-activity-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_message *bt_message_stream_activity_end_create(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream);
+
+extern void bt_message_stream_activity_end_set_default_clock_snapshot_state(
+ bt_message *msg,
+ bt_message_stream_activity_clock_snapshot_state state);
+
+extern void bt_message_stream_activity_end_set_default_clock_snapshot(
+ bt_message *msg, uint64_t raw_value);
+
+extern bt_stream *bt_message_stream_activity_end_borrow_stream(
+ bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_END_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_INTERNAL_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_INTERNAL_H
+
+/*
+ * Copyright 2019 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/trace-ir/stream-internal.h>
+#include <babeltrace/graph/message-const.h>
+#include <babeltrace/graph/message-stream-activity-const.h>
+
+struct bt_message_stream_activity {
+ struct bt_message parent;
+ struct bt_stream *stream;
+ struct bt_clock_snapshot *default_cs;
+ enum bt_message_stream_activity_clock_snapshot_state default_cs_state;
+};
+
+static inline
+const char *bt_message_stream_activity_clock_snapshot_state_string(
+ enum bt_message_stream_activity_clock_snapshot_state state)
+{
+ switch (state) {
+ case BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN:
+ return "BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN";
+ case BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN:
+ return "BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN";
+ case BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE:
+ return "BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE";
+ default:
+ return "(unknown)";
+ }
+}
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_ACTIVITY_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_CONST_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_clock_snapshot_state */
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const bt_stream *bt_message_stream_beginning_borrow_stream_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_stream */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern
+bt_message *bt_message_stream_beginning_create(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream);
+
+extern bt_stream *bt_message_stream_beginning_borrow_stream(
+ bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_H */
+++ /dev/null
-#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_CONST_H
-#define BABELTRACE_GRAPH_MESSAGE_STREAM_CONST_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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, bt_stream */
-#include <babeltrace/types.h>
-
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern const bt_stream *bt_message_stream_beginning_borrow_stream_const(
- const bt_message *message);
-
-extern const bt_stream *bt_message_stream_end_borrow_stream_const(
- const bt_message *message);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_END_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_END_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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, bt_stream */
+#include <babeltrace/types.h>
+
+/* For bt_clock_snapshot_state */
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const bt_stream *bt_message_stream_end_borrow_stream_const(
+ const bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_BEGINNING_END_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_END_H
+#define BABELTRACE_GRAPH_MESSAGE_STREAM_END_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_stream */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern
+bt_message *bt_message_stream_end_create(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream);
+
+extern bt_stream *bt_message_stream_end_borrow_stream(
+ bt_message *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_END_H */
*/
#include <babeltrace/compiler-internal.h>
-#include <babeltrace/trace-ir/packet.h>
+#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/graph/message-internal.h>
#include <babeltrace/trace-ir/clock-snapshot-internal.h>
#include <babeltrace/assert-internal.h>
-struct bt_message_stream_beginning {
- struct bt_message parent;
- struct bt_stream *stream;
-};
-
-struct bt_message_stream_end {
+struct bt_message_stream {
struct bt_message parent;
struct bt_stream *stream;
};
+++ /dev/null
-#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_H
-#define BABELTRACE_GRAPH_MESSAGE_STREAM_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@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_self_message_iterator, bt_stream */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern
-bt_message *bt_message_stream_beginning_create(
- bt_self_message_iterator *message_iterator,
- bt_stream *stream);
-
-extern
-bt_message *bt_message_stream_end_create(
- bt_self_message_iterator *message_iterator,
- bt_stream *stream);
-
-extern bt_stream *bt_message_stream_beginning_borrow_stream(
- bt_message *message);
-
-extern bt_stream *bt_message_stream_end_borrow_stream(
- bt_message *message);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_H */
void destroy_message_packet_begin(struct bt_message *msg,
struct bt_graph *graph)
{
- bt_message_packet_beginning_destroy(msg);
+ bt_message_packet_destroy(msg);
}
static
void destroy_message_packet_end(struct bt_message *msg,
struct bt_graph *graph)
{
- bt_message_packet_end_destroy(msg);
+ bt_message_packet_destroy(msg);
}
static
#include <babeltrace/graph/message-internal.h>
#include <babeltrace/graph/message-event-const.h>
#include <babeltrace/graph/message-event-internal.h>
-#include <babeltrace/graph/message-packet-const.h>
+#include <babeltrace/graph/message-packet-beginning-const.h>
+#include <babeltrace/graph/message-packet-end-const.h>
#include <babeltrace/graph/message-packet-internal.h>
-#include <babeltrace/graph/message-stream-const.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/port-const.h>
goto end;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
{
- const struct bt_message_packet_beginning *pkt_msg =
+ const struct bt_message_packet *pkt_msg =
(const void *) msg;
clk_snapshot = pkt_msg->packet->default_beginning_cs;
}
case BT_MESSAGE_TYPE_PACKET_END:
{
- const struct bt_message_packet_end *pkt_msg =
+ const struct bt_message_packet *pkt_msg =
(const void *) msg;
clk_snapshot = pkt_msg->packet->default_end_cs;
packet.c \
event.c \
stream.c \
- inactivity.c
+ inactivity.c \
+ stream-activity.c
bt_object_release_func release,
struct bt_graph *graph)
{
- BT_ASSERT(type >= 0 && type <= BT_MESSAGE_TYPE_PACKET_END);
+ BT_ASSERT(type >= 0 && type <= BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
message->type = type;
bt_object_init_shared(&message->base, release);
message->graph = graph;
#include <babeltrace/trace-ir/stream.h>
#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/message-packet-const.h>
-#include <babeltrace/graph/message-packet.h>
+#include <babeltrace/graph/message-packet-beginning-const.h>
+#include <babeltrace/graph/message-packet-end-const.h>
+#include <babeltrace/graph/message-packet-beginning.h>
+#include <babeltrace/graph/message-packet-end.h>
#include <babeltrace/graph/message-packet-internal.h>
#include <babeltrace/assert-internal.h>
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/object-internal.h>
#include <inttypes.h>
-BT_HIDDEN
-struct bt_message *bt_message_packet_beginning_new(struct bt_graph *graph)
+static inline
+struct bt_message *new_packet_message(struct bt_graph *graph,
+ enum bt_message_type type, bt_object_release_func recycle_func)
{
- struct bt_message_packet_beginning *message;
+ struct bt_message_packet *message;
- message = g_new0(struct bt_message_packet_beginning, 1);
+ message = g_new0(struct bt_message_packet, 1);
if (!message) {
- BT_LOGE_STR("Failed to allocate one packet beginning message.");
+ BT_LOGE_STR("Failed to allocate one packet message.");
goto error;
}
- bt_message_init(&message->parent,
- BT_MESSAGE_TYPE_PACKET_BEGINNING,
- (bt_object_release_func) bt_message_packet_beginning_recycle,
- graph);
+ bt_message_init(&message->parent, type, recycle_func, graph);
goto end;
error:
return (void *) message;
}
-struct bt_message *bt_message_packet_beginning_create(
- struct bt_self_message_iterator *self_msg_iter,
- struct bt_packet *packet)
+BT_HIDDEN
+struct bt_message *bt_message_packet_beginning_new(struct bt_graph *graph)
{
- struct bt_self_component_port_input_message_iterator *msg_iter =
- (void *) self_msg_iter;
- struct bt_message_packet_beginning *message = NULL;
+ return new_packet_message(graph, BT_MESSAGE_TYPE_PACKET_BEGINNING,
+ (bt_object_release_func) bt_message_packet_beginning_recycle);
+}
+
+BT_HIDDEN
+struct bt_message *bt_message_packet_end_new(struct bt_graph *graph)
+{
+ return new_packet_message(graph, BT_MESSAGE_TYPE_PACKET_END,
+ (bt_object_release_func) bt_message_packet_end_recycle);
+}
+
+static inline
+struct bt_message *bt_message_packet_create(
+ struct bt_self_component_port_input_message_iterator *msg_iter,
+ struct bt_packet *packet, struct bt_object_pool *pool)
+{
+ struct bt_message_packet *message = NULL;
struct bt_stream *stream;
struct bt_stream_class *stream_class;
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ BT_ASSERT(msg_iter);
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
stream = bt_packet_borrow_stream(packet);
BT_ASSERT(stream);
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
- BT_LIB_LOGD("Creating packet beginning message object: "
+ BT_LIB_LOGD("Creating packet message object: "
"%![packet-]+a, %![stream-]+s, %![sc-]+S",
packet, stream, stream_class);
- message = (void *) bt_message_create_from_pool(
- &msg_iter->graph->packet_begin_msg_pool, msg_iter->graph);
+ message = (void *) bt_message_create_from_pool(pool, msg_iter->graph);
if (!message) {
/* bt_message_create_from_pool() logs errors */
goto end;
bt_object_get_no_null_check_no_parent_check(
&message->packet->base);
bt_packet_set_is_frozen(packet, true);
- BT_LIB_LOGD("Created packet beginning message object: "
+ BT_LIB_LOGD("Created packet message object: "
"%![msg-]+n, %![packet-]+a, %![stream-]+s, %![sc-]+S",
message, packet, stream, stream_class);
goto end;
return (void *) message;
}
-BT_HIDDEN
-void bt_message_packet_beginning_destroy(struct bt_message *msg)
+struct bt_message *bt_message_packet_beginning_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_packet *packet)
{
- struct bt_message_packet_beginning *packet_begin_msg = (void *) msg;
+ struct bt_self_component_port_input_message_iterator *msg_iter =
+ (void *) self_msg_iter;
- BT_LIB_LOGD("Destroying packet beginning message: %!+n", msg);
- BT_LIB_LOGD("Putting packet: %!+a", packet_begin_msg->packet);
- BT_OBJECT_PUT_REF_AND_RESET(packet_begin_msg->packet);
- g_free(msg);
+ BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ return bt_message_packet_create(msg_iter, packet,
+ &msg_iter->graph->packet_begin_msg_pool);
}
-BT_HIDDEN
-void bt_message_packet_beginning_recycle(struct bt_message *msg)
+struct bt_message *bt_message_packet_end_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_packet *packet)
{
- struct bt_message_packet_beginning *packet_begin_msg = (void *) msg;
- struct bt_graph *graph;
-
- BT_ASSERT(packet_begin_msg);
-
- if (unlikely(!msg->graph)) {
- bt_message_packet_beginning_destroy(msg);
- return;
- }
+ struct bt_self_component_port_input_message_iterator *msg_iter =
+ (void *) self_msg_iter;
- BT_LIB_LOGD("Recycling packet beginning message: %!+n", msg);
- bt_message_reset(msg);
- bt_object_put_no_null_check(&packet_begin_msg->packet->base);
- packet_begin_msg->packet = NULL;
- graph = msg->graph;
- msg->graph = NULL;
- bt_object_pool_recycle_object(&graph->packet_begin_msg_pool, msg);
+ BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ return bt_message_packet_create(msg_iter, packet,
+ &msg_iter->graph->packet_end_msg_pool);
}
-struct bt_packet *bt_message_packet_beginning_borrow_packet(
- struct bt_message *message)
+BT_HIDDEN
+void bt_message_packet_destroy(struct bt_message *msg)
{
- struct bt_message_packet_beginning *packet_begin;
+ struct bt_message_packet *packet_msg = (void *) msg;
- BT_ASSERT_PRE_NON_NULL(message, "Message");
- BT_ASSERT_PRE_MSG_IS_TYPE(message,
- BT_MESSAGE_TYPE_PACKET_BEGINNING);
- packet_begin = (void *) message;
- return packet_begin->packet;
+ BT_LIB_LOGD("Destroying packet message: %!+n", msg);
+ BT_LIB_LOGD("Putting packet: %!+a", packet_msg->packet);
+ BT_OBJECT_PUT_REF_AND_RESET(packet_msg->packet);
+ g_free(msg);
}
-const struct bt_packet *bt_message_packet_beginning_borrow_packet_const(
- const struct bt_message *message)
+static inline
+void recycle_packet_message(struct bt_message *msg, struct bt_object_pool *pool)
{
- return bt_message_packet_beginning_borrow_packet(
- (void *) message);
+ struct bt_message_packet *packet_msg = (void *) msg;
+
+ BT_LIB_LOGD("Recycling packet message: %!+n", msg);
+ bt_message_reset(msg);
+ bt_object_put_no_null_check(&packet_msg->packet->base);
+ packet_msg->packet = NULL;
+ msg->graph = NULL;
+ bt_object_pool_recycle_object(pool, msg);
}
BT_HIDDEN
-struct bt_message *bt_message_packet_end_new(struct bt_graph *graph)
+void bt_message_packet_beginning_recycle(struct bt_message *msg)
{
- struct bt_message_packet_end *message;
+ BT_ASSERT(msg);
- message = g_new0(struct bt_message_packet_end, 1);
- if (!message) {
- BT_LOGE_STR("Failed to allocate one packet end message.");
- goto error;
+ if (unlikely(!msg->graph)) {
+ bt_message_packet_destroy(msg);
+ return;
}
- bt_message_init(&message->parent,
- BT_MESSAGE_TYPE_PACKET_END,
- (bt_object_release_func) bt_message_packet_end_recycle,
- graph);
- goto end;
-
-error:
- BT_OBJECT_PUT_REF_AND_RESET(message);
-
-end:
- return (void *) message;
+ recycle_packet_message(msg, &msg->graph->packet_begin_msg_pool);
}
-struct bt_message *bt_message_packet_end_create(
- struct bt_self_message_iterator *self_msg_iter,
- struct bt_packet *packet)
+BT_HIDDEN
+void bt_message_packet_end_recycle(struct bt_message *msg)
{
- struct bt_self_component_port_input_message_iterator *msg_iter =
- (void *) self_msg_iter;
- struct bt_message_packet_end *message = NULL;
- struct bt_stream *stream;
- struct bt_stream_class *stream_class;
+ BT_ASSERT(msg);
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(packet, "Packet");
- stream = bt_packet_borrow_stream(packet);
- BT_ASSERT(stream);
- stream_class = bt_stream_borrow_class(stream);
- BT_ASSERT(stream_class);
- BT_LIB_LOGD("Creating packet end message object: "
- "%![packet-]+a, %![stream-]+s, %![sc-]+S",
- packet, stream, stream_class);
- message = (void *) bt_message_create_from_pool(
- &msg_iter->graph->packet_end_msg_pool, msg_iter->graph);
- if (!message) {
- /* bt_message_create_from_pool() logs errors */
- goto end;
+ if (unlikely(!msg->graph)) {
+ bt_message_packet_destroy(msg);
+ return;
}
- BT_ASSERT(!message->packet);
- message->packet = packet;
- bt_object_get_no_null_check_no_parent_check(
- &message->packet->base);
- bt_packet_set_is_frozen(packet, true);
- BT_LIB_LOGD("Created packet end message object: "
- "%![msg-]+n, %![packet-]+a, %![stream-]+s, %![sc-]+S",
- message, packet, stream, stream_class);
- goto end;
-
-end:
- return (void *) message;
+ recycle_packet_message(msg, &msg->graph->packet_end_msg_pool);
}
-BT_HIDDEN
-void bt_message_packet_end_destroy(struct bt_message *msg)
+struct bt_packet *bt_message_packet_beginning_borrow_packet(
+ struct bt_message *message)
{
- struct bt_message_packet_end *packet_end_msg = (void *) msg;
+ struct bt_message_packet *packet_msg = (void *) message;
- BT_LIB_LOGD("Destroying packet end message: %!+n", msg);
- BT_LIB_LOGD("Putting packet: %!+a", packet_end_msg->packet);
- BT_OBJECT_PUT_REF_AND_RESET(packet_end_msg->packet);
- g_free(msg);
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message,
+ BT_MESSAGE_TYPE_PACKET_BEGINNING);
+ return packet_msg->packet;
}
-BT_HIDDEN
-void bt_message_packet_end_recycle(struct bt_message *msg)
+const struct bt_packet *bt_message_packet_beginning_borrow_packet_const(
+ const struct bt_message *message)
{
- struct bt_message_packet_end *packet_end_msg = (void *) msg;
- struct bt_graph *graph;
-
- BT_ASSERT(packet_end_msg);
-
- if (!msg->graph) {
- bt_message_packet_end_destroy(msg);
- return;
- }
-
- BT_LIB_LOGD("Recycling packet end message: %!+n", msg);
- bt_message_reset(msg);
- BT_OBJECT_PUT_REF_AND_RESET(packet_end_msg->packet);
- graph = msg->graph;
- msg->graph = NULL;
- bt_object_pool_recycle_object(&graph->packet_end_msg_pool, msg);
+ return bt_message_packet_beginning_borrow_packet(
+ (void *) message);
}
struct bt_packet *bt_message_packet_end_borrow_packet(
struct bt_message *message)
{
- struct bt_message_packet_end *packet_end;
+ struct bt_message_packet *packet_msg = (void *) message;
BT_ASSERT_PRE_NON_NULL(message, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(message,
BT_MESSAGE_TYPE_PACKET_END);
- packet_end = (void *) message;
- return packet_end->packet;
+ return packet_msg->packet;
}
const struct bt_packet *bt_message_packet_end_borrow_packet_const(
--- /dev/null
+/*
+ * Copyright 2019 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-STREAM-ACTIVITY"
+#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/trace-ir/stream-class-internal.h>
+#include <babeltrace/trace-ir/stream-internal.h>
+#include <babeltrace/graph/message-internal.h>
+#include <babeltrace/graph/message-stream-activity-beginning-const.h>
+#include <babeltrace/graph/message-stream-activity-end-const.h>
+#include <babeltrace/graph/message-stream-activity-beginning.h>
+#include <babeltrace/graph/message-stream-activity-end.h>
+#include <babeltrace/graph/message-stream-activity-internal.h>
+
+static
+void destroy_stream_activity_message(struct bt_object *obj)
+{
+ struct bt_message_stream_activity *message = (void *) obj;
+
+ BT_LIB_LOGD("Destroying stream activity message: %!+n", message);
+ BT_LIB_LOGD("Putting stream: %!+s", message->stream);
+ BT_OBJECT_PUT_REF_AND_RESET(message->stream);
+
+ if (message->default_cs) {
+ bt_clock_snapshot_recycle(message->default_cs);
+ }
+
+ g_free(message);
+}
+
+static inline
+struct bt_message *create_stream_activity_message(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_stream *stream, enum bt_message_type type)
+{
+ struct bt_message_stream_activity *message;
+ struct bt_stream_class *stream_class;
+
+ BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
+ BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ stream_class = bt_stream_borrow_class(stream);
+ BT_ASSERT(stream_class);
+ BT_LIB_LOGD("Creating stream activity message object: "
+ "type=%s, %![stream-]+s, %![sc-]+S",
+ bt_message_type_string(type), stream, stream_class);
+ message = g_new0(struct bt_message_stream_activity, 1);
+ if (!message) {
+ BT_LOGE_STR("Failed to allocate one stream activity message.");
+ goto error;
+ }
+
+ bt_message_init(&message->parent, type,
+ destroy_stream_activity_message, NULL);
+ message->stream = stream;
+ bt_object_get_no_null_check(message->stream);
+
+ if (stream_class->default_clock_class) {
+ message->default_cs = bt_clock_snapshot_create(
+ stream_class->default_clock_class);
+ if (!message->default_cs) {
+ goto error;
+ }
+ }
+
+ message->default_cs_state =
+ BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN;
+ BT_LIB_LOGD("Created stream activity message object: "
+ "%![msg-]+n, %![stream-]+s, %![sc-]+S", message,
+ stream, stream_class);
+
+ return (void *) &message->parent;
+
+error:
+ return NULL;
+}
+
+struct bt_message *bt_message_stream_activity_beginning_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_stream *stream)
+{
+ return create_stream_activity_message(self_msg_iter, stream,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING);
+}
+
+struct bt_message *bt_message_stream_activity_end_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_stream *stream)
+{
+ return create_stream_activity_message(self_msg_iter, stream,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
+}
+
+static inline
+struct bt_stream *borrow_stream_activity_message_stream(
+ struct bt_message *message)
+{
+ struct bt_message_stream_activity *stream_act_msg = (void *) message;
+
+ BT_ASSERT(message);
+ return stream_act_msg->stream;
+}
+
+struct bt_stream *bt_message_stream_activity_beginning_borrow_stream(
+ struct bt_message *message)
+{
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING);
+ return borrow_stream_activity_message_stream(message);
+}
+
+struct bt_stream *bt_message_stream_activity_end_borrow_stream(
+ struct bt_message *message)
+{
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
+ return borrow_stream_activity_message_stream(message);
+}
+
+const struct bt_stream *bt_message_stream_activity_beginning_borrow_stream_const(
+ const struct bt_message *message)
+{
+ return bt_message_stream_activity_beginning_borrow_stream(
+ (void *) message);
+}
+
+const struct bt_stream *bt_message_stream_activity_end_borrow_stream_const(
+ const struct bt_message *message)
+{
+ return bt_message_stream_activity_end_borrow_stream((void *) message);
+}
+
+static inline
+void set_stream_activity_message_default_clock_snapshot(
+ struct bt_message *msg, uint64_t value_cycles)
+{
+ struct bt_message_stream_activity *stream_act_msg = (void *) msg;
+ struct bt_stream_class *sc;
+
+ BT_ASSERT(msg);
+ BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
+ sc = stream_act_msg->stream->class;
+ BT_ASSERT(sc);
+ BT_ASSERT_PRE(sc->default_clock_class,
+ "Message's stream's class has no default clock class: "
+ "%![msg-]+n, %![sc-]+S", msg, sc);
+ bt_clock_snapshot_set_raw_value(stream_act_msg->default_cs,
+ value_cycles);
+ stream_act_msg->default_cs_state =
+ BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN;
+ BT_LIB_LOGV("Set stream activity message's default clock snapshot: "
+ "%![msg-]+n, value=%" PRIu64, msg, value_cycles);
+}
+
+void bt_message_stream_activity_beginning_set_default_clock_snapshot(
+ struct bt_message *msg, uint64_t raw_value)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING);
+ set_stream_activity_message_default_clock_snapshot(msg, raw_value);
+}
+
+void bt_message_stream_activity_end_set_default_clock_snapshot(
+ struct bt_message *msg, uint64_t raw_value)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
+ set_stream_activity_message_default_clock_snapshot(msg, raw_value);
+}
+
+static inline
+enum bt_message_stream_activity_clock_snapshot_state
+borrow_stream_activity_message_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot)
+{
+ const struct bt_message_stream_activity *stream_act_msg =
+ (const void *) msg;
+
+ BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
+ *snapshot = stream_act_msg->default_cs;
+ return stream_act_msg->default_cs_state;
+}
+
+enum bt_message_stream_activity_clock_snapshot_state
+bt_message_stream_activity_beginning_borrow_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING);
+ return borrow_stream_activity_message_default_clock_snapshot_const(msg,
+ snapshot);
+}
+
+enum bt_message_stream_activity_clock_snapshot_state
+bt_message_stream_activity_end_borrow_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
+ return borrow_stream_activity_message_default_clock_snapshot_const(msg,
+ snapshot);
+}
+
+static inline
+void set_stream_activity_message_default_clock_snapshot_state(
+ struct bt_message *msg,
+ enum bt_message_stream_activity_clock_snapshot_state state)
+{
+ struct bt_message_stream_activity *stream_act_msg = (void *) msg;
+
+ BT_ASSERT(msg);
+ BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
+ BT_ASSERT_PRE(state != BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN,
+ "Invalid clock snapshot state: %![msg-]+n, state=%s",
+ msg,
+ bt_message_stream_activity_clock_snapshot_state_string(state));
+ stream_act_msg->default_cs_state = state;
+ BT_LIB_LOGV("Set stream activity message's default clock snapshot state: "
+ "%![msg-]+n, state=%s", msg,
+ bt_message_stream_activity_clock_snapshot_state_string(state));
+}
+
+void bt_message_stream_activity_beginning_set_default_clock_snapshot_state(
+ struct bt_message *msg,
+ enum bt_message_stream_activity_clock_snapshot_state state)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING);
+ set_stream_activity_message_default_clock_snapshot_state(msg, state);
+}
+
+void bt_message_stream_activity_end_set_default_clock_snapshot_state(
+ struct bt_message *msg,
+ enum bt_message_stream_activity_clock_snapshot_state state)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+ BT_MESSAGE_TYPE_STREAM_ACTIVITY_END);
+ set_stream_activity_message_default_clock_snapshot_state(msg, state);
+}
#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/trace-ir/stream-class.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
-#include <babeltrace/graph/message-stream.h>
-#include <babeltrace/graph/message-stream-const.h>
+#include <babeltrace/graph/message-stream-beginning.h>
+#include <babeltrace/graph/message-stream-end.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/assert-internal.h>
#include <inttypes.h>
static
-void bt_message_stream_end_destroy(struct bt_object *obj)
+void destroy_stream_message(struct bt_object *obj)
{
- struct bt_message_stream_end *message =
- (struct bt_message_stream_end *) obj;
+ struct bt_message_stream *message = (void *) obj;
- BT_LIB_LOGD("Destroying stream end message: %!+n",
- message);
+ BT_LIB_LOGD("Destroying stream message: %!+n", message);
BT_LIB_LOGD("Putting stream: %!+s", message->stream);
BT_OBJECT_PUT_REF_AND_RESET(message->stream);
g_free(message);
}
-struct bt_message *bt_message_stream_end_create(
+static inline
+struct bt_message *create_stream_message(
struct bt_self_message_iterator *self_msg_iter,
- struct bt_stream *stream)
+ struct bt_stream *stream, enum bt_message_type type)
{
- struct bt_message_stream_end *message;
+ struct bt_message_stream *message;
struct bt_stream_class *stream_class;
BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
- BT_LIB_LOGD("Creating stream end message object: "
- "%![stream-]+s, %![sc-]+S", stream, stream_class);
- message = g_new0(struct bt_message_stream_end, 1);
+ BT_LIB_LOGD("Creating stream message object: "
+ "type=%s, %![stream-]+s, %![sc-]+S",
+ bt_message_type_string(type), stream, stream_class);
+ message = g_new0(struct bt_message_stream, 1);
if (!message) {
- BT_LOGE_STR("Failed to allocate one stream end message.");
+ BT_LOGE_STR("Failed to allocate one stream message.");
goto error;
}
- bt_message_init(&message->parent,
- BT_MESSAGE_TYPE_STREAM_END,
- bt_message_stream_end_destroy, NULL);
+ bt_message_init(&message->parent, type,
+ destroy_stream_message, NULL);
message->stream = stream;
bt_object_get_no_null_check(message->stream);
- BT_LIB_LOGD("Created stream end message object: "
+ BT_LIB_LOGD("Created stream message object: "
"%![msg-]+n, %![stream-]+s, %![sc-]+S", message,
stream, stream_class);
return (void *) &message->parent;
+
error:
return NULL;
}
-struct bt_stream *bt_message_stream_end_borrow_stream(
- struct bt_message *message)
+struct bt_message *bt_message_stream_beginning_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_stream *stream)
{
- struct bt_message_stream_end *stream_end;
-
- BT_ASSERT_PRE_NON_NULL(message, "Message");
- BT_ASSERT_PRE_MSG_IS_TYPE(message,
- BT_MESSAGE_TYPE_STREAM_END);
- stream_end = (void *) message;
- return stream_end->stream;
+ return create_stream_message(self_msg_iter, stream,
+ BT_MESSAGE_TYPE_STREAM_BEGINNING);
}
-const struct bt_stream *bt_message_stream_end_borrow_stream_const(
- const struct bt_message *message)
+struct bt_message *bt_message_stream_end_create(
+ struct bt_self_message_iterator *self_msg_iter,
+ struct bt_stream *stream)
{
- return bt_message_stream_end_borrow_stream(
- (void *) message);
+ return create_stream_message(self_msg_iter, stream,
+ BT_MESSAGE_TYPE_STREAM_END);
}
-static
-void bt_message_stream_beginning_destroy(struct bt_object *obj)
+static inline
+struct bt_stream *borrow_stream_message_stream(struct bt_message *message)
{
- struct bt_message_stream_beginning *message =
- (struct bt_message_stream_beginning *) obj;
+ struct bt_message_stream *stream_msg;
- BT_LIB_LOGD("Destroying stream beginning message: %!+n",
- message);
- BT_LIB_LOGD("Putting stream: %!+s", message->stream);
- BT_OBJECT_PUT_REF_AND_RESET(message->stream);
- g_free(message);
+ BT_ASSERT(message);
+ stream_msg = (void *) message;
+ return stream_msg->stream;
}
-struct bt_message *bt_message_stream_beginning_create(
- struct bt_self_message_iterator *self_msg_iter,
- struct bt_stream *stream)
+struct bt_stream *bt_message_stream_beginning_borrow_stream(
+ struct bt_message *message)
{
- struct bt_message_stream_beginning *message;
- struct bt_stream_class *stream_class;
-
- BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
- stream_class = bt_stream_borrow_class(stream);
- BT_ASSERT(stream_class);
- BT_LIB_LOGD("Creating stream beginning message object: "
- "%![stream-]+s, %![sc-]+S", stream, stream_class);
- message = g_new0(struct bt_message_stream_beginning, 1);
- if (!message) {
- BT_LOGE_STR("Failed to allocate one stream beginning message.");
- goto error;
- }
-
- bt_message_init(&message->parent,
- BT_MESSAGE_TYPE_STREAM_BEGINNING,
- bt_message_stream_beginning_destroy, NULL);
- message->stream = stream;
- bt_object_get_no_null_check(message->stream);
- BT_LIB_LOGD("Created stream beginning message object: "
- "%![msg-]+n, %![stream-]+s, %![sc-]+S", message,
- stream, stream_class);
- return (void *) &message->parent;
-error:
- return NULL;
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING);
+ return borrow_stream_message_stream(message);
}
-struct bt_stream *bt_message_stream_beginning_borrow_stream(
+struct bt_stream *bt_message_stream_end_borrow_stream(
struct bt_message *message)
{
- struct bt_message_stream_beginning *stream_begin;
-
BT_ASSERT_PRE_NON_NULL(message, "Message");
- BT_ASSERT_PRE_MSG_IS_TYPE(message,
- BT_MESSAGE_TYPE_STREAM_BEGINNING);
- stream_begin = (void *) message;
- return stream_begin->stream;
+ BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
+ return borrow_stream_message_stream(message);
}
const struct bt_stream *bt_message_stream_beginning_borrow_stream_const(
return bt_message_stream_beginning_borrow_stream(
(void *) message);
}
+
+const struct bt_stream *bt_message_stream_end_borrow_stream_const(
+ const struct bt_message *message)
+{
+ return bt_message_stream_end_borrow_stream(
+ (void *) message);
+}
#include <babeltrace/graph/message-iterator-internal.h>
#include <babeltrace/graph/message-packet-internal.h>
#include <babeltrace/graph/message-stream-internal.h>
+#include <babeltrace/graph/message-stream-activity-internal.h>
#include <babeltrace/graph/port-internal.h>
#include <babeltrace/plugin/plugin-internal.h>
#include <babeltrace/plugin/plugin-so-internal.h>
if (msg_event->event) {
SET_TMP_PREFIX("event-");
- format_event(buf_ch, true, tmp_prefix, msg_event->event);
+ format_event(buf_ch, true, tmp_prefix,
+ msg_event->event);
}
break;
}
case BT_MESSAGE_TYPE_STREAM_BEGINNING:
+ case BT_MESSAGE_TYPE_STREAM_END:
{
- const struct bt_message_stream_beginning *msg_stream =
- (const void *) msg;
+ const struct bt_message_stream *msg_stream = (const void *) msg;
if (msg_stream->stream) {
SET_TMP_PREFIX("stream-");
- format_stream(buf_ch, true, tmp_prefix, msg_stream->stream);
+ format_stream(buf_ch, true, tmp_prefix,
+ msg_stream->stream);
}
break;
}
- case BT_MESSAGE_TYPE_STREAM_END:
+ case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING:
+ case BT_MESSAGE_TYPE_STREAM_ACTIVITY_END:
{
- const struct bt_message_stream_end *msg_stream =
+ const struct bt_message_stream_activity *msg_stream_activity =
(const void *) msg;
- if (msg_stream->stream) {
+ if (msg_stream_activity->stream) {
SET_TMP_PREFIX("stream-");
- format_stream(buf_ch, true, tmp_prefix, msg_stream->stream);
+ format_stream(buf_ch, true, tmp_prefix,
+ msg_stream_activity->stream);
}
- break;
- }
- case BT_MESSAGE_TYPE_PACKET_BEGINNING:
- {
- const struct bt_message_packet_beginning *msg_packet =
- (const void *) msg;
+ BUF_APPEND(", %sdefault-cs-state=%s",
+ PRFIELD(bt_message_stream_activity_clock_snapshot_state_string(
+ msg_stream_activity->default_cs_state)));
- if (msg_packet->packet) {
- SET_TMP_PREFIX("packet-");
- format_packet(buf_ch, true, tmp_prefix, msg_packet->packet);
+ 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_MESSAGE_TYPE_PACKET_BEGINNING:
case BT_MESSAGE_TYPE_PACKET_END:
{
- const struct bt_message_packet_end *msg_packet =
- (const void *) msg;
+ const struct bt_message_packet *msg_packet = (const void *) msg;
if (msg_packet->packet) {
SET_TMP_PREFIX("packet-");
- format_packet(buf_ch, true, tmp_prefix, msg_packet->packet);
+ format_packet(buf_ch, true, tmp_prefix,
+ msg_packet->packet);
}
break;