I am using Perf
to detect the number and locations of DRAM accesses in a workload. For locations, I need to trace in sampling mode. Therefore, I trace in sampling mode, and in order to get the total number of accesses, I multiply the number of access events by the sampling period (i.e., the number of instructions between each sample) .
I also need the total time the application is on the CPU. In other words, I need a value similar to what is reported by top
. Because I need to know the idle period (during which the application is also on the CPU) between each DRAM access in this single application. This is not reported in sampling mode and I can not use both modes (i.e., both perf record
and perf stat
) at the same time. Is there any mechanism to achieve this?