perf metric: Restructure struct expr_parse_ctx.
authorIan Rogers <irogers@google.com>
Thu, 23 Sep 2021 07:46:04 +0000 (00:46 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Sep 2021 16:21:47 +0000 (13:21 -0300)
commitcb94a02e7494c001fa8b5a4c5e16693fafd98530
tree9cc94266f583b8355d68acffc2317eeed22b79d8
parentc801612875909cbce823dfc276c58c7155f95b01
perf metric: Restructure struct expr_parse_ctx.

A later change to parsing the ids out (in expr__find_other) will
potentially drop hashmaps and so it is more convenient to move
expr_parse_ctx to have a hashmap pointer rather than a struct value.

As this pointer must be freed, rather than just going out of scope, add
expr__ctx_new and expr__ctx_free to manage expr_parse_ctx memory.
Adjust use of struct expr_parse_ctx accordingly.

Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandeep Dasgupta <sdasgup@google.com>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20210923074616.674826-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/expr.c
tools/perf/tests/pmu-events.c
tools/perf/util/expr.c
tools/perf/util/expr.h
tools/perf/util/metricgroup.c
tools/perf/util/stat-shadow.c