From: Ian Rogers Date: Tue, 2 Jun 2026 15:25:08 +0000 (-0700) Subject: perf header: In print_pmu_caps use perf_env e_machine X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=5d57371b9cd2a40e04df0104b62a4c302555d076;p=thirdparty%2Fkernel%2Flinux.git perf header: In print_pmu_caps use perf_env e_machine Switch from arch to e_machine in print_pmu_caps. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Gordeev Cc: Heiko Carstens Cc: Honglei Wang Cc: Jan Polensky Cc: Sumanth Korikkar Cc: Thomas Richter Cc: Vasily Gorbik Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 220e7720fbdbc..ecdac427d9c41 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -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");