From e48537677859f4f4e68dc6473d62255add15acfc Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 9 Apr 2019 15:39:32 -0400 Subject: [PATCH] Fix: update_field_class_in_ir(): do not have special int fields in trace IR The logic in update_field_class_in_ir() for the integer field class case was wrong. This patch fixes this, so that we only translate the CTF IR integer field class to a trace IR integer field class if another field class depends on it (dynamic array, variant) or if it does not update a clock AND it does not have a special meaning. Signed-off-by: Philippe Proulx --- .../ctf/common/metadata/ctf-meta-update-in-ir.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/ctf/common/metadata/ctf-meta-update-in-ir.c b/plugins/ctf/common/metadata/ctf-meta-update-in-ir.c index ed5d23bf..0cb95cf7 100644 --- a/plugins/ctf/common/metadata/ctf-meta-update-in-ir.c +++ b/plugins/ctf/common/metadata/ctf-meta-update-in-ir.c @@ -99,14 +99,16 @@ void update_field_class_in_ir(struct ctf_field_class *fc, { struct ctf_field_class_int *int_fc = (void *) fc; - if (int_fc->mapped_clock_class || - int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE || + /* + * Conditions to be in trace IR; one of: + * + * 1. Does NOT have a mapped clock class AND does not + * have a special meaning. + * 2. Another field class depends on it. + */ + if ((!int_fc->mapped_clock_class && + int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE) || bt_g_hash_table_contains(ft_dependents, fc)) { - /* - * Field class does not update a clock, has no - * special meaning, and no sequence/variant - * field class which is part of IR depends on it. - */ fc->in_ir = true; } -- 2.34.1