2

I want to perform performance measurement of a change I want to make to an application by counting instructions. However, I'm not familiar enough with ARM's debug interface to know how to do this. Is there even an interface for this sort of thing? I'm perfectly capable of diving into the kernel if necessary, but my intuition tells me this sort of thing ought to be implemented in userspace.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
alexgolec
  • 26,898
  • 33
  • 107
  • 159
  • Take a look at this discussion of accessing the cycle counters http://stackoverflow.com/questions/3247373/how-to-measure-program-execution-time-in-arm-cortex-a8-processor – Brian Swift Apr 02 '12 at 20:41
  • Thanks for the tip, but I'm running in a simulator, which renders cycle counts useless. I have to rely on instruction counts instead. – alexgolec Apr 02 '12 at 22:15
  • Which simulator are you using? Maybe it has the ability to report instruction counts, or to produce an instruction trace. – Brian Swift Apr 02 '12 at 22:32

2 Answers2

0

The ARM Profiler User Guide says an instruction trace can be created when run in a Real-Time System Model and can display executed instructions counts in The Code and Replay Views disassembly panel.

Brian Swift
  • 1,403
  • 8
  • 10
0

CONFIG_PERF_EVENTS in Linux kernel .config

Userspace tools for accessing this are in linux-source/tools/perf/

HW_PERF_EVENTS enables PMU, CPU_HAS_PMU is defined thusly: (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && (!ARCH_OMAP3 || OMAP3_EMU) so your chip likely has it. Otherwise, Linux will try to get some stats in software (sampling value of %pc in an interrupt, I suppose).

Z.T.
  • 939
  • 8
  • 20