Skip to content

Commit d504fae

Browse files
John Garryacmel
authored andcommitted
perf pmu: Add is_pmu_core()
Add a function to decide whether a PMU is a core PMU. Signed-off-by: John Garry <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: James Clark <[email protected]> Cc: Joakim Zhang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a6c925f commit d504fae

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tools/perf/util/pmu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,11 @@ static void wordwrap(char *s, int start, int max, int corr)
14001400
}
14011401
}
14021402

1403+
bool is_pmu_core(const char *name)
1404+
{
1405+
return !strcmp(name, "cpu") || is_arm_pmu_core(name);
1406+
}
1407+
14031408
void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
14041409
bool long_desc, bool details_flag, bool deprecated)
14051410
{

tools/perf/util/pmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ int perf_pmu__format_parse(char *dir, struct list_head *head);
8888

8989
struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
9090

91+
bool is_pmu_core(const char *name);
9192
void print_pmu_events(const char *event_glob, bool name_only, bool quiet,
9293
bool long_desc, bool details_flag,
9394
bool deprecated);

0 commit comments

Comments
 (0)