X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Ffs-sink%2Ftranslate-trace-ir-to-ctf-ir.c;h=fa79548b83d8162271f4b935d34efc7d177c1a1c;hb=76276a81e72d967979674fdc0a646b42d8d6033e;hp=96455e7014ba7a4e76fd37b30f5f71ef08edbde8;hpb=c27259b025303a64f2c1ae387bf9e34b95e401bb;p=babeltrace.git diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index 96455e70..fa79548b 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -370,8 +370,8 @@ int create_relative_field_ref(struct ctx *ctx, /* Find target field class having this name in current context */ for (si = ctx->cur_path->len - 1; si >= 0; si--) { struct fs_sink_ctf_field_class *fc; - struct fs_sink_ctf_field_class_struct *struct_fc; - struct fs_sink_ctf_field_class_variant *var_fc; + struct fs_sink_ctf_field_class_struct *struct_fc = NULL; + struct fs_sink_ctf_field_class_variant *var_fc = NULL; struct fs_sink_ctf_named_field_class *named_fc; uint64_t len; @@ -1241,6 +1241,19 @@ int translate_bool_field_class(struct ctx *ctx) return 0; } +static inline +int translate_bit_array_field_class(struct ctx *ctx) +{ + struct fs_sink_ctf_field_class_bit_array *fc = + fs_sink_ctf_field_class_bit_array_create( + cur_path_stack_top(ctx)->ir_fc, + cur_path_stack_top(ctx)->index_in_parent); + + BT_ASSERT(fc); + append_to_parent_field_class(ctx, (void *) fc); + return 0; +} + static inline int translate_integer_field_class(struct ctx *ctx) { @@ -1296,13 +1309,17 @@ int translate_field_class(struct ctx *ctx) case BT_FIELD_CLASS_TYPE_BOOL: ret = translate_bool_field_class(ctx); break; + case BT_FIELD_CLASS_TYPE_BIT_ARRAY: + ret = translate_bit_array_field_class(ctx); + break; case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: ret = translate_integer_field_class(ctx); break; - case BT_FIELD_CLASS_TYPE_REAL: + case BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL: + case BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL: ret = translate_real_field_class(ctx); break; case BT_FIELD_CLASS_TYPE_STRING: @@ -1485,7 +1502,7 @@ int set_field_refs(struct fs_sink_ctf_field_class * const fc, { uint64_t i; uint64_t len; - struct fs_sink_ctf_field_class_struct *struct_fc; + struct fs_sink_ctf_field_class_struct *struct_fc = NULL; struct fs_sink_ctf_field_class_variant *var_fc = NULL; struct fs_sink_ctf_named_field_class *named_fc;