Perf tools on Debian cannot read performance counter in Cortex-a53 and marked as <not counted>

I have followed this link to compile perf tools. It works well on monitoring armv8_cortex_a73/* kernel PMU events, but failed on armv8_cortex_a53/* and gives the following output:

     <not counted>      armv8_cortex_a53/cpu_cycles/:u                                     (0.00%)

When I used perf_4.9, It also gave <not counted> and said that NMI_watchdog should be disabled

Some events weren't counted. Try disabling the NMI watchdog:
	echo 0 > /proc/sys/kernel/nmi_watchdog
	perf stat ...
	echo 1 > /proc/sys/kernel/nmi_watchdog

But I cannot find nmi_watchdog under that directory.
My system version is

Linux linaro-developer 4.15-hikey #1 SMP PREEMPT Sat Mar 10 22:41:04 UTC 2018 aarch64 GNU/Linux`

and perf version is

perf version 4.15.gf449b3c

As with cpufreq, the build you have is just a snapshot and has several features missing. It looks to me like the link you followed was built using a different kernel with more feature enablement.

Probably this one:

OK I’ll try this one. Thx a lot!!!