Log memory access causing severe page crashes

Does anyone know how to access memory (pointers) causing page errors? I am mainly interested in the main page errors.

A little about what I'm trying to achieve. I have an application with a large memory footprint (database), and I want to associate paging with access to large data structures (for example, tables, indexes that are allocated using mmap ()). Process mappings are easily extracted from / proc // maps. Now, if I have memory accesses that cause page crashes, I can track how many page errors occur when accessing each data structure.

I think a performance or system image could do the job. Any ideas?

+5
source share
2 answers

See what is available at the probe point:

% stap -L vm.pagefault
vm.pagefault name:string write_access:long address:long $mm:struct mm_struct* \
   $vma:struct vm_area_struct* $address:long unsigned int $flags:unsigned int

Log, attempt to match addresses with character names

# stap -e 'probe vm.pagefault { if (execname()=="foo") { printf("%p (%s)\n", address, usymdata(address)) } }' -d /bin/foo --ldd

See also: http://sourceware.org/systemtap/examples/#memory/pfaults.stp

+6
source

Your guess is correct. You can use the primary program to track the number of page errors caused by your application.

I recommend that you read this tutorial to learn how to use this tool.

To establish only use:

You are looking for the page-fault event . You can install (in ubuntu or another apt distribution):

sudo apt-get install linux-tools-common linux-base 
sudo apt-get install linux-tools-YOUR-KERNEL number

You can get your kernel number with: uname -r

As an example, this command launches the main tool in the "ls" command:

perf record -e page-faults:u -F 250 ls

( "ls" , )

perf report
+6

All Articles