aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/pmus.h
diff options
context:
space:
mode:
authorGravatar Ian Rogers <irogers@google.com> 2023-06-01 01:29:53 -0700
committerGravatar Arnaldo Carvalho de Melo <acme@redhat.com> 2023-06-01 14:27:30 -0300
commit251aa040244a3b17068e4e6ec61f138d7e50681a (patch)
treefdc9a4c1e702a29808e91f1518a67d37bb79ea8e /tools/perf/util/pmus.h
parentperf evsel: Add verbose 3 print of evsel name when opening (diff)
downloadlinux-251aa040244a3b17068e4e6ec61f138d7e50681a.tar.gz
linux-251aa040244a3b17068e4e6ec61f138d7e50681a.tar.bz2
linux-251aa040244a3b17068e4e6ec61f138d7e50681a.zip
perf parse-events: Wildcard most "numeric" events
Numeric events are either raw events or those with ABI defined numbers matched by the lexer. PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE events should wildcard match on hybrid systems. So "cycles" should match each PMU type with an extended type, not just PERF_TYPE_HARDWARE. Change wildcard matching to add the event even if wildcard PMU scanning fails, there will be no extended type but this best matches previous behavior. Only set the extended type when the event type supports it and when perf_pmus__supports_extended_type is true. This new function returns true if >1 core PMU and avoids potential errors on older kernels. Modify evsel__compute_group_pmu_name using a helper perf_pmu__is_software to determine when grouping should occur. Try to use PMUs, and evsel__find_pmu, as being more dependable than evsel->pmu_name. Set a parse events error if a hardware term's PMU lookup fails, to provide extra diagnostics. Fixes: 8bc75f699c141420 ("perf parse-events: Support wildcards on raw events") Reported-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Kan Liang <kan.liang@linux.intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Rob Herring <robh@kernel.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com> Link: https://lore.kernel.org/r/20230601082954.754318-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/pmus.h')
-rw-r--r--tools/perf/util/pmus.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/pmus.h b/tools/perf/util/pmus.h
index 1e710720aec7..d02ffea5d3a4 100644
--- a/tools/perf/util/pmus.h
+++ b/tools/perf/util/pmus.h
@@ -19,5 +19,6 @@ int perf_pmus__num_mem_pmus(void);
void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *print_state);
bool perf_pmus__have_event(const char *pname, const char *name);
int perf_pmus__num_core_pmus(void);
+bool perf_pmus__supports_extended_type(void);
#endif /* __PMUS_H */