Akash Panda
Akash Panda

Reputation: 320

Why is perf not working for precise events in my Intel Skylake Server?

I wanted to measure the percentage of remote and local memory accesses in my workloads. I am facing some issues, as I feel I am not getting correct numbers for the events mem_load_l3_miss_retired.remote_dram and mem_load_l3_miss_retired.local_dram on my Skylake Server. So I wanted to make use of Precise events. But to my surprise, I am getting the event as not supported in the machine. Although the Manual mentions the counter as a PEBS counter.

My output is as follows:

perf stat -e mem_load_l3_miss_retired.remote_dram:p sleep 2

Performance counter stats for 'sleep 2':

   <not supported>      mem_load_l3_miss_retired.remote_dram:p    

Please help me in getting to the solution.

Upvotes: 0

Views: 987

Answers (1)

Arnabjyoti Kalita
Arnabjyoti Kalita

Reputation: 2431

You cannot obtain Precise event numbers with perf stat.

perf stat runs in non-sampling mode, wherein perf maintains a running count of all occurrences of events. It does not make sense to record Precise events in counting mode. Precise events, as Peter mentioned, helps you to correctly narrow down the instruction (actually +1 instruction, from the instruction that triggers the PEBS assist), which the record in the sample is attributed to.

Also, the PEBS interrupt-handler is known to cause conflicts with the counter overflow NMI that runs when perf stat is run. For more understanding, you should look at this discussion.

For the above reasons, recording precise events has been disabled in non-sampling mode, as can be seen here.

/* There's no sense in having PEBS for non sampling events: */
    if (!is_sampling_event(event))
            return -EINVAL;

You should use perf record to record precise events, since it seems that event mem_load_l3_miss_retired.remote_dram has support for PEBS already.

perf record -e mem_load_l3_miss_retired.remote_dram:p sleep 2

Upvotes: 3

Related Questions