Professional Documents
Culture Documents
restart
Stop and start SCRIPTs.
compile
Compile SCRIPTs but do not start them. If the scripts have
already been compiled, prompt for confirmation before
overwriting cache. Compile for the current kernel, or the
kernel release specified by the -r option.
onboot Make SCRIPTs part of the initramfs so that they are started
earlier during the boot process. This command is only
available on dracut-based systems. If no scripts are
specified, create a normal initramfs devoid of any SystemTap
files.
cleanup
Delete the compiled SCRIPTs from cache. If no scripts are
specified, then all compiled scripts are deleted. Only the
cache for the current kernel is deleted, or the kernel release
specified by the -r option. Prompt for confirmation before
deleting.
OPTIONS top
Many of the commands can also take options. However, since users
can't pass these options on boot, they are only meant for managing
scripts after boot and for testing. Available options are:
-c CONFIG_FILE
Specify a different configuration file in place of the default
one.
-R When using the start and stop commands, also include the
scripts' dependencies (recursively).
-r KERNEL_RELEASE
When using the compile, onboot, and cleanup commands, specify
the target kernel version rather than using the current one.
Must be in the same format as `uname -r`.
-y Answer yes for all prompts.
-o PATH.IMG
When using the onboot command, specify the output path of the
created initramfs. When specified, the bootloader
configuration is not updated.
SCRIPT_PATH
Specify the absolute path of the script directory. These are
the scripts on which the initscript can operate. Scripts must
have the .stp extension. The default path is
${prefix}/etc/systemtap/script.d.
CONFIG_PATH
Specify the absolute path of the script configuration
directory. These configuration files contain options for
specific scripts. They must have the .conf extension. The
default path is ${prefix}/etc/systemtap/conf.d.
CACHE_PATH
Specify the absolute path of the cache directory. The default
path is ${prefix}/var/cache/systemtap.
TEMP_PATH
Specify the absolute path of the temporary directory in which
SystemTap makes temporary directories to compile scripts. The
default path is /tmp.
STAT_PATH
Specify the absolute path of the directory containing PID
files used to track the status of SystemTap scripts. The
default path is ${prefix}/var/run/systemtap.
LOG_FILE
Specify the absolute path of the log file. All messages are
sent to this file, including compilation and runtime errors.
The default path is ${prefix}/var/log/systemtap.log.
PASSALL
If this is set yes, initscript commands that operate on
multiple scripts will report as failed when the action could
not be performed on at least one script. If set to no, only a
warning is emitted. The default is yes.
RECURSIVE
If this is set yes, the initscript will always follow script
dependencies recursively. This means that there is no need to
specify the -R option. This flag is effective only if you
specify script(s) from the command-line. The default is no.
AUTOCOMPILE
If this is set yes, the initscript automatically tries to
compile specified scripts when needed if there is no valid
cache. Otherwise, the related command simply fails. The
default is yes.
DEFAULT_START
Specify scripts which will be started by default. If omitted
(or empty), all scripts in the script directory will be
started. The default is "".
ALLOW_CACHEONLY
If this is set yes, the initscript will also allow operating
on scripts that are located in the cache directory, but not in
the script directory. The default is no.
LOG_BOOT_ERR
Because boot-time scripts are run before the root filesystem
is mounted, staprun's stderr cannot be logged to the LOG_FILE
as usual. However, the log can instead be output to
/var/run/systemtap/$script.log by setting LOG_BOOT_ERR to yes.
If STAT_PATH is different from the default, the log files will
be moved there upon executing any of the initscript commands.
The default is no.
SCRIPT_PATH=/var/systemtap/script.d/
PASSALL=yes
RECURSIVE=no
SCRIPT PARAMETERS top
These parameters affect the compilation or runtime behaviour of
specific SystemTap scripts. They must be placed in config files
located in the CONFIG_PATH directory.
<SCRIPT>_OPT
Specify options passed to the stap(1) command for the SCRIPT.
Here, SCRIPT is the name of the script file without the .stp
extension. Note that the -F option is always added.
<SCRIPT>_REQ
Specify script dependencies (i.e. which script this script
requires). For example, if foo.stp requires (or needs to run
after) bar.stp, set
foo_REQ="bar"
script1_OPT="-o /var/log/script1.out"
script2_OPT="-o /var/log/script2.out"
script2_REQ="script1"
EXAMPLES top
INSTALLING SCRIPTS
We first copy a SystemTap script (e.g. "script1.stp") into the
script directory:
# cp script1.stp /etc/systemtap/script.d/
# vi /etc/systemtap/conf.d/group1.conf
script1_OPT="-o /var/log/group1.out"
# cp script2.stp /etc/systemtap/script.d/
# vi /etc/systemtap/conf.d/group1.conf
script2_OPT="-o /var/log/group2.out"
script2_REQ="script1"
TESTING
After installing scripts, we can test that they work by simply
doing:
# systemtap-service start
# systemtap-service stop
ENABLING SERVICE
After we're satisfied with the scripts and their tests, we can
enable the SystemTap initscript service:
# chkconfig systemtap on
DELETING SCRIPTS
Scripts are deleted by simply removing them from the script
directory and removing any configuration lines specific to
them:
# rm /etc/systemtap/script.d/script2.stp
# vi /etc/systemtap/conf.d/group1.conf
And then copy this package to the target machine and extract
it.
# cp myscript.stp /etc/systemtap/script.d
# vi /etc/systemtap/conf.d/myscript.conf
# systemtap-service onboot