[comp.unix.i386] page fault monitoring tools wanted.

pb@idca.tds.PHILIPS.nl (Peter Brouwer) (11/14/89)

I am looking for software ( tools ) that can monitor page faults.
Let me explain:
To give programmers an idea on how the working set of there code and data
is it would be nice if they could enable a page monitoring option.
With this tool one could see which routines causes pagefaults. By grouping
source and linking object in a specific order one could reduce the working
set and the number of pagefaults.

Does anyone knows if there is such a tool / software to buils such a tool?


-- 
Peter Brouwer,                # Philips Telecommunications and Data Systems,
NET  : pb@idca.tds.philips.nl # Department SSP-P9000 Building V2,
UUCP : ....!mcvax!philapd!pb  # P.O.Box 245, 7300AE Apeldoorn, The Netherlands.
PHONE:ext [+31] [0]55 432523, # Never underestimate the power of human stupidity

dwc@cbnewsh.ATT.COM (Malaclypse the Elder) (11/15/89)

In article <541@ssp2.idca.tds.philips.nl>, pb@idca.tds.PHILIPS.nl (Peter Brouwer) writes:
> I am looking for software ( tools ) that can monitor page faults.

i have one.  i wrote about it in the 1988 summer usenix proceedings
(in san francisco).  it is part of a tracing package called CASPER.
the way it currently works is to arrange for the clock interrupt handler
to invalidate the pages of the currently running process, and hooks
in the page fault handler to write out a trace of the faults.  i am
updating it to simply look at the page table entry use bits so that
all i have to do is install a pseudo-device driver instead of running
with modified kernel code.

after about 2 years, we may finally be able to license CASPER (which
is more general than just memory reference tracing) out.  if you are
interested, send me mail and i'll keep you posted.

> Let me explain:
> To give programmers an idea on how the working set of there code and data
> is it would be nice if they could enable a page monitoring option.
> With this tool one could see which routines causes pagefaults. By grouping
> source and linking object in a specific order one could reduce the working
> set and the number of pagefaults.
> 

i have also been working on this.  it is a bit harder than you think
(at least more difficult than what you describe above).  a function
my cause a page fault if it is the first function to be called in a
page.  other functions in that page will not fault once the page is
valid.  my page sampling technique helps a bit but it is only sampling.
what i did as a first cut is to obtain a trace of all function calls
in a program (CASPER helps you do all this).  using this trace, moved
functions to achieve a minimum cost function (whatever you want it to be).
it works but is very time consuming and there are questions about what
input data to obtain a trace from.  i am now investigating source code
analysis techniques to determine address space layout of both text and data.
its non-trivial.

danny chen
att!hocus!dwc