0

Can software be written (for some specific programming language, platform, etc.) that will inform a user of exactly how many times the relevant machine-level instruction pointers change value during the execution of a program? Is such software already available?

r.e.s.
  • 227
  • 3
  • 11
  • Are you basically looking to measure how many instructions are executed? – Oliver Charlesworth Jun 24 '12 at 16:53
  • @OliCharlesworth - Yes, or rather counting "instruction-executions" -- i.e., it's not the number of instructions, but the number of times they are executed, in total. – r.e.s. Jun 24 '12 at 16:56

1 Answers1

1

Yes, this is possible, at least on many processors. The key is the use of hardware performance counters.

I'm not sure if there's a good API for accessing these. But tools such as OProfile can do this kind of performance monitoring for you.

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680