In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, SystemTap () is a
scripting language
In computing, a script is a relatively short and simple set of instructions that typically automation, automate an otherwise manual process. The act of writing a script is called scripting. A scripting language or script language is a programming ...
and
tool
A tool is an Physical object, object that can extend an individual's ability to modify features of the surrounding environment or help them accomplish a particular task. Although many Tool use by animals, animals use simple tools, only human bei ...
for dynamically
instrumenting running production
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
-based
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s. System administrators can use SystemTap to extract, filter and summarize data in order to enable diagnosis of complex performance or functional problems.
SystemTap consists of
free and open-source software
Free and open-source software (FOSS) is software available under a license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term encompassing free ...
and includes contributions from
Red Hat
Red Hat, Inc. (formerly Red Hat Software, Inc.) is an American software company that provides open source software products to enterprises and is a subsidiary of IBM. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North ...
,
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
,
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
,
Hitachi
() is a Japanese Multinational corporation, multinational Conglomerate (company), conglomerate founded in 1910 and headquartered in Chiyoda, Tokyo. The company is active in various industries, including digital systems, power and renewable ener ...
,
Oracle
An oracle is a person or thing considered to provide insight, wise counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. If done through occultic means, it is a form of divination.
Descript ...
, the University of Wisconsin-Madison and other community members.
History
SystemTap debuted in 2005 in
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a commercial Linux distribution developed by Red Hat. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop version for x86-64. Fedora Linux and ...
4 Update 2 as a technology preview.
After four years in development, SystemTap 1.0 was released in 2009.
, SystemTap runs fully supported in all Linux distributions including
RHEL / CentOS 5 since update 2, SLES 10, Fedora, Debian and Ubuntu.
Tracepoints in the
CPython
CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the Python language.
CPython can be defined as both an interpreter and a comp ...
VM and
JVM
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally descri ...
were added in SystemTap 1.2 in 2009.
In November 2019, SystemTap 4.2 included
prometheus
In Greek mythology, Prometheus (; , , possibly meaning "forethought")Smith"Prometheus". is a Titans, Titan. He is best known for defying the Olympian gods by taking theft of fire, fire from them and giving it to humanity in the form of technol ...
exporter.
Usage
SystemTap files are written in the SystemTap language (saved as
.stp
files) and run with the
stap
command-line.
The system carries out a number of analysis passes on the script before allowing it to run. Scripts may be executed with one of three backends selected by the
--runtime=
option. The default is a
loadable kernel module, which has the fullest capability to inspect and manipulate any part of the system, and therefore requires most privilege. Another backend is based on the
dynamic program analysis
Dynamics (from Greek δυναμικός ''dynamikos'' "powerful", from δύναμις ''dynamis'' " power") or dynamic may refer to:
Physics and engineering
* Dynamics (mechanics), the study of forces and their effect on motion
Brands and en ...
library DynInst to instrument the user's own user-space programs only, and requires least privilege. The newest backend is based on
eBPF byte-code, is limited to the
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
kernel interpreter's capabilities, and requires an intermediate level of privilege. In each case, the module is unloaded when the script has finished running.
Scripts generally focus on events (such as starting or finishing a script), compiled-in probe points such as Linux "tracepoints", or the execution of functions or statements in the kernel or user-space.
Some "guru mode" scripts may also have embedded C, which may run with the
-g
command-line option. However, use of guru mode is discouraged, and each SystemTap release includes more probe points designed to remove the need for guru-mode scripts. Guru mode is required in order to permit scripts to ''modify'' state in the instrumented software, such as to apply some types of emergency security fixes.
As of SystemTap version 1.7, the software implements the new ''stapsys'' group and privilege level.
Simple examples
The following script shows all applications setting
TCP socket options on the system, what options are being set, and whether the option is set successfully or not.
# Show sockets setting options
# Return enabled or disabled based on value of optval
function getstatus(optval)
probe begin
# Set a socket option
probe tcp.setsockopt
# Check setting the socket option worked
probe tcp.setsockopt.return
probe end
Many other examples are shipped with SystemTap. There are also real-world examples of SystemTap use at the War Stories page.
Importing scripts from other tracing technologies
SystemTap can attach to
DTrace
DTrace is a comprehensive dynamic tracing framework originally created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time.
Originally developed for Solaris, it has since been released un ...
markers when they are compiled into an application using macros from the
sys/sdt.h
header file.
See also
*
Kernel marker
Kernel markers were a static kernel instrumentation support mechanism for Linux kernel source code, allowing special tools such as LTTng Immediate Values - Documentation]
The initial motivation to create this static instrumentation infrastructure ...
*
dprobes, DProbes
*
LTTng
LTTng (Linux Trace Toolkit: next generation) is a system software package for correlated tracing of the Linux kernel, applications and libraries. The project was originated by Mathieu Desnoyers with an initial release in 2005. Its predecessor is ...
*
strace
*
ProbeVue
References
External links
*
SystemTap WikiSystemTap Language ReferencePDF
SystemTap project analysis by OhlohDynamic Tracing with DTrace & SystemTap''Systemtap tutorial''Frank Ch. Eigler
''SystemTap Beginner's Guide''Don Domingo, William Cohen
''Problem Solving With Systemtap''Ottawa Linux Symposium 2006
''Problem Solving with SystemTap'', Eugene Teo, presented at th
Red Hat Summit2007
scripts
''Dynamic Tracing and Performance Analysis Using SystemTap'' Joshua Stone, presented at th
LinuxWorld Conference2008
SystemTap Tutorial Jim Keniston, presented at th
Linux Plumbers Conference2008
{{Linux kernel
Free software programmed in C++
Free system software
Debuggers
Linux kernel features
Linux-only free software