perf expr: Force encapsulation on expr_id_data
authorIan Rogers <irogers@google.com>
Wed, 26 Aug 2020 15:30:55 +0000 (08:30 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 16 Nov 2020 17:09:18 +0000 (14:09 -0300)
commit29396cd573da08ae9ab0b75925c2f6b3cabb9dfa
tree49d6b307007eb1a1ecccc2721bfb13607785bb10
parent3d05181a085c7a070746c838ea25aebf25f17d52
perf expr: Force encapsulation on expr_id_data

This patch resolves some undefined behavior where variables in
expr_id_data were accessed (for debugging) without being defined. To
better enforce the tagged union behavior, the struct is moved into
expr.c and accessors provided. Tag values (kinds) are explicitly
identified.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-By: Kajol Jain<kjain@linux.ibm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20200826153055.2067780-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/expr.c
tools/perf/util/expr.h
tools/perf/util/expr.y
tools/perf/util/metricgroup.c