X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Ftranslate-ctf-ir-to-tsdl.c;h=571599534971cf0a954a19cd429441e177205d5a;hb=71c5da58f2e63c0ea0df3b603d615f5aa3dde008;hp=c148caea410f11972f1969d693df68015bdbf692;hpb=68d9d039b7a06245b9e376213c5ec2e0efab4a95;p=babeltrace.git diff --git a/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c b/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c index c148caea..57159953 100644 --- a/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c +++ b/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c @@ -23,14 +23,14 @@ #define BT_LOG_TAG "PLUGIN-CTF-FS-SINK-TRANSLATE-CTF-IR-TO-TSDL" #include "logging.h" -#include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include "fs-sink-ctf-meta.h" @@ -710,12 +710,15 @@ void append_stream_class(struct ctx *ctx, BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, NULL, "content_size", true); - if (sc->default_clock_class) { + if (sc->packets_have_ts_begin) { append_indent(ctx); append_integer_field_class_from_props(ctx, 64, 8, false, BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, sc->default_clock_class_name->str, "timestamp_begin", true); + } + + if (sc->packets_have_ts_end) { append_indent(ctx); append_integer_field_class_from_props(ctx, 64, 8, false, BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, @@ -723,10 +726,18 @@ void append_stream_class(struct ctx *ctx, "timestamp_end", true); } - append_indent(ctx); - append_integer_field_class_from_props(ctx, 64, 8, false, - BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, - NULL, "events_discarded", true); + if (sc->has_discarded_events) { + append_indent(ctx); + append_integer_field_class_from_props(ctx, 64, 8, false, + BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, + NULL, "events_discarded", true); + } + + /* + * Unconditionnally write the packet sequence number as, even if + * there's no possible discarded packets message, it's still + * useful information to have. + */ append_indent(ctx); append_integer_field_class_from_props(ctx, 64, 8, false, BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL,