diff mbox series

[1/2] perf pmu: List kernel supplied event aliases for arm64

Message ID 1592214046-32385-2-git-send-email-john.garry@huawei.com (mailing list archive)
State New, archived
Headers show
Series perf: Improve list for arm64 | expand

Commit Message

John Garry June 15, 2020, 9:40 a.m. UTC
In commit dc098b35b56f ("perf list: List kernel supplied event aliases"),
the aliases for events are supplied in addition to CPU event in perf list.

This relies on the name of the core PMU being "cpu", which is not the case
for arm64, so arm64 has always missed this. Use generic is_pmu_core()
helper which takes account of arm64 to make this feature work for arm64
(and possibly other archs).

Sample, before:
  armv8_pmuv3_0/br_mis_pred/          [Kernel PMU event]
after:
  br_mis_pred OR armv8_pmuv3_0/br_mis_pred/          [Kernel PMU event]

Signed-off-by: John Garry <john.garry@huawei.com>
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Namhyung Kim June 15, 2020, 2:36 p.m. UTC | #1
Hello,

On Mon, Jun 15, 2020 at 6:45 PM John Garry <john.garry@huawei.com> wrote:
>
> In commit dc098b35b56f ("perf list: List kernel supplied event aliases"),
> the aliases for events are supplied in addition to CPU event in perf list.
>
> This relies on the name of the core PMU being "cpu", which is not the case
> for arm64, so arm64 has always missed this. Use generic is_pmu_core()
> helper which takes account of arm64 to make this feature work for arm64
> (and possibly other archs).
>
> Sample, before:
>   armv8_pmuv3_0/br_mis_pred/          [Kernel PMU event]
> after:
>   br_mis_pred OR armv8_pmuv3_0/br_mis_pred/          [Kernel PMU event]
>
> Signed-off-by: John Garry <john.garry@huawei.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks
Namhyung


> ---
>  tools/perf/util/pmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
> index 93fe72a9dc0b..a375364537cd 100644
> --- a/tools/perf/util/pmu.c
> +++ b/tools/perf/util/pmu.c
> @@ -1475,7 +1475,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
>                 list_for_each_entry(alias, &pmu->aliases, list) {
>                         char *name = alias->desc ? alias->name :
>                                 format_alias(buf, sizeof(buf), pmu, alias);
> -                       bool is_cpu = !strcmp(pmu->name, "cpu");
> +                       bool is_cpu = is_pmu_core(pmu->name);
>
>                         if (alias->deprecated && !deprecated)
>                                 continue;
> --
> 2.26.2
>
diff mbox series

Patch

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 93fe72a9dc0b..a375364537cd 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1475,7 +1475,7 @@  void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 		list_for_each_entry(alias, &pmu->aliases, list) {
 			char *name = alias->desc ? alias->name :
 				format_alias(buf, sizeof(buf), pmu, alias);
-			bool is_cpu = !strcmp(pmu->name, "cpu");
+			bool is_cpu = is_pmu_core(pmu->name);
 
 			if (alias->deprecated && !deprecated)
 				continue;