The total page faults on a process can be obtained by /proc//statm, but how can I know how many happened on a specific mmaped area? Thanks
Asked
Active
Viewed 84 times
0
-
1I'd try perf_event_open with PERF_COUNT_SW_PAGE_FAULTS and PERF_SAMPLE_ADDR. If you really need all the faults, you might try using sample_period = 1 (?). – ysdx Aug 24 '15 at 08:04
-
Thanks @ysdx, but can that be set to a range of address or just a single address? Because I want to know page fault happens on a range of memory address. – Bill Randerson Aug 24 '15 at 09:48
-
It would give you the address of each page fault. You then have to find the corresponding VMA. – ysdx Aug 24 '15 at 10:17
-
@ysdx, that would be enough for me. I can parse the address my self. – Bill Randerson Aug 24 '15 at 10:27
-
@ysdx, is the PERF_SAMPLE_ADDRE can be used with perf command? – Bill Randerson Aug 24 '15 at 10:27