TemplateRex
TemplateRex

Reputation: 70526

Perf: how to display cache miss percentage from raw counters

I am using the perf tool on Linux with an Intel Xeon E5-1650 v4 processor (Broadwell architecture).

For several cache load/miss indicators, perf stat indicates that these are <not supported>:

$ perf stat -e L1-icache-loads,L1-icache-load-misses,L1-dcache-loads,L1-dcache-load-misses,LLC-loads,LLC-load-misses myprogram

 Performance counter stats for 'myprogram':

   <not supported>      L1-icache-loads                                             
           550.670      L1-icache-load-misses                                       
       103.926.211      L1-dcache-loads                                             
        17.266.056      L1-dcache-load-misses     #   16,61% of all L1-dcache accesses
   <not supported>      LLC-loads                                                   
   <not supported>      LLC-load-misses                                             

       0,159281699 seconds time elapsed

       0,138935000 seconds user
       0,020431000 seconds sys

From this site I managed to find the event code and umasks and I can specify the raw counters as follows:

$ perf stat -e cpu/event=0x80,umask=0x01,name=L1-icache-loads/,L1-icache-load-misses,L1-dcache-loads,L1-dcache-load-misses,cpu/event=0x2e,umask=0x4f,name=LLC-loads/,cpu/event=0x2e,umask=0x41,name=LLC-load-misses/ myprogram

 Performance counter stats for 'myprogram':

        30.724.476      L1-icache-loads                                               (65,33%)
           709.859      L1-icache-load-misses     <------------- NO PERCENTAGE -----> (65,37%)
       105.432.323      L1-dcache-loads                                               (65,95%)
        17.942.752      L1-dcache-load-misses     #   17,02% of all L1-dcache accesses  (68,38%)
        21.991.089      LLC-loads                                                     (68,71%)
            88.833      LLC-load-misses           <------------- NO PERCENTAGE -----> (66,25%)

       0,162608291 seconds time elapsed

       0,158630000 seconds user
       0,004139000 seconds sys

However, the L1-icache-load-misses it not given as a percentage of the L1-icache-loads, and similarly LLC-load-misses is not given as a percentage of the LLC-loads

Question 1: is there a way to tell perft to annotate a row with a percentage in terms of another row?

Question 2: is is possible to recompile my kernel or configure perf in order to map the event codes and umasks for my specific processor, so that perf will support the L1 and LLC cache counters and give percentages for the misses?

Upvotes: 1

Views: 85

Answers (0)

Related Questions