hw perf counters missing in linux-rpi-16k on Pi5

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

hw perf counters missing in linux-rpi-16k on Pi5

Postby mmozeiko » Tue Dec 03, 2024 2:26 am

Hi.
I'm not sure if this is upstream issue or problem with package build.

I've upgraded linux-rpi-16k to 6.12.1 and it seems is missing hardware perf events.

On 6.6.62-1-rpi-16k version:

$ dmesg | grep perfevents
[ 2.317516] hw perfevents: enabled with armv8_cortex_a76 PMU driver, 7 counters available

And you can check that /sys/bus/event_source/devices/armv8_cortex_a76/events folder exists with various counters.

But on 6.12.1-1-rpi-16k version there's nothing - no dmsg message about PMU driver.
This prevents using perf utility for doing performance measurements with armv8 hw counters.
mmozeiko
 
Posts: 4
Joined: Wed Dec 14, 2016 7:03 am

Re: hw perf counters missing in linux-rpi-16k on Pi5

Postby mmozeiko » Tue Dec 03, 2024 6:29 am

Ok, figured out that this is an upstream issue. They do not include arm PMU node in device tree. I've patched my device tree to add PMU node, and then perf works.

I've added

arm-pmu {
compatible = "arm,cortex-a76-pmu";
interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>;
interrupt-affinity = <0x7c 0x7d 0x7e 0x7f>;
};

section to /boot/bcm2712-rpi-5-b.dtb device tree. You can find instructions how to patch dtb files here:make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://www.jeffgeerling.com/blog/2023/how-customize-dtb-device-tree-binary-on-raspberry-pi', '', ' class="postlink"')
mmozeiko
 
Posts: 4
Joined: Wed Dec 14, 2016 7:03 am

Re: hw perf counters missing in linux-rpi-16k on Pi5

Postby mmozeiko » Tue Dec 03, 2024 6:00 pm

A fix for has been merged upstream:make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/raspberrypi/linux/pull/6508', '', ' class="postlink"')
mmozeiko
 
Posts: 4
Joined: Wed Dec 14, 2016 7:03 am

Re: hw perf counters missing in linux-rpi-16k on Pi5

Postby graysky » Tue Dec 03, 2024 9:21 pm

Thanks, I updated the kernel packages.
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 60 guests