mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 22:23:55 +00:00
251aa04024
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: 8bc75f699c
("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>
25 lines
750 B
C
25 lines
750 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __PMUS_H
|
|
#define __PMUS_H
|
|
|
|
struct perf_pmu;
|
|
struct print_callbacks;
|
|
|
|
void perf_pmus__destroy(void);
|
|
|
|
struct perf_pmu *perf_pmus__find(const char *name);
|
|
struct perf_pmu *perf_pmus__find_by_type(unsigned int type);
|
|
|
|
struct perf_pmu *perf_pmus__scan(struct perf_pmu *pmu);
|
|
struct perf_pmu *perf_pmus__scan_core(struct perf_pmu *pmu);
|
|
|
|
const struct perf_pmu *perf_pmus__pmu_for_pmu_filter(const char *str);
|
|
|
|
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 */
|