BSD - Can an mmap-using program learn, about each incurred pagefault?

This is Interesting: Free IT Magazines  
Home > Archive > BSD > September 2007 > Can an mmap-using program learn, about each incurred pagefault?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Can an mmap-using program learn, about each incurred pagefault?
Mikhail Teterin

2006-04-01, 2:30 pm

Hello!

My program reads input files via mmap "transparently", which works alright.

I'd now like to learn about each pagefault it incurs -- when the area of the
mmap-ed file is not already in RAM memory. Is there a way to do it?

I tried catching SIGSEGV, but that does not have any effect... Thanks!

-mi
John L. Templer

2007-09-27, 7:23 am

Mikhail Teterin wrote:
> Hello!
>
> My program reads input files via mmap "transparently", which works alright.
>
> I'd now like to learn about each pagefault it incurs -- when the area of the
> mmap-ed file is not already in RAM memory. Is there a way to do it?
>
> I tried catching SIGSEGV, but that does not have any effect... Thanks!
>
> -mi


I don't think you can get this with any of the standard APIs. However,
most recent versions of Unix and Linux have a proc file system, and
there may be a way to get at the information through that. Note that
this is highly system specific, and probably not that easy to do.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com