X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Ftranslate-trace-ir-to-ctf-ir.c;h=d398f6593591dac9ea501700e1355aa80ed787b9;hb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;hp=fe3725f84d73c172795309c63a94743a5c7acaa0;hpb=e8806f78186b5f2e3ed85930ab3f211667cb3327;p=babeltrace.git diff --git a/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index fe3725f8..d398f659 100644 --- a/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -23,10 +23,10 @@ #define BT_LOG_TAG "PLUGIN-CTF-FS-SINK-TRANSLATE-TRACE-IR-TO-CTF-IR" #include "logging.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -896,23 +896,26 @@ end: * sequence field class. */ static -int set_field_refs(struct fs_sink_ctf_field_class *fc, const char *fc_name, - struct fs_sink_ctf_field_class *parent_fc) +int set_field_refs(struct fs_sink_ctf_field_class * const fc, + const char *fc_name, struct fs_sink_ctf_field_class *parent_fc) { int ret = 0; + enum fs_sink_ctf_field_class_type fc_type; BT_ASSERT(fc); - switch (fc->type) { + fc_type = fc->type; + + switch (fc_type) { case FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT: case FS_SINK_CTF_FIELD_CLASS_TYPE_VARIANT: { uint64_t i; uint64_t len; struct fs_sink_ctf_field_class_struct *struct_fc; - struct fs_sink_ctf_field_class_variant *var_fc; + struct fs_sink_ctf_field_class_variant *var_fc = NULL; struct fs_sink_ctf_named_field_class *named_fc; - if (fc->type == FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT) { + if (fc_type == FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT) { struct_fc = (void *) fc; len = struct_fc->members->len; } else { @@ -925,7 +928,7 @@ int set_field_refs(struct fs_sink_ctf_field_class *fc, const char *fc_name, } for (i = 0; i < len; i++) { - if (fc->type == FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT) { + if (fc_type == FS_SINK_CTF_FIELD_CLASS_TYPE_STRUCT) { named_fc = fs_sink_ctf_field_class_struct_borrow_member_by_index( struct_fc, i); } else { @@ -948,7 +951,7 @@ int set_field_refs(struct fs_sink_ctf_field_class *fc, const char *fc_name, struct fs_sink_ctf_field_class_array_base *array_base_fc = (void *) fc; - if (fc->type == FS_SINK_CTF_FIELD_CLASS_TYPE_SEQUENCE) { + if (fc_type == FS_SINK_CTF_FIELD_CLASS_TYPE_SEQUENCE) { ret = set_field_ref(fc, fc_name, parent_fc); if (ret) { goto end; @@ -1163,13 +1166,6 @@ int translate_stream_class(struct fs_sink_ctf_trace_class *tc, const char *name = bt_clock_class_get_name( (*out_sc)->default_clock_class); - if (!bt_stream_class_default_clock_is_always_known(ir_sc)) { - BT_LOGE("Unsupported stream clock which can have an unknown value: " - "sc-name=\"%s\"", - bt_stream_class_get_name(ir_sc)); - goto error; - } - if (name) { /* Try original name, protected */ g_string_assign((*out_sc)->default_clock_class_name, @@ -1274,7 +1270,7 @@ struct fs_sink_ctf_trace_class *translate_trace_class_trace_ir_to_ctf_ir( } switch (bt_value_get_type(val)) { - case BT_VALUE_TYPE_INTEGER: + case BT_VALUE_TYPE_SIGNED_INTEGER: case BT_VALUE_TYPE_STRING: break; default: