Probe Alias Usage; Unused Alias Variables; Variables; Auxiliary Functions - Red Hat ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE Reference Manual

Systemtap language reference
Hide thumbs Also See for ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE:
Table of Contents

Advertisement

Probe alias usage

probe syscall.read += kernel.function("sys_read") {
if (traceme) println ("tracing me")
}
3.2.3. Probe alias usage
A probe alias is used the same way as any built-in probe type, by naming it:
probe syscall.read {
printf("reading fd=%d\n", fildes)
}

3.2.4. Unused alias variables

An unused alias variable is a variable defined in a probe alias, usually as one of a group of var =
$var assignments, which is not actually used by the script probe that instantiates the alias. These
variables are discarded.

3.3. Variables

Identifiers for variables and functions are alphanumeric sequences, and may include the underscore
(_) and the dollar sign ($) characters. They may not start with a plain digit. Each variable is by default
local to the probe or function statement block where it is mentioned, and therefore its scope and
lifetime is limited to a particular probe or function invocation. Scalar variables are implicitly typed as
either string or integer. Associative arrays also have a string or integer value, and a tuple of strings or
integers serves as a key. Arrays must be declared as global. Local arrays are not allowed.
The translator performs type inference on all identifiers, including array indexes and function
parameters. Inconsistent type-related use of identifiers results in an error.
Variables may be declared global. Global variables are shared among all probes and remain
instantiated as long as the SystemTap session. There is one namespace for all global variables,
regardless of the script file in which they are found. Because of possible concurrency limits, such as
multiple probe handlers, each global variable used by a probe is automatically read- or write-locked
while the handler is running. A global declaration may be written at the outermost level anywhere in
a script file, not just within a block of code. Global variables which are written but never read will be
displayed automatically at session shutdown. The following declaration marks var1 and var2 as
global. The translator will infer a value type for each, and if the variable is used as an array, its key
types.
global var1[=<value>], var2[=<value>]

3.4. Auxiliary functions

General syntax:
11

Advertisement

Table of Contents
loading

Table of Contents