kernelperfpage-fault

How can I use perf to measure page fault time during program execution?


I'm using perf to analyze the performance of a program, and I want to measure the time of page fault events that occur during program execution. However, I can't find an appropriate option or command to do so.

I have already tried using perf record and perf report commands, but I could only see the count of page fault events, not the time duration of each event.

Is there any way to use perf to measure the time of page fault events during program execution? If not, what other tools or approaches can I use to achieve this goal?

Thank you for your help.


Solution

  • You can try eBPF to know the time duration of each event. like execsnoop, you can trace page_fault event, and record time duration by Maps.