SystemTap on CentOS

Install systemtap and the kernel-devel package:

yum install systemtap kernel-devel

Unfortunately CentOS doesn't come with any yum repository for the necessary debuginfo files. You can sometimes find precompiled packages at http://debuginfo.centos.org/ Make sure you download the debuginfo files matching your kernel exactly. You can find out which kernel release and architecture you are running with:

uname -rm

You will need both the kernel-debuginfo and the kernel-debuginfo-common packages from http://debuginfo.centos.org/. Install them with:

rpm -Uhv kernel-debuginfo-*rpm

Note that kernel-debug is a different package: it is a variant of the base kernel that compiles in internal kernel checks like lockdep. It's good stuff, but not necessary for systemtap. If you do want to run it with systemtap, then you'll need the kernel-debug-devel and kernel-debug-debuginfo packages.

If no debuginfo packages for your kernel are (yet) available on http://debuginfo.centos.org/ then you will have to recompile the kernel packages by hand. Unfortunately CentOS doesn't come with a default yum source repository file installed. You can add one by adding the following as /etc/yum.repos.d/CentOS-SRPMS.repo

[base-SRPMS]
name=CentOS-$releasever - Base SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1

#released updates
[update-SRPMS]
name=CentOS-$releasever - Updates SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1

Then you can rebuild the kernel including matching debuginfo packages with:

yum install yum-utils
yumdownloader --source kernel
rpmbuild --rebuild kernel-*.el5.src.rpm

And install them as above.

If you want to build systemtap from source as described in the README note that you will need a more recent elfutils package from http://fedorahosted.org/elfutils/ then configure --with-elfutils=ELFUTILS-SOURCE-DIR (configure will tell you if the elfutils you have installed is not recent enough).

None: SystemTapOnCentOS (last edited 2008-09-12 12:57:51 by MarkWielaard)