Hikey 970 - Performance Hardware Events

Board based on the Kirin 970 - HI3670 Application Processor
More info: http://www.96boards.org/product/hikey970/ (Website coming soon…)
Buy now: https://www.seeedstudio.com/HiKey-970-Development-Board-p-3046.html

Hi all,

I recently bought HiKey970 board and connected to a monitor and am trying use simple perf to observe stats of an executable. However, When I do that, it showed that the list of hardware events are empty.
Can you please tell me how to enable these Hardware counters?
On a side note, could you also tell me where the config file is located?

PS: I am a newbie and this is my first time working on a development board.

Thank you.

Hi,

did you build the Linux kernel with PMU support in the device tree?
If not, this is the entry I used (file is arch/arm64/boot/dts/hisilicon/kirin970-hikey970.dts):

pmu {
       compatible = "arm,armv8-pmuv3";
       interrupts = <0 24 4>,
                    <0 25 4>,
                    <0 26 4>,
                    <0 27 4>,
                    <0 2 4>,
                    <0 3 4>,
                    <0 4 4>,
                    <0 5 4>;
       interrupt-affinity = <&cpu0>,
                            <&cpu1>,
                            <&cpu2>,
                            <&cpu3>,
                            <&cpu4>,
                            <&cpu5>,
                            <&cpu6>,
                            <&cpu7>;
};

Best regards,
Martin

Hi Martin,

Thank you for your reply.

I downloaded the kernel source code from https://github.com/96boards-hikey/linux (please let me know if this source is not correct).
I made change to kirin970-hikey970.dts as suggested.

Could you direct me to the next steps to build the kernel. I want to also enable /dev/mem during the configuration.

Any guidance will be of great help.

Regards,
Siva

Hi Siva,

I used the instructions from https://github.com/neonVoice/hikey970-aosp-build/blob/master/README.md (Section 2) to build the kernel. Building AOSP did not work for me, so I took the prm_ptable.img, sec_xloader.img, l-loader.bin, fip.bin, cache.img, system.img and userdata.img from https://www.96boards.org/documentation/consumer/hikey/hikey970/downloads/aosp.md.html.
I rebuilt the boot.img by taking the ramdisk.img from the downloaded AOSP and combining it with the self-built Image and kirin970-hikey970.dtb by using mkbootimg.py.

I never used /dev/mem, so I cannot help you there.

Best regards,
Martin