<div>Thank you all so much! </div><br><div class="gmail_quote">On Wed, May 2, 2012 at 5:47 AM, Colin Ian King <span dir="ltr"><<a href="mailto:colin.king@canonical.com" target="_blank">colin.king@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 01/05/12 02:53, Alfred Zhong wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Ubuntu Developers, especially Kernel Hackers,<br>
<br>
<br>
This may be a stupid question, please excuse my ignorance.<br>
<br>
I am doing a project on Linux scheduler that trying to minimize number<br>
of page faults.<br>
<br>
I finished the algorithm implementation and I need to measure the<br>
effect. I am wondering if Linux provides tools to record number of page<br>
fault happened during the whole execution process?<br>
<br>
Basically, I want something like $ pfstat ./a.out page faults: 3<br>
Execution Time: 1003 ms<br>
<br>
Is there such a tool? I want to make sure before deciding to write one<br>
by myself, which will be a lot of work...<br>
<br>
Thanks a lot!<br>
<br>
Alfred<br>
<br>
</blockquote></div></div>
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().<br>
<br>
References:<br>
man 2 wait3<br>
man 2 rusage<br>
<br>
<br>
</blockquote></div><br>