In the above probe descriptions, MPATTERN stands for a string literal that identifies the loaded
kernel module of interest and LPATTERN stands for a source program label. Both MPATTERN and
LPATTERN may include asterisk (*), square brackets "[]", and question mark (?) wildcards.
PATTERN stands for a string literal that identifies a point in the program. It is composed of three parts:
1. The first part is the name of a function, as would appear in the nm program's output. This part may
use the asterisk and question mark wildcard operators to match multiple names.
2. The second part is optional, and begins with the ampersand (@) character. It is followed by the
path to the source file containing the function, which may include a wildcard pattern, such as mm/
slab*. In most cases, the path should be relative to the top of the linux source directory, although
an absolute path may be necessary for some kernels. If a relative pathname doesn't work, try
absolute.
3. The third part is optional if the file name part was given. It identifies the line number in the
source file, preceded by a ":" or "+". The line number is assumed to be an absolute line number
if preceded by a ":", or relative to the entry of the function if preceded by a "+". All the lines in the
function can be matched with ":*". A range of lines x through y can be matched with ":x-y".
Alternately, specify PATTERN as a numeric constant to indicate a relative module address or an
absolute kernel address.
Some of the source-level variables, such as function parameters, locals, or globals visible in the
compilation unit, are visible to probe handlers. Refer to these variables by prefixing their name with
a dollar sign within the scripts. In addition, a special syntax allows limited traversal of structures,
pointers, and arrays.
$var refers to an in-scope variable var. If it is a type similar to an integer, it will be cast to a 64-bit
integer for script use. Pointers similar to a string (char *) are copied to SystemTap string values by the
kernel_string() or user_string() functions.
$var->field traverses a structure's field. The indirection operator may be repeated to follow
additional levels of pointers.
$var[N] indexes into an array. The index is given with a literal number.
$$vars expands to a character string that is equivalent to sprintf("parm1=%x ... parmN=%x
var1=%x ... varN=%x", $parm1, ..., $parmN, $var1, ..., $varN)
$$locals expands to a character string that is equivalent to sprintf("var1=%x ... varN=%x",
$var1, ..., $varN)
$$parms expands to a character string that is equivalent to sprintf("parm1=%x ... parmN=
%x", $parm1, ..., $parmN)
4.2.1. kernel.function, module().function
The .function variant places a probe near the beginning of the named function, so that parameters
are available as context variables.
General syntax:
kernel.function, module().function
17
Need help?
Do you have a question about the ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE and is the answer not in the manual?
Questions and answers