babeltrace/graph/message-const.h \
babeltrace/graph/message-discarded-events-const.h \
babeltrace/graph/message-discarded-events.h \
+ babeltrace/graph/message-discarded-packets-const.h \
+ babeltrace/graph/message-discarded-packets.h \
babeltrace/graph/message-event-const.h \
babeltrace/graph/message-event.h \
babeltrace/graph/message-inactivity-const.h \
#include <babeltrace/graph/message-const.h>
#include <babeltrace/graph/message-discarded-events-const.h>
#include <babeltrace/graph/message-discarded-events.h>
+#include <babeltrace/graph/message-discarded-packets-const.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>
BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING = 6,
BT_MESSAGE_TYPE_STREAM_ACTIVITY_END = 7,
BT_MESSAGE_TYPE_DISCARDED_EVENTS = 8,
+ BT_MESSAGE_TYPE_DISCARDED_PACKETS = 9,
} bt_message_type;
/**
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_CONST_H
+#define BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_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_clock_snapshot_state */
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_clock_snapshot_state
+bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot);
+
+extern bt_clock_snapshot_state
+bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot);
+
+extern const bt_stream *
+bt_message_discarded_packets_borrow_stream_const(const bt_message *message);
+
+extern bt_property_availability bt_message_discarded_packets_get_count(
+ const bt_message *message, uint64_t *count);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_CONST_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_H
+#define BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_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 <stdint.h>
+
+/* For bt_message, bt_self_message_iterator, bt_stream */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_message *bt_message_discarded_packets_create(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream);
+
+extern bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots(
+ bt_self_message_iterator *message_iterator,
+ bt_stream *stream, uint64_t beginning_raw_value,
+ uint64_t end_raw_value);
+
+extern bt_stream *bt_message_discarded_packets_borrow_stream(
+ bt_message *message);
+
+extern void bt_message_discarded_packets_set_count(bt_message *message,
+ uint64_t count);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_MESSAGE_DISCARDED_PACKETS_H */
#include <babeltrace/graph/message-discarded-items-internal.h>
#include <babeltrace/graph/message-discarded-events.h>
#include <babeltrace/graph/message-discarded-events-const.h>
+#include <babeltrace/graph/message-discarded-packets.h>
+#include <babeltrace/graph/message-discarded-packets-const.h>
static
void destroy_discarded_items_message(struct bt_object *obj)
BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return get_discarded_items_message_count(message, count);
}
+
+struct bt_message *bt_message_discarded_packets_create(
+ struct bt_self_message_iterator *message_iterator,
+ struct bt_stream *stream)
+{
+ return create_discarded_items_message(message_iterator,
+ BT_MESSAGE_TYPE_DISCARDED_PACKETS, stream,
+ false, 0, 0);
+}
+
+struct bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots(
+ struct bt_self_message_iterator *message_iterator,
+ struct bt_stream *stream, uint64_t beginning_raw_value,
+ uint64_t end_raw_value)
+{
+ return create_discarded_items_message(message_iterator,
+ BT_MESSAGE_TYPE_DISCARDED_PACKETS, stream,
+ true, beginning_raw_value, end_raw_value);
+}
+
+struct bt_stream *bt_message_discarded_packets_borrow_stream(
+ struct bt_message *message)
+{
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+ return borrow_discarded_items_message_stream(message);
+}
+
+void bt_message_discarded_packets_set_count(struct bt_message *message,
+ uint64_t count)
+{
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+ set_discarded_items_message_count(message, count);
+}
+
+enum bt_clock_snapshot_state
+bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ const struct bt_message *msg,
+ const struct bt_clock_snapshot **snapshot)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+ return borrow_discarded_items_message_default_beginning_clock_snapshot_const(
+ msg, snapshot);
+}
+
+enum bt_clock_snapshot_state
+bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ const struct bt_message *msg,
+ const struct bt_clock_snapshot **snapshot)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+ return borrow_discarded_items_message_default_end_clock_snapshot_const(
+ msg, snapshot);
+}
+
+const struct bt_stream *
+bt_message_discarded_packets_borrow_stream_const(const struct bt_message *message)
+{
+ return (void *) bt_message_discarded_packets_borrow_stream(
+ (void *) message);
+}
+
+enum bt_property_availability bt_message_discarded_packets_get_count(
+ const struct bt_message *message, uint64_t *count)
+{
+ BT_ASSERT_PRE_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+ return get_discarded_items_message_count(message, count);
+}
bt_object_release_func release,
struct bt_graph *graph)
{
- BT_ASSERT(type >= 0 && type <= BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+ BT_ASSERT(type >= 0 && type <= BT_MESSAGE_TYPE_DISCARDED_PACKETS);
message->type = type;
bt_object_init_shared(&message->base, release);
message->graph = graph;
break;
}
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
+ case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
{
const struct bt_message_discarded_items *msg_disc_items =
(const void *) msg;