Linux (or Ubuntu specific) tools to measure number of page faults
Colin Ian King
colin.king at canonical.com
Wed May 2 09:47:10 UTC 2012
On 01/05/12 02:53, Alfred Zhong wrote:
> Dear Ubuntu Developers, especially Kernel Hackers,
>
>
> This may be a stupid question, please excuse my ignorance.
>
> I am doing a project on Linux scheduler that trying to minimize number
> of page faults.
>
> I finished the algorithm implementation and I need to measure the
> effect. I am wondering if Linux provides tools to record number of page
> fault happened during the whole execution process?
>
> Basically, I want something like $ pfstat ./a.out page faults: 3
> Execution Time: 1003 ms
>
> Is there such a tool? I want to make sure before deciding to write one
> by myself, which will be a lot of work...
>
> Thanks a lot!
>
> Alfred
>
There are well defined APIs for collecting this kind of data, for
example you can collect the rusage info for an exiting child process
using wait3() or wait4().
References:
man 2 wait3
man 2 rusage
More information about the Ubuntu-devel-discuss
mailing list