This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Does ARM have a time counter mechanism?

Say, like Time Stamp Counter of x86, or Time Base of PowerPC, which can used to

do some performance profiling.

  • If you're asking about A class processors, you could use the Generic Timer.  It was added as an option in ARMv7, and is present on the Cortex-A7, Cortex-A15 and Cortex-A17.  It's available on the ARMv8 processors, Cortex-A53 and Cortex-A57.

    The Generic Timer has per core comparators, comparing against a system wide count.  Giving a consistent view of time across cores.

    For profiling you could also look at the Performance Monitor Unit (PMU).

    I'm afraid I'm not familiar with the x86/PPC features you mentioned, so can't comment on them.

  • Generic Timer doesn't implemented in Cortex-A9, and it seems PMU can only be used in kernel mode?

  • Whether the PMU is accessible in User mode is configurable.  The Os would need to allow access by writing to the PMUSERENR register.  Although usually in Linux you'd access the PMU via an API, such as oprofile or perf, rather than directly.