Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

Counting native events



I try to count some performance events of a part of an application written in C.

So far, I have used PAPI to count events. It works fine for preset events. However, when I profile native events, all of them turn out to be translated into the same Event Code : 0x40000022 (an output of papi_avail is below). It makes no sense, but no error occurs when I profile them. What could be wrong ? How could I debug this ?

Also, I've got a list (from the perfmon directory) of events that can be counted for the architecture I work with (Ivy bridge) and the adresses and values of the associated registers. Is there an alternative to PAPI I could use to count a particular event of that list, over a certain part of the program, knowing the name of the event and the registers informations ? Would it work to simply write and read to the corresponding registers manually (for example using pcm-msr) ?

Thanks in advance for your help,



$ papi_avail -e LLC_MISSES

Available events and hardware information.


PAPI Version             :

Vendor string and code   : GenuineIntel (1)

Model string and code    : Intel(R) Xeon(R) CPU E5-4610 v2 @ 2.30GHz (62)

CPU Revision             : 4.000000

CPUID Info               : Family: 6  Model: 62  Stepping: 4

CPU Max Megahertz        : 2294

CPU Min Megahertz        : 2294

Hdw Threads per core     : 1

Cores per Socket         : 8

Sockets                  : 4

NUMA Nodes               : 4

CPUs per Node            : 8

Total CPUs               : 32

Running in a VM          : no

Number Hardware Counters : 11

Max Multiplex Counters   : 64



Event name:                   LLC_MISSES

Event Code:                   0x40000022  

Number of Register Values:    0

Description:                 |Alias for LAST_LEVEL_CACHE_MISSES|


Unit Masks:

 Mask Info:                  |:e=0|edge level (may require counter-mask >= 1)|

 Mask Info:                  |:i=0|invert|

 Mask Info:                  |:c=0|counter-mask in range [0-255]|

 Mask Info:                  |:t=0|measure any thread|

 Mask Info:                  |:u=0|monitor at user level|

 Mask Info:                  |:k=0|monitor at kernel level|


avail.c                                     PASSED

0 Kudos
1 Reply


Unfortunately, I'm can't help you with PAPI but you might want to have a look at Intel Performance Counter Monitor. It can be used to count L3 misses on some systems.


Kind regards


0 Kudos