Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf jevents metric: Fix type of strcmp_cpuid_str

The parser wraps all strings as Events, so the input is an
Event. Using a string would be bad as functions like Simplify are
called on the arguments, which wouldn't be present on a string.

Fixes: 9d5da30e4ae9 ("perf jevents: Add a new expression builtin strcmp_cpuid_str()")
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20230914022204.1488383-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
d1bac78e 33b725ce

+2 -2
+2 -2
tools/perf/pmu-events/metric.py
··· 413 413 # pylint: disable=invalid-name 414 414 return Function('has_event', event) 415 415 416 - def strcmp_cpuid_str(event: str) -> Function: 416 + def strcmp_cpuid_str(cpuid: Event) -> Function: 417 417 # pylint: disable=redefined-builtin 418 418 # pylint: disable=invalid-name 419 - return Function('strcmp_cpuid_str', event) 419 + return Function('strcmp_cpuid_str', cpuid) 420 420 421 421 class Metric: 422 422 """An individual metric that will specifiable on the perf command line."""