-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf_event_open fails on rpi4/32-bit #3508
Comments
Interesting. Pi 3 works, as does Pi 4 on 64-bit (just add |
yes with musl based rootfs I am seeing
and the example seems to work ok too. Last time I tested with glibc based rootfs and that's where I had the problem moreover above dmesg was also not there which is puzzling i will build a glibc based rootfs again today and retry |
I've been writing documentation, but I'm taking a closer look at this now. |
The problem stems from the fact that ARCH=arm has no driver for the A72 PMU. However, both the A15 and A7 drivers seem to work to my limited testing (running your test app). Can you save me some searching and say which you think should be the fallback? |
If you can, try building your own updated DTB after applying this patch: diff --git a/arch/arm/boot/dts/bcm2838.dtsi b/arch/arm/boot/dts/bcm2838.dtsi
index 5f837e8..0f54f05 100644
--- a/arch/arm/boot/dts/bcm2838.dtsi
+++ b/arch/arm/boot/dts/bcm2838.dtsi
@@ -224,7 +224,7 @@
};
arm-pmu {
- compatible = "arm,cortex-a72-pmu";
+ compatible = "arm,cortex-a72-pmu", "arm,cortex-a15-pmu";
interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, Also try with "arm,cortex-a7-pmu" instead. |
I've gone with the cortex-a15-pmu version, on the grounds that it works better than nothing. I'm willing to change this again if somebody comes up with a better suggestion. |
@pelwell I am building an image to test this patch out on pi4/32bit today. Will let you know the results on my side |
This issue has been discussed during upstreaming the DTS for the BCM2711. The proper solution would be to add arm,cortex-a72-pmu support for arm32, but the motivation of the responsible kernel developer wasn't that high :-( |
this patch works on my end. So perhaps we can apply it and keep it until its fixed right way upstream |
It's already applied, and will be ported forward to the newer kernels. |
fantastic fixed with e99b135 |
kernel: Reduce noise from rpi poe hat fan See: raspberrypi/linux#3493 kernel: ARM: dts: bcm271x: Use a53 pmu, drop RPI364 See: raspberrypi/linux#3508 firmware: isp component: rtos_common_mem: Fix smallalloc test in mem_handle_acquire_if_valid firmware: platform: 2711: Make chicken-bit pip size vary with pmic quantum firmware: USB device boot for CM4 firmware: arm_loader: Add SET_LAUNCH_VPU1 mailbox message firmware: il: camera: Add config.txt param awb_auto_is_greyworld for NoIR camera See: #1167 firmware: arm_loader: Provisional support for high peris firmware: arm_loader: Only add margins to cmdline if non-zero firmware: clock: Support clock_measure_pll on pi0-3 firmware: platform: Back to CLOCK_PLL_CHAN_CPER for emmc on pi0-3
kernel: Reduce noise from rpi poe hat fan See: raspberrypi/linux#3493 kernel: ARM: dts: bcm271x: Use a53 pmu, drop RPI364 See: raspberrypi/linux#3508 firmware: isp component: rtos_common_mem: Fix smallalloc test in mem_handle_acquire_if_valid firmware: platform: 2711: Make chicken-bit pip size vary with pmic quantum firmware: USB device boot for CM4 firmware: arm_loader: Add SET_LAUNCH_VPU1 mailbox message firmware: il: camera: Add config.txt param awb_auto_is_greyworld for NoIR camera See: raspberrypi/firmware#1167 firmware: arm_loader: Provisional support for high peris firmware: arm_loader: Only add margins to cmdline if non-zero firmware: clock: Support clock_measure_pll on pi0-3 firmware: platform: Back to CLOCK_PLL_CHAN_CPER for emmc on pi0-3
strace has serveral failures which all lead to one problem that is
__NR_perf_event_open
syscall fails reliably on rpi4/32-bit kernel. Here is small example which should work fine if PMU was enabled and functioning correctlyThis however returns
Error opening leader 1
a working system returns
There is no trace of PMU driver in dmesg either, which lets me think that is PMU not
enabled on this kernel somehow. I am using u-boot for bootloader and latest kernel
Linux version 4.19.108-v7l
CONFIG_HW_PERF_EVENTS and CONFIG_PERF_EVENTS are set to 'y' in .config
The text was updated successfully, but these errors were encountered: