Troubleshooting tip: stap ~ systemtap script translator / driver command not working under CentOS Linux

Posted on in Categories CentOS, Linux, Sys admin, Troubleshooting last updated September 25, 2007

The stap program is the front-end to the Systemtap tool. It accepts probing instructions (written in a simple scripting language), translates those instructions into C code, compiles this C code, and loads the resulting kernel module into a running Linux kernel to perform the requested system trace/probe functions.

SystemTap provides free software (GPL) infrastructure to simplify the gathering of information about the running Linux system. This assists diagnosis of a performance or functional problem. SystemTap eliminates the need for the developer to go through the tedious and disruptive instrument, recompile, install, and reboot sequence that may be otherwise required to collect data.

We have several developers who use stap. Usually it works out of box. For example following program prints hello world on screen if SystemTap and related packages are installed:

stap -e 'probe begin { log ("hello world") }'

However under CentOS Linux version 5 (RHEL 5), you will get an error as follows:

semantic error: libdwfl failure (dwfl_linux_kernel_report_offline): No such file or directory while resolving probe point kernel.function("sys_*")

Install kernel-debuginfo package

To get rid of this problem, you have to simply install kernel-debuginfo package:
# yum install kernel-debuginfo
Please note that the installed kernel-debuginfo package must be for the same kernel release level and processor, so you may have to enter the following command:
# yum install kernel-debuginfo-KERNEL-VERSION-NUMBER

Hope this troubleshooting tip will help you out while working with systemtap (stap) scripts.