Measure page faults from a c program
问题 I am comparing a few system calls where I read/write from/to memory. Is there any API defined to measure page faults (pages in/out) in C ? I found this library libperfstat.a but it is for AIX , I couldn't find anything for linux. Edit: I am aware of time & perf-stat commands in linux, just exploring if there is anything available for me to use inside the C program. 回答1: There is getrusage function (SVr4, 4.3BSD. POSIX.1-2001; but not all fields are defined in standard). In linux there are