Distribution of time spent in major page faults script

William Cohen wcohen@redhat.com
Wed May 2 13:41:00 GMT 2007


Hi all,

I was stuck in the jury duty Tuesday. While I was waiting to be called to sit on 
a jury I wrote the attached script. It generates the average time spent in a 
major page fault, the total time spent in the major page faults, the number of 
major page faults, and a distribution of the page faults. This script needs to 
use the systemtap snapshot because it uses the vm.pagefault.return.

What would like to do is extend this script to map the page faults back to the 
files that are causing the page faults.

For something like the startup of openoffice get something like the following:

# systemtap_write/install/bin/stap major_faults.stp -c ooffice
pid = 5676, execname = thunderbird-bin
avg 17903 = sum 537099 / count 30
  value |-------------------------------------------------- count
   1024 |                                                    0
   2048 |                                                    0
   4096 |@@                                                  2
   8192 |@@@@@@@@@@@@@@                                     14
  16384 |@@@@@@@@@@                                         10
  32768 |@@@@                                                4
  65536 |                                                    0
131072 |                                                    0

pid = 20714, execname = soffice.bin
avg 11464 = sum 6007554 / count 524
  value |-------------------------------------------------- count
      4 |                                                     0
      8 |                                                     0
     16 |                                                     1
     32 |                                                     0
     64 |                                                     1
    128 |@@                                                  14
    256 |@@@                                                 18
    512 |@@@@@@@                                             38
   1024 |@@@@@@@@@@                                          52
   2048 |@@@@                                                21
   4096 |@@@@@@@@@@@@@@                                      74
   8192 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@           201
  16384 |@@@@@@@@@@@@@@@@                                    83
  32768 |@@@                                                 17
  65536 |                                                     4
131072 |                                                     0
262144 |                                                     0

pid = 20732, execname = xkbcomp
avg 15499 = sum 92995 / count 6
  value |-------------------------------------------------- count
     64 |                                                   0
    128 |                                                   0
    256 |@                                                  1
    512 |@                                                  1
   1024 |                                                   0
   2048 |                                                   0
   4096 |                                                   0
   8192 |@                                                  1
  16384 |@@                                                 2
  32768 |@                                                  1
  65536 |                                                   0
131072 |                                                   0

pid = 20712, execname = javaldx
avg 7981 = sum 215504 / count 27
  value |-------------------------------------------------- count
     64 |                                                   0
    128 |                                                   0
    256 |@@@                                                3
    512 |@@                                                 2
   1024 |@@@                                                3
   2048 |@@@                                                3
   4096 |@@@@@@                                             6
   8192 |@@@@@@@                                            7
  16384 |@@                                                 2
  32768 |@                                                  1
  65536 |                                                   0
131072 |                                                   0

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: major_faults.stp
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070502/716e4cff/attachment.ksh>


More information about the Systemtap mailing list