linux-stable/drivers/perf
Stephane Eranian a30b87e6bd arm64: pmuv3: dynamically map PERF_COUNT_HW_BRANCH_INSTRUCTIONS
The mapping of perf_events generic hardware events to actual PMU events on
ARM PMUv3 may not always be correct. This is in particular true for the
PERF_COUNT_HW_BRANCH_INSTRUCTIONS event. Although the mapping points to an
architected event, it may not always be available. This can be seen with a
simple:

$ perf stat -e branches sleep 0
 Performance counter stats for 'sleep 0':

   <not supported>      branches

       0.001401081 seconds time elapsed

Yet the hardware does have an event that could be used for branches.

Dynamically check for a supported hardware event which can be used for
PERF_COUNT_HW_BRANCH_INSTRUCTIONS at mapping time.

And with that:

$ perf stat -e branches sleep 0

 Performance counter stats for 'sleep 0':

           166,739      branches

       0.000832163 seconds time elapsed

Co-developed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Co-developed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Co-developed-by: Peter Newman <peternewman@google.com>
Signed-off-by: Peter Newman <peternewman@google.com>
Link: https://lore.kernel.org/all/YvunKCJHSXKz%2FkZB@FVFF77S0Q05N
Link: https://lore.kernel.org/r/20230411093809.657501-1-peternewman@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-04-11 12:35:20 +01:00
..
amlogic perf/amlogic: Fix config1/config2 parsing issue 2023-03-27 15:12:05 +01:00
arm_cspmu perf: arm_cspmu: Fix variable dereference warning 2023-03-27 15:12:58 +01:00
hisilicon drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu" 2023-01-19 18:30:21 +00:00
alibaba_uncore_drw_pmu.c drivers/perf: Use devm_platform_get_and_ioremap_resource() 2023-03-27 15:09:09 +01:00
apple_m1_cpu_pmu.c drivers/perf: apple_m1: Add Apple M2 support 2023-03-27 15:15:14 +01:00
arm-cci.c perf/arm-cci: Use the bitmap API to allocate bitmaps 2022-07-06 11:02:58 +01:00
arm-ccn.c drivers/perf:Directly use ida_alloc()/free() 2022-06-23 15:44:45 +01:00
arm-cmn.c perf/arm-cmn: Validate cycles events fully 2023-04-06 16:07:51 +01:00
arm_dmc620_pmu.c perf: arm: Use devm_platform_get_and_ioremap_resource() 2023-03-27 15:02:32 +01:00
arm_dsu_pmu.c perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2022-11-15 13:45:01 +00:00
arm_pmu.c Scheduler updates in this cycle are: 2023-02-20 17:41:08 -08:00
arm_pmu_acpi.c arm_pmu: acpi: handle allocation failure 2022-11-08 12:42:46 +00:00
arm_pmu_platform.c perf/arm_pmu_platform: fix tests for platform_get_irq() failure 2022-09-01 12:01:40 +01:00
arm_pmuv3.c arm64: pmuv3: dynamically map PERF_COUNT_HW_BRANCH_INSTRUCTIONS 2023-04-11 12:35:20 +01:00
arm_smmuv3_pmu.c perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2022-11-15 13:47:04 +00:00
arm_spe_pmu.c perf: arm_spe: Print the version of SPE detected 2023-02-07 11:52:21 +00:00
fsl_imx8_ddr_perf.c drivers/perf: fsl_imx8_ddr_perf: Remove set-but-not-used variable 2023-02-03 13:04:22 +00:00
Kconfig ARM: perf: Allow the use of the PMUv3 driver on 32bit ARM 2023-03-27 14:01:18 +01:00
Makefile arm64: perf: Move PMUv3 driver to drivers/perf 2023-03-27 14:01:18 +01:00
marvell_cn10k_ddr_pmu.c perf/marvell: Add ACPI support to DDR uncore driver 2023-01-19 18:30:21 +00:00
marvell_cn10k_tad_pmu.c perf/marvell: Add ACPI support to TAD uncore driver 2023-01-19 18:30:22 +00:00
qcom_l2_pmu.c perf: qcom_l2_pmu: Refactor _UID handling to use acpi_dev_uid_to_integer() 2022-09-19 18:34:42 +02:00
qcom_l3_pmu.c perf: qcom: Use devm_platform_get_and_ioremap_resource() 2023-03-27 15:03:01 +01:00
riscv_pmu.c perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes 2022-08-12 07:17:38 -07:00
riscv_pmu_legacy.c RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
riscv_pmu_sbi.c RISC-V Patches for the 6.3 Merge Window, Part 2 2023-03-03 09:32:51 -08:00
thunderx2_pmu.c perf: Replace acpi_bus_get_device() 2022-02-08 15:14:53 +00:00
xgene_pmu.c perf: replace bitmap_weight with bitmap_empty where appropriate 2022-02-15 14:38:57 +00:00