System information
SystemTap—Filtering and Analyzing System Data 75
• kernel-*-devel
• kernel-source-*
• gcc
To get access to the man pages and to a helpful collection of example SystemTap
scripts for various purposes, additionally install the systemtap-docs package.
To check if all packages are correctly installed on the machine and if SystemTap is
ready to use, execute the following command as root.
stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
It probes the currently used kernel by running a script and returning an output. If the
output is similar to the following, SystemTap is successfully deployed and ready to
use:
Pass : parsed user script and 59 library script(s) in 80usr/0sys/214real ms.
Pass : analyzed script: 1 probe(s), 11 function(s), 2 embed(s), 1 global(s)
in
140usr/20sys/412real ms.
Pass : translated to C into
"/tmp/stapDwEk76/stap_1856e21ea1c246da85ad8c66b4338349_4970.c" in
160usr/0sys/408real ms.
Pass : compiled C into "stap_1856e21ea1c246da85ad8c66b4338349_4970.ko" in
2030usr/360sys/10182real ms.
Pass : starting run.
read performed
Pass (page75): run completed in 10usr/20sys/257real ms.
Checks the script against the existing tapset library in /usr/share/sys
temtap/tapset/ for any tapsets used. Tapsets are scripts that form a library
of pre-written probes and functions that can be used in SystemTap scripts.
Examines the script for its components.
Translates the script to C. Runs the system C compiler to create a kernel mod-
ule from it. Both the resulting C code (*.c) and the kernel module (*.ko) are
stored in the SystemTap cache, ~/.systemtap.
Loads the module and enables all the probes (events and handlers) in the script
by hooking into the kernel. The event being probed is a Virtual File System
(VFS) read. As the event occurs on any processor, a valid handler is executed
(prints the text read performed) and closed with no errors.
After the SystemTap session is terminated, the probes are disabled, and the ker-
nel module is unloaded.