Systemtap

From OLPC
Revision as of 01:56, 1 December 2006 by 66.187.230.198 (talk) (finish up first notes)
Jump to navigation Jump to search

Getting the Tools

Get the rpms from here:

http://olpc.download.redhat.com/kernel/RPMS/i586/

Install them.

Get a patched systemtap from here:

git clone git://dev.laptop.org/users/cjb/systemtap-olpc

Build it:

./configure --with-elfutils=./elfutils-0.123 make all sudo make install

global indent

function timestamp() {
  return sprint(gettimeofday_ms()) . indent[pid()] . " "
}
probe kernel.function("sys_open") {
  if ($flags & 1) {
    print(timestamp() . execname() . " writes " . user_string($filename) . "\n")
  } else {
    print(timestamp() . execname() . " reads " . user_string($filename) . "\n")
  }
} 

stap -r 2.6.18-20061112.7.olpc.714e2030f905b0e -S . ~/whichfiles.stap ... Module saved as ./stap_16665.ko

cp ./stap_16665.ko /media/usbdisk

cp /usr/local/bin/staprun /media/usbdisk

put the disk in the olpc, copy stuff over

./staprun stap_16665.ko > foo.txt

Hit ctrl-c to stop and then read foo.txt. Then drink heavily.