Q: How do I count page faults when running a programme 
Author Message
 Q: How do I count page faults when running a programme

Hi,

my problem is: how do I count page faults to monitor I/O-traffic while
running a program. I'm programming a triangulation in C using Linux
and gcc. To provide evidence that my data structure is superior to
another one I want to know how many times pages are loaded into upper
memory. Is it necessary to include this feature directly into the
program, or do I need to monitor the program externally with another
tool? In both cases, how can the information of page faults be
derived? In case it has to be included directly into the program codes
snips might be handy.

Any hints?

Cheers, Uli



Mon, 14 Nov 2005 14:30:42 GMT  
 Q: How do I count page faults when running a programme


Quote:
> my problem is: how do I count page faults to monitor I/O-traffic while
> running a program.

You can't with ISO C and its libraries. You'll need systems specific help
not provided by C.


Mon, 14 Nov 2005 20:26:34 GMT  
 Q: How do I count page faults when running a programme

Quote:

> Hi,

> my problem is: how do I count page faults to monitor I/O-traffic while
> running a program. I'm programming a triangulation in C using Linux
> and gcc. To provide evidence that my data structure is superior to
> another one I want to know how many times pages are loaded into upper
> memory. Is it necessary to include this feature directly into the
> program, or do I need to monitor the program externally with another
> tool? In both cases, how can the information of page faults be
> derived? In case it has to be included directly into the program codes
> snips might be handy.

> Any hints?

> Cheers, Uli

The time utility (not the one built into bash, you have to give the full
path) does that. Try:

/usr/bin/time --verbose <your command>

/usr/bin/time more or less prints what getrusage(2) returns, so you
might want to try that, if you want to built a monitor into you
program. However, since the getrusage implementation is somewhat broken
under linux (returns many zeroes), you might also consider monitoring
/proc/self/stat.

M.

--
The text above is a result of a bug in my newsreader and I take no
responsibility for this text appearing in my post.



Mon, 14 Nov 2005 20:45:27 GMT  
 Q: How do I count page faults when running a programme

Quote:

> /usr/bin/time more or less prints what getrusage(2) returns, so you
> might want to try that, if you want to built a monitor into you program.
> However, since the getrusage implementation is somewhat broken under

under many platforms.

Quote:
> linux (returns many zeroes), you might also consider monitoring
> /proc/self/stat.

But ru_majflt is what he's looking for I think and it *is* populated.

Mike



Wed, 16 Nov 2005 14:19:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Page Fault in MFC42.DLL run time error

2. page fault in module MFC42.DLL run time error

3. Problems after running programme for the 4th time

4. how tell if another programme is running

5. how to run another application in my programme?

6. run a programme with low priority

7. Page count for files

8. Crystal Reports.NET Total Page Count

9. Save as: Web page Archive, can it be done programmatically

10. Counting lines per page

11. HTML page continues to load after ActiveX load is done

12. Counting pages

 

 
Powered by phpBB® Forum Software