Systemtap: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
 
(finish up first notes)
Line 16: Line 16:
make all
make all
sudo make install
sudo make install

<nowiki>
<pre>
global indent
global indent


Line 29: Line 30:
}
}
}
}
</nowiki>
</pre>


stap -r 2.6.18-20061112.7.olpc.714e2030f905b0e -S . ~/whichfiles.stap
stap -r 2.6.18-20061112.7.olpc.714e2030f905b0e -S . ~/whichfiles.stap
Line 36: Line 37:


cp ./stap_16665.ko /media/usbdisk
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.

Revision as of 01:56, 1 December 2006

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.