#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/message-discarded-items-internal.h>
#include <babeltrace/graph/port-internal.h>
#include <babeltrace/plugin/plugin-internal.h>
#include <babeltrace/plugin/plugin-so-internal.h>
static inline void format_trace_class(char **buf_ch, bool extended,
const char *prefix, const struct bt_trace_class *trace_class)
{
- char tmp_prefix[64];
-
if (trace_class->name.value) {
BUF_APPEND(", %sname=\"%s\"",
PRFIELD(trace_class->name.value));
PRFIELD(trace_class->stream_classes->len));
}
- BUF_APPEND(", %spacket-header-fc-addr=%p, "
- "%sassigns-auto-sc-id=%d",
- PRFIELD(trace_class->packet_header_fc),
+ BUF_APPEND(", %sassigns-auto-sc-id=%d",
PRFIELD(trace_class->assigns_automatic_stream_class_id));
- SET_TMP_PREFIX("phf-pool-");
- format_object_pool(buf_ch, extended, prefix,
- &trace_class->packet_header_field_pool);
}
static inline void format_trace(char **buf_ch, bool extended,
}
BUF_APPEND(", %spacket-context-fc-addr=%p, "
- "%sevent-header-fc-addr=%p, %sevent-common-context-fc-addr=%p",
+ "%sevent-common-context-fc-addr=%p",
PRFIELD(stream_class->packet_context_fc),
- PRFIELD(stream_class->event_header_fc),
PRFIELD(stream_class->event_common_context_fc));
trace_class = bt_stream_class_borrow_trace_class_inline(stream_class);
if (!trace_class) {
BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class));
SET_TMP_PREFIX("trace-class-");
format_trace_class(buf_ch, false, tmp_prefix, trace_class);
- SET_TMP_PREFIX("ehf-pool-");
- format_object_pool(buf_ch, extended, prefix,
- &stream_class->event_header_field_pool);
SET_TMP_PREFIX("pcf-pool-");
format_object_pool(buf_ch, extended, prefix,
&stream_class->packet_context_field_pool);
return;
}
- BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, "
- "%scontext-field-addr=%p",
+ BUF_APPEND(", %sis-frozen=%d, %scontext-field-addr=%p",
PRFIELD(packet->frozen),
- PRFIELD(packet->header_field ? packet->header_field->field : NULL),
PRFIELD(packet->context_field ? packet->context_field->field : NULL));
stream = bt_packet_borrow_stream_const(packet);
if (!stream) {
return;
}
- BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, "
+ BUF_APPEND(", %sis-frozen=%d, "
"%scommon-context-field-addr=%p, "
"%sspecific-context-field-addr=%p, "
"%spayload-field-addr=%p, ",
PRFIELD(event->frozen),
- PRFIELD(event->header_field ?
- event->header_field->field : NULL),
PRFIELD(event->common_context_field),
PRFIELD(event->specific_context_field),
PRFIELD(event->payload_field));
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);
+ }
+
+ BUF_APPEND(", %sdefault-cs-state=%s",
+ PRFIELD(bt_message_stream_activity_clock_snapshot_state_string(
+ msg_stream_activity->default_cs_state)));
+
+ 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_beginning *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;
}
- case BT_MESSAGE_TYPE_PACKET_END:
+ case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
+ case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
{
- const struct bt_message_packet_end *msg_packet =
+ const struct bt_message_discarded_items *msg_disc_items =
(const void *) msg;
- if (msg_packet->packet) {
- SET_TMP_PREFIX("packet-");
- format_packet(buf_ch, true, tmp_prefix, msg_packet->packet);
+ if (msg_disc_items->stream) {
+ SET_TMP_PREFIX("stream-");
+ format_stream(buf_ch, true, tmp_prefix,
+ msg_disc_items->stream);
+ }
+
+ if (msg_disc_items->default_begin_cs) {
+ SET_TMP_PREFIX("default-begin-cs-");
+ format_clock_snapshot(buf_ch, true, tmp_prefix,
+ msg_disc_items->default_begin_cs);
+ }
+
+ if (msg_disc_items->default_end_cs) {
+ SET_TMP_PREFIX("default-end-cs-");
+ format_clock_snapshot(buf_ch, true, tmp_prefix,
+ msg_disc_items->default_end_cs);
+ }
+
+ if (msg_disc_items->count.base.avail) {
+ BUF_APPEND(", %scount=%" PRIu64,
+ PRFIELD(msg_disc_items->count.value));
}
break;