X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Ftranslate-ctf-ir-to-tsdl.c;h=e85221389e35fa53953ca1d2f220f990b82bad1d;hb=ffb5c13ca2cb0c0e270a00d66e9dca97a8c2f236;hp=c148caea410f11972f1969d693df68015bdbf692;hpb=2e90378a2b94006e2743b06e7fe7a1f0e691a56e;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..e8522138 100644 --- a/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c +++ b/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c @@ -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,