4 staprun \- systemtap runtime
22 program is the back-end of the Systemtap tool. It expects a kernel
23 module produced by the front-end
27 Splitting the systemtap tool into a front-end and a back-end allows a
28 user to compile a systemtap script on a development machine that has
29 the kernel development tools (needed to compile the script) and then
30 transfer the resulting kernel module to a production machine that
31 doesn't have any development tools installed.
33 Please refer to stappaths (7) for the version number, or run
34 rpm \-q systemtap (fedora/red hat)
35 apt\-get \-v systemtap (ubuntu)
40 program supports the following options. Any other option
41 prints a list of supported options.
44 Verbose mode. The level of verbosity is also set in the
49 Print version number and exit.
52 Suppress warnings from the script.
55 Load the uprobes.ko module.
58 Command CMD will be run and the
60 program will exit when CMD
61 does. The '_stp_target' variable will contain the pid for CMD.
64 The '_stp_target' variable will be set to PID.
67 Send output to FILE. If the module uses bulk mode, the output will
68 be in percpu files FILE_x(FILE_cpux in background and bulk mode)
69 where 'x' is the cpu number. This supports strftime(3) formats
73 The systemtap module will specify a buffer size.
74 Setting one here will override that value. The value should be
75 an integer between 1 and 4095 which be assumed to be the
76 buffer size in MB. That value will be per-cpu if bulk mode is used.
79 Load module and start probes, then detach from the module leaving the
80 probes running. The module can be attached to later by using the
85 Attach to loaded systemtap module.
88 Control coloring of error messages. WHEN must be either
90 "never", "always", or "auto"
92 (i.e. enable only if at a terminal). If the option is missing, then "auto"
93 is assumed. Colors can be modified using the SYSTEMTAP_COLORS environment
96 manual page for more information on syntax and behaviour.
99 Delete a module. Only detached or unused modules
100 the user has permission to access will be deleted. Use "*"
101 (quoted) to delete all unused modules.
104 Run staprun in background as a daemon and show it's pid.
107 Rename the module to a unique name before inserting it.
110 Pass the given number and URI data to the tapset functions
111 remote_id() and remote_uri().
114 Sets the maximum size of output file and the maximum number of output files.
115 If the size of output file will exceed
117 , systemtap switches output file to the next file. And if the number of
120 , systemtap removes the oldest output file. You can omit the second argument.
123 Sets maximum time reader thread will wait before dumping trace buffer. Value is
124 in ms, default is 200ms. Setting this to a high value decreases number of stapio
125 wake-ups, allowing deeper sleep for embedded platforms. But it impacts interactivity
126 on terminal as traces are dumped less often in case of low throughput.
127 There is no interactivity or performance impact for high throughput as trace is
128 dumped when buffer is full, before this timeout expires.
131 Sets the value of global variable var1 to val. Global variables contained
132 within a module are treated as module options and can be set from the
133 staprun command line.
137 is either a module path or a module name. If it is a module name,
138 the module will be looked for in the following directory
139 (where 'VERSION' is the output of "uname \-r"):
141 /lib/modules/VERSION/systemtap
143 .\" TODO - we probably need a better description here.
144 Any additional arguments on the command line are passed to the
145 module. One use of these additional module arguments is to set the value
146 of global variables declared within the module.
149 \& $ stap \-p4 \-m mod1 \-e\ \[aq]global var1="foo"; probe begin{printf("%s\\n", var1); exit()}\[aq]
152 Running this with an additional module argument:
155 \& $ staprun mod1.ko var1="HelloWorld"
159 Spaces and exclamation marks currently cannot be passed into global variables
165 manual page for a collection of sample scripts.
167 Here is a very basic example of how to use
171 to compile a script. The
173 program will report the pathname to the resulting module.
175 \& $ stap \-p4 \-e \[aq]probe begin { printf("Hello World!\\n"); exit() }\[aq]
177 \& /home/user/.systemtap/cache/85/stap_8553d83f78c_265.ko
181 with the pathname to the module as an argument.
183 \& $ staprun /home/user/.systemtap/cache/85/stap_8553d83f78c_265.ko
186 .SH MODULE DETACHING AND ATTACHING
189 program installs a Systemtap kernel module, users can detach from the
190 kernel module and reattach to it later. The
192 option loads the module and automatically detaches. Users can also
193 detach from the kernel module interactively by sending the SIGQUIT
194 signal from the keyboard (typically by typing Ctrl\-\\).
196 To reattach to a kernel module, the
199 option would be used.
201 .SH FILE SWITCHING BY SIGNAL
206 program, users can command it to switch output file to next file when it
207 outputs to file(s) (running staprun with
213 process. When it receives SIGUSR2, it will switch output file to
216 where N is the sequential number.
219 \& $ staprun \-o foo ...
221 outputs trace logs to
225 signal, it switches output to
229 again, it switches to
233 .SH SAFETY AND SECURITY
234 Systemtap, in the default kernel-module runtime mode, is an
235 administrative tool. It exposes kernel internal data structures and
236 potentially private user information. See the
238 manual page for additional information on safety and security.
240 To increase system security, users of systemtap must be root, or in the
242 group in order to execute this setuid
245 A user may select a particular privilege level with the stap
254 group can write and load script modules with root-equivalent
255 privileges, without particular security constraints. (Many safety
261 group have almost all the privileges of
263 except for guru mode constructs.
268 group may any-privileged modules placed into the /lib/modules/VERSION/systemtap
269 by the system administrator.
274 group may also write and load low-privilege script modules, which are normally
275 limited to manipulating their own processes (and not the kernel nor other users'
278 Part of the privilege enforcement mechanism may require using a
279 stap-server and administrative trust in its cryptographic signer; see the
281 manual page for a for more information.
284 On a kernel with FIPS mode enabled, staprun normally refuses to attempt to
285 load systemtap-generated kernel modules. This is because on some kernels,
286 this results in a panic. If your kernel includes corrections such as
287 linux commit #002c77a48b47, then you can force staprun to attempt module
288 loads anyway, by setting the
289 .BR STAP\_FIPS\_OVERRIDE
290 environment variable to any value.
294 /lib/modules/VERSION/systemtap
295 If MODULE is a module name, the module will be looked for in this directory.
296 Users who are only in the
298 group can install modules
299 located in this directory. This directory must be owned by the root
300 user and not be world writable.
304 .IR stapprobes (3stap),
305 .IR stap\-server (8),
310 Use the Bugzilla link of the project web page or our mailing list.
312 .BR http://sourceware.org/systemtap/ ", " <systemtap@sourceware.org> .