System information
76 System Analysis and Tuning Guide
In case any error messages appear during the test, check the output for hints about any
missing packages and make sure they are installed correctly. Rebooting and loading
the appropriate kernel may also be needed.
5.3 Script Syntax
SystemTap scripts consist of the following two components:
SystemTap Events (Probe Points) (page77)
Name the kernel events at the associated handler should be executed. Examples
for events are entering or exiting a certain function, a timer expiring, or starting
or terminating a session.
SystemTap Handlers (Probe Body) (page78)
Series of script language statements that specify the work to be done whenever a
certain event occurs. This normally includes extracting data from the event con-
text, storing them into internal variables, or printing results.
An event and its corresponding handler is collectively called a probe. SystemTap
events are also called probe points. A probe's handler is also referred to as
probe body.
Comments can be inserted anywhere in the SystemTap script in various styles: using
either #, /* */, or // as marker.
5.3.1 Probe Format
A SystemTap script can have multiple probes. They must be written in the following
format:
probe event {statements}
Each probe has a corresponding statement block. This statement block must be en-
closed in { } and contains the statements to be executed per event.
Example5.1: Simple SystemTap Script
The following example shows a simple SystemTap script.
probe begin
{
printf ("hello world\n")