]> Git Repo - linux.git/commit
perf parse-events: Fix propagation of term's no_value when cloning
authorIan Rogers <[email protected]>
Thu, 31 Aug 2023 07:14:21 +0000 (00:14 -0700)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 31 Aug 2023 19:24:59 +0000 (16:24 -0300)
commit64199ae4b8a36038dd5b69904a29bd48ef11ca8b
treec238d4845589fe066b16ebd824c36fe72a3d91db
parent58d3a4cea4a45414a21a712078d95b39dcdda10d
perf parse-events: Fix propagation of term's no_value when cloning

The no_value field in 'struct parse_events_term' indicates that the val
variable isn't used, the case for an event name.

Cloning wasn't propagating this, making cloned event name terms
appearing to have a constant assinged to them.

Working around the bug would check for a value of 1 assigned to value,
but then this meant a user value of 1 couldn't be differentiated causing
the value to be lost in debug printing and perf list.

The change fixes the cloning and updates the "val.num ==/!= 1" tests to
use no_value instead.

To better check the no_value is set appropriately parameter comments are
added for constant values.

This found that no_value wasn't set correctly in parse_events_multi_pmu_add,
which matters now that no_value is used to indicate an event name.

Fixes: 7a6e91644708d514 ("perf parse-events: Make common term list to strbuf helper")
Fixes: 99e7138eb7897aa0 ("perf tools: Fail on using multiple bits long terms without value")
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Kan Liang <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/parse-events.c
tools/perf/util/parse-events.y
tools/perf/util/pmu.c
This page took 0.059196 seconds and 4 git commands to generate.