A guide on how to install Systemtap on an Ubuntu system (Gutsy+)

Get the systemtap package

Quite easy:

sudo apt-get install systemtap

Kernel support

The generic kernel comes with CONFIG_DEBUG_FS, CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_INFO and CONFIG_KPROBES enabled, so no recompilation needed.

libdwfl needs an uncompressed, unstripped kernel image, so install the package linux-image-debug-<yourkernelversion>. The easiest way, if you use linux-image-generic meta-package:

sudo apt-get install linux-image-debug-generic

This will install /boot/vmlinux-debug-<yourkernelversion>.

Now create a symlink for vmlinux in /lib/modules:

sudo ln -s /boot/vmlinux-debug-$(uname -r) /lib/modules/$(uname -r)/vmlinux

Devel environment

Kernel headers and gcc are needed for module compilation, so if you have not done so, install them (assuming the usage of generic kernel again): libcap-dev needed for Systemtap packages > 0.6-1

sudo apt-get install linux-headers-generic gcc libcap-dev

Test & enjoy

stap -e 'probe kernel.function("sys_open") {log("hello world") exit()}'
hello world

Building SystemTap mainline

It's also simple to build SystemTap from source snapshots or from Git HEAD. (Tested on Hardy)

sudo apt-get install git-core dejagnu
sudo apt-get build-dep systemtap
cd path/to/systemtap
./configure --disable-pie
make && sudo make install

Note: snapshots older than 2008-06-27 had trouble linking to the system libdw in the configure step. You can try "./configure --enable-staticdw" instead, or just download a newer snapshot.

None: SystemtapOnUbuntu (last edited 2008-07-08 01:23:21 by FChE)