Skip to content

Commit

Permalink
perf jevents metric: Fix type of strcmp_cpuid_str
Browse files Browse the repository at this point in the history
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: 9d5da30 ("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>
  • Loading branch information
captain5050 authored and namhyung committed Sep 17, 2023
1 parent 33b725c commit d1bac78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/pmu-events/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ def has_event(event: Event) -> Function:
# pylint: disable=invalid-name
return Function('has_event', event)

def strcmp_cpuid_str(event: str) -> Function:
def strcmp_cpuid_str(cpuid: Event) -> Function:
# pylint: disable=redefined-builtin
# pylint: disable=invalid-name
return Function('strcmp_cpuid_str', event)
return Function('strcmp_cpuid_str', cpuid)

class Metric:
"""An individual metric that will specifiable on the perf command line."""
Expand Down

0 comments on commit d1bac78

Please sign in to comment.