1. 安裝systemtap
$ sudo apt-get install systemtap
$ sudo apt-get install systemtap-sdt-dev
2. 安裝debuginfo:
wget http://www.domaigne.com/download/tools/get-dbgsym
chmod +x get-dbgsym
./get-dbgsym
3. 啟動stap
$ stap -e 'probe kernel.function("sys_open") {log("hello world") exit()}'
hello world
注:centos系統上的安裝方法:
yum install kernel-devel
yum --enablerepo=debug install kernel-debuginfo
yum install systemtap