How to collect DMA events (like memory write and read) by perf tool?

36 Views Asked by At

I recent learned that the write and read operation on momory are not all originate within processor, but also can be directly accessed by other I/O device like harddisk. though command perf record -e cpu/mem-loads(or mem-stores)/p -P $PID of perf gives the memory operation times, but to my knowledge it only take cpu-memory operation into count, not DMA-memory.

I search for it and found that perf collect these event by access to ESCR register, and it work combined with a mask which specifies the event list to be monitored (as Intel Xeon Software Developer’s Manual shows: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3b-part-2-manual.pdf, page 475). When the ESCR Event Mask bit 14 was set, the DMA and other processor memory access can be captured. I have studied for perf event list, but can't find any event that support DMA memory operation. So, is there any perf event I missed? Or can I direct call specified system function with mask bit 14 was set to get these DMA memory event?

0

There are 0 best solutions below