]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf header: In print_pmu_caps use perf_env e_machine
authorIan Rogers <irogers@google.com>
Tue, 2 Jun 2026 15:25:08 +0000 (08:25 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Jun 2026 19:49:56 +0000 (16:49 -0300)
Switch from arch to e_machine in print_pmu_caps.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Honglei Wang <jameshongleiwang@126.com>
Cc: Jan Polensky <japo@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c

index 220e7720fbdbc64bb28c75cf4e7bb52f606307b7..ecdac427d9c41c45eda379e1255839b3372b267f 100644 (file)
@@ -2461,15 +2461,16 @@ static void print_cpu_pmu_caps(struct feat_fd *ff, FILE *fp)
 static void print_pmu_caps(struct feat_fd *ff, FILE *fp)
 {
        struct perf_env *env = &ff->ph->env;
-       struct pmu_caps *pmu_caps;
+       uint16_t e_machine = perf_env__e_machine(env, /*e_flags=*/NULL);
 
        for (int i = 0; i < env->nr_pmus_with_caps; i++) {
-               pmu_caps = &env->pmu_caps[i];
+               struct pmu_caps *pmu_caps = &env->pmu_caps[i];
+
                __print_pmu_caps(fp, pmu_caps->nr_caps, pmu_caps->caps,
                                 pmu_caps->pmu_name);
        }
 
-       if (strcmp(perf_env__arch(env), "x86") == 0 &&
+       if ((e_machine == EM_X86_64 || e_machine == EM_386) &&
            perf_env__has_pmu_mapping(env, "ibs_op")) {
                char *max_precise = perf_env__find_pmu_cap(env, "cpu", "max_precise");