[arm] Use CNTVCT_EL0 as profiling timestamp
authorMichael Brown <mcb30@ipxe.org>
Wed, 11 May 2016 20:44:23 +0000 (21:44 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 12 May 2016 10:16:41 +0000 (11:16 +0100)
commit601706688bbb5502538627feb92752760d0d9f24
treec5d2c0b3038f1ddc70a1a5306dcfcf4de93cbaad
parent6164741f81fbb80d25ba3877251f4b31de3ed6a0
[arm] Use CNTVCT_EL0 as profiling timestamp

The raw cycle counter at PMCCNTR_EL0 works in qemu but seems to always
read as zero on physical hardware (tested on Juno r1 and Cavium
ThunderX), even after ensuring that PMCR_EL0.E and PMCNTENSET_EL0.C
are both enabled.

Use CNTVCT_EL0 instead; this seems to count at a lower resolution
(tens of CPU cycles), but is usable for profiling.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/arm64/include/bits/profile.h