]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drivers/perf: apple_m1: Map generic branch events
authorOliver Upton <oliver.upton@linux.dev>
Tue, 17 Dec 2024 21:20:33 +0000 (13:20 -0800)
committerWill Deacon <will@kernel.org>
Fri, 10 Jan 2025 13:32:56 +0000 (13:32 +0000)
Map the generic perf events for branch prediction stats to the
corresponding hardware events.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Tested-by: Janne Grunau <j@jannau.net>
Link: https://lore.kernel.org/r/20241217212048.3709204-4-oliver.upton@linux.dev
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/apple_m1_cpu_pmu.c

index 1d4d01e1275e05c9dc656502d22de5bb2fc46b11..06fd317529fcbab0f1485228efe8470be565407c 100644 (file)
@@ -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 */