stap utility to run SystemTap scripts.
Important
yum install systemtap systemtap-runtimestap-prepuname -r
Important
yum install and debuginfo-install commands. The debuginfo-install command is included with later versions of the yum-utils package (for example, version 1.1.10) and also requires an appropriate yum repository from which to download and install -debuginfo and -debuginfo-common packages. You can install the required -devel, -debuginfo, and -debuginfo-common packages for your kernel.
yum to download and install the relevant packages. Configure the channels with either the rhn-channel command or the Red Hat Network web interface. To obtain a list of the channels SystemTap needs on the system, use the following script:
#! /bin/bash
pkg=`rpm -q --whatprovides "redhat-release"`
releasever=`rpm -q --qf "%{version}" $pkg`
variant=`echo $releasever | tr -d "[:digit:]" | tr "[:upper:]" "[:lower:]" `
if test -z "$variant"; then
echo "No Red Hat Enterprise Linux variant (workstation/client/server) found."
exit 1
fi
version=`echo $releasever | tr -cd "[:digit:]"`
base=`uname -i`
echo "rhel-$base-$variant-$version"
echo "rhel-$base-$variant-$version-debuginfo"
echo "rhel-$base-$variant-optional-$version-debuginfo"
echo "rhel-$base-$variant-optional-$version"
rhel-x86_64-workstation-6 rhel-x86_64-workstation-6-debuginfo rhel-x86_64-workstation-optional-6-debuginfo rhel-x86_64-workstation-optional-6
rhn-channel --list command provides a list of channels the machine is currently subscribed to. If the machine is only subscribed to rhel-x86_64-workstation-6, use the following command with root and Red Hat Network administrator privileges for the machine to add the other channels:
rhn-channel --add \--channel=rhel-x86_64-workstation-6-debuginfo \--channel=rhel-x86_64-workstation-optional-6-debuginfo \--channel=rhel-x86_64-workstation-optional-6
yum installkernelname-devel-versiondebuginfo-installkernelname-version
kernelname with the appropriate kernel variant name (for example, kernel-PAE), and version with the target kernel's version. For example, to install the required kernel information packages for the kernel-PAE-2.6.18-53.1.13.el5 kernel, run:
yum install kernel-PAE-devel-2.6.18-53.1.13.el5debuginfo-install kernel-PAE-2.6.18-53.1.13.el5
stap-prep command is sufficient to install all needed kernel information packages. During it operation, the stap-prep command temporarily enables any repositories that are needed and available, but disabled by default.
yum and yum-utils installed and you are unable to install them on Red Hat Enterprise Linux 4 or 5, download and install the required kernel information packages manually. To generate the URL from which to download the required packages, use the following script:
#! /bin/bash
pkg=`rpm -q --whatprovides "redhat-release"`
releasever=`rpm -q --qf "%{version}" $pkg`
base=`uname -m`
echo "ftp://ftp.redhat.com/pub/redhat/linux/\
enterprise/$releasever/en/os/$base/Debuginfo"
rpm --force -ivh package_namesstap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'read performed and then exit properly once a virtual file system read is detected. If the SystemTap deployment was successful, it prints output similar to the following:
Pass 1: parsed user script and 45 library script(s) in 340usr/0sys/358real ms. Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 290usr/260sys/568real ms. Pass 3: translated to C into "/tmp/stapiArgLX/stap_e5886fa50499994e6a87aacdc43cd392_399.c" in 490usr/430sys/938real ms. Pass 4: compiled C into "stap_e5886fa50499994e6a87aacdc43cd392_399.ko" in 3310usr/430sys/3714real ms. Pass 5: starting run. read performed Pass 5: run completed in 10usr/40sys/73real ms.
Pass 5) indicate that SystemTap was able to successfully create the instrumentation to probe the kernel, run the instrumentation, detect the event being probed (in this case, a virtual file system read), and execute a valid handler (print text then close it with no errors).