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

Cortex-R52+: measure the number of executed instructions

Hi 

Is there any way to measure the total number of executed instructions for a piece of code ?

I have tried the PMU event - instructions architecturally executed. But the counted number was much more than the assembly instructions.

Such as

1. executed one assemble instruction (like, ldr), the count of the PMU event 8 is 2

2. executed 12 assemble instructions, the count of the PMU event 8 is 14

3. executed a piece of code - the count of the PMU event 8 is around 500K. I use the system timer to monitor the execution time and then convert to the DMIPS. That is almost 2.5 times of the official DMIPS shown on the ARM website. 

Pls kindly give me some instructions. Thanks.

Grace

Parents
  • I think the problem is the granularity you're trying to read at.  To configure or read the PMU requires executing instructions, and in some case synchronisation.   If you're measuring hundreds of instructions, then the extra instructions to sync+read the PMU don't matter.  If you're measuring 18, then overheads of reading the PMU is going to potentially be a relatively large proportion of the total measured.  

    That's on top of whatever effects you see from the tool's debug illusion.

Reply
  • I think the problem is the granularity you're trying to read at.  To configure or read the PMU requires executing instructions, and in some case synchronisation.   If you're measuring hundreds of instructions, then the extra instructions to sync+read the PMU don't matter.  If you're measuring 18, then overheads of reading the PMU is going to potentially be a relatively large proportion of the total measured.  

    That's on top of whatever effects you see from the tool's debug illusion.

Children
No data