X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Ftranslate-ctf-ir-to-tsdl.c;h=571599534971cf0a954a19cd429441e177205d5a;hb=68b66a256a54d32992dfefeaad11eea88b7df234;hp=efc02b305850d1a441b7f9e85feceaeb50bf804c;hpb=8f3ccfbc98c03ee07895d9d2e50e6390bbbb0431;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 efc02b30..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, @@ -867,9 +878,9 @@ void translate_trace_class_ctf_ir_to_tsdl(struct fs_sink_ctf_trace_class *tc, g_string_append_printf(tsdl, "%s = ", name); switch (bt_value_get_type(val)) { - case BT_VALUE_TYPE_INTEGER: + case BT_VALUE_TYPE_SIGNED_INTEGER: g_string_append_printf(tsdl, "%" PRId64, - bt_value_integer_get(val)); + bt_value_signed_integer_get(val)); break; case BT_VALUE_TYPE_STRING: append_quoted_string(&ctx, bt_value_string_get(val));