how can I get page fault addressed with perf
Hi, I want to trace page faults in my program. The result I wanted like this: 1st page fault at addrA. 2nd page fault at addrB. 3rd page fault at addrC ... Perf seems providing this function, but I can't get what I want. I use Perf on Fedora 14(kernel 2.6.35). The following is what I have done in my machine. Thanks for help in advance. [root@localhost lab]# perf record -R -c 1 -d -e faults ./hello hello,world [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.010 MB perf.data (~418 samples) ] [root@localhost lab]# perf report -n # Events: 91 cycles # # Overhead Samples Command Shared Object Symbol # ........ .......... ....... ................. ...... # 10.99% 10 hello ld-2.12.90.so [.] .L198 6.59% 6 hello ld-2.12.90.so [.] _dl_load_cache_lookup 6.59% 6 hello ld-2.12.90.so [.] _dl_lookup_symbol_x 4.40% 4 hello ld-2.12.90.so [.] dl_main 3.30% 3 hello ld-2.12.90.so [.] _dl_start 3.30% 3 hello ld-2.12.90.so [.] _dl_cache_libcmp 3.30% 3 hello ld-2.12.90.so [.] do_lookup_x 2.20% 2 hello libc-2.12.90.so [.] _init 2.20% 2 hello libc-2.12.90.so [.] _IO_file_overflow_internal 2.20% 2 hello ld-2.12.90.so [.] _dl_map_object_from_fd 2.20% 2 hello ld-2.12.90.so [.] _dl_init_paths 2.20% 2 hello ld-2.12.90.so [.] _dl_setup_hash 2.20% 2 hello ld-2.12.90.so [.] .L302 .......................
Hi... On Sun, Mar 20, 2011 at 16:15, zhao bao <baozhao@gmail.com> wrote:
Hi, I want to trace page faults in my program. The result I wanted like this: 1st page fault at addrA. 2nd page fault at addrB. 3rd page fault at addrC
Not sure about perf, but once I got the same idea when I wanna simulate in the simplest way on how stuffs like Xen manage shadow page table. The idea is by piggy backing SIGSEGV handler. I was heavily inspired by Phrack : http://www.phrack.org/issues.php?issue=58&id=3 Check the =[ 0x01 ]= part "Subject: Getting rid of SIGSEGV - for fun but not for profit" Good luck... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (2)
-
Mulyadi Santosa -
zhao bao