System information

SystemTap—Filtering and Analyzing System Data 77
exit ()
}
Start of the probe.
Event begin (the start of the SystemTap session).
Start of the handler definition, indicated by {.
First function defined in the handler: the printf function.
String to be printed by the printf function, followed by a line break (/n).
Second function defined in the handler: the exit() function. Note that the
SystemTap script will continue to run until the exit() function executes. If
you want to stop the execution of the script before, stop it manually by pressing
Ctrl + C.
End of the handler definition, indicated by }.
The event begin (the start of the SystemTap session) triggers the handler enclosed
in { }, in this case the printf function which prints hello world followed
by a new line , then exits.
If your statement block holds several statements, SystemTap executes these state-
ments in sequence—you do not need to insert special separators or terminators be-
tween multiple statements. A statement block can also be nested within another state-
ment blocks. Generally, statement blocks in SystemTap scripts use the same syntax
and semantics as in the C programming language.
5.3.2 SystemTap Events (Probe Points)
SystemTap supports a number of built-in events.
The general event syntax is a dotted-symbol sequence. This allows a breakdown of
the event namespace into parts. Each component identifier may be parametrized by a
string or number literal, with a syntax like a function call. A component may include
a * character, to expand to other matching probe points. A probe point may be fol-
lowed by a ? character, to indicate that it is optional, and that no error should result if
it fails to expand. Alternately, a probe point may be followed by a ! character to indi-
cate that it is both optional and sufficient.
SystemTap supports multiple events per probe—they need to be separated by a com-
ma (,). If multiple events are specified in a single probe, SystemTap will execute the
handler when any of the specified events occur.
In general, events can be classified into the following categories: