Re: [PATCH 19/59] perf tools: Fix parse_events_term__num call
From: Jiri Olsa <hidden>
Date: 2021-11-08 21:22:02
On Mon, Nov 08, 2021 at 10:15:45AM -0800, Ian Rogers wrote:
On Mon, Nov 8, 2021 at 5:39 AM Jiri Olsa [off-list ref] wrote:quoted
We are wrongly passing &config to parse_events_term__num as loc_term_ argument. Fixes: fb0811535e92 ("perf parse-events: Allow config on kernel PMU events")I think this shows up on the fix as this change moved the code around, but it didn't originate the issue. This pattern is common in parse-events.y, are they also problematic? https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/parse-events.y?h=perf/core#n783
they all seem to pass proper loc_term pointer.. I spot this one by accident and made quick patch, I'll double check the others thanks, jirka
Thanks, Ianquoted
Signed-off-by: Jiri Olsa <jolsa@kernel.org> --- tools/perf/util/parse-events.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 05a96b0f7b41..2bacbab86b09 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c@@ -1697,8 +1697,7 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state, if (parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, - config, 1, false, &config, - NULL) < 0) { + config, 1, false, NULL, NULL) < 0) { free(config); goto out_err; } --2.31.1