mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
cd4e1efbbc
Add a PMUs scan that ignores duplicates. When there are multiple PMUs that differ only by suffix, by default just list the first one and skip all others. The scan routine checks that the PMU names match but doesn't enforce that the numbers are consecutive as for some PMUs there are gaps. If "-v" is passed to "perf list" then list all PMUs. With the previous change duplicate PMUs are no longer printed but the suffix of the first is printed. When duplicate PMUs are being skipped avoid printing the suffix. Before: $ perf list ... uncore_imc_free_running_0/data_read/ [Kernel PMU event] uncore_imc_free_running_0/data_total/ [Kernel PMU event] uncore_imc_free_running_0/data_write/ [Kernel PMU event] uncore_imc_free_running_1/data_read/ [Kernel PMU event] uncore_imc_free_running_1/data_total/ [Kernel PMU event] uncore_imc_free_running_1/data_write/ [Kernel PMU event] After: $ perf list ... uncore_imc_free_running/data_read/ [Kernel PMU event] uncore_imc_free_running/data_total/ [Kernel PMU event] uncore_imc_free_running/data_write/ [Kernel PMU event] ... $ perf list -v uncore_imc_free_running_0/data_read/ [Kernel PMU event] uncore_imc_free_running_0/data_total/ [Kernel PMU event] uncore_imc_free_running_0/data_write/ [Kernel PMU event] uncore_imc_free_running_1/data_read/ [Kernel PMU event] uncore_imc_free_running_1/data_total/ [Kernel PMU event] uncore_imc_free_running_1/data_write/ [Kernel PMU event] ... Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Ian Rogers <irogers@google.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: John Garry <john.g.garry@oracle.com> Cc: Kajol Jain <kjain@linux.ibm.com> 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> Link: https://lore.kernel.org/r/20230825135237.921058-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
43 lines
1.5 KiB
C
43 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __PERF_PRINT_EVENTS_H
|
|
#define __PERF_PRINT_EVENTS_H
|
|
|
|
#include <linux/perf_event.h>
|
|
#include <linux/types.h>
|
|
#include <stdbool.h>
|
|
|
|
struct event_symbol;
|
|
|
|
struct print_callbacks {
|
|
void (*print_start)(void *print_state);
|
|
void (*print_end)(void *print_state);
|
|
void (*print_event)(void *print_state, const char *topic,
|
|
const char *pmu_name,
|
|
const char *event_name, const char *event_alias,
|
|
const char *scale_unit,
|
|
bool deprecated, const char *event_type_desc,
|
|
const char *desc, const char *long_desc,
|
|
const char *encoding_desc);
|
|
void (*print_metric)(void *print_state,
|
|
const char *group,
|
|
const char *name,
|
|
const char *desc,
|
|
const char *long_desc,
|
|
const char *expr,
|
|
const char *threshold,
|
|
const char *unit);
|
|
bool (*skip_duplicate_pmus)(void *print_state);
|
|
};
|
|
|
|
/** Print all events, the default when no options are specified. */
|
|
void print_events(const struct print_callbacks *print_cb, void *print_state);
|
|
int print_hwcache_events(const struct print_callbacks *print_cb, void *print_state);
|
|
void print_sdt_events(const struct print_callbacks *print_cb, void *print_state);
|
|
void print_symbol_events(const struct print_callbacks *print_cb, void *print_state,
|
|
unsigned int type, const struct event_symbol *syms,
|
|
unsigned int max);
|
|
void print_tool_events(const struct print_callbacks *print_cb, void *print_state);
|
|
void print_tracepoint_events(const struct print_callbacks *print_cb, void *print_state);
|
|
bool is_event_supported(u8 type, u64 config);
|
|
|
|
#endif /* __PERF_PRINT_EVENTS_H */
|