From: Oliver Upton Date: Tue, 17 Dec 2024 21:20:33 +0000 (-0800) Subject: drivers/perf: apple_m1: Map generic branch events X-Git-Tag: v6.14-rc1~198^2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4575353d82e253ac14bb0d3fc2034bfad2f2e64e;p=thirdparty%2Fkernel%2Flinux.git drivers/perf: apple_m1: Map generic branch events Map the generic perf events for branch prediction stats to the corresponding hardware events. Signed-off-by: Oliver Upton Tested-by: Janne Grunau Link: https://lore.kernel.org/r/20241217212048.3709204-4-oliver.upton@linux.dev Signed-off-by: Will Deacon --- diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c index 1d4d01e1275e0..06fd317529fcb 100644 --- a/drivers/perf/apple_m1_cpu_pmu.c +++ b/drivers/perf/apple_m1_cpu_pmu.c @@ -168,6 +168,8 @@ static const unsigned m1_pmu_perf_map[PERF_COUNT_HW_MAX] = { PERF_MAP_ALL_UNSUPPORTED, [PERF_COUNT_HW_CPU_CYCLES] = M1_PMU_PERFCTR_CORE_ACTIVE_CYCLE, [PERF_COUNT_HW_INSTRUCTIONS] = M1_PMU_PERFCTR_INST_ALL, + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = M1_PMU_PERFCTR_INST_BRANCH, + [PERF_COUNT_HW_BRANCH_MISSES] = M1_PMU_PERFCTR_BRANCH_MISPRED_NONSPEC, }; /* sysfs definitions */