| 1 |
SYSTEMTAP EXAMPLES INDEX |
| 2 |
(see also keyword-index.txt) |
| 3 |
|
| 4 |
|
| 5 |
For systemtap version 5.4. |
| 6 |
|
| 7 |
apps/gmalloc_watch.stp - Tracing glib2 memory allocations |
| 8 |
keywords: trace |
| 9 |
|
| 10 |
The gmalloc_watch.stp script from Colin Walters' blog |
| 11 |
(https://blog.verbum.org/2011/03/19/analyzing-memory-use-with-systemt |
| 12 |
ap/) traces the allocation of glib2 memory using the markers in |
| 13 |
glib2. |
| 14 |
|
| 15 |
# stap gmalloc_watch.stp -T 1 |
| 16 |
|
| 17 |
|
| 18 |
apps/libguestfs_log.stp - Trace libguestfs startup |
| 19 |
keywords: application trace bpf |
| 20 |
|
| 21 |
The libguestfs_log.stp script prints a log of when various |
| 22 |
libgueststartup steps are encountered. The first column is |
| 23 |
microseconds since the script started. The second column is the time |
| 24 |
elapsed in microseconds between the previous and current events and |
| 25 |
the third column is the event name. |
| 26 |
|
| 27 |
# stap libguestfs_log.stp -T 1 |
| 28 |
|
| 29 |
|
| 30 |
apps/php-trace.stp - Tracing of PHP code execution |
| 31 |
keywords: trace dyninst |
| 32 |
|
| 33 |
Trace of executing PHP code using the enabled markers. |
| 34 |
|
| 35 |
# stap php-trace.stp -c 'php -f hello.php' |
| 36 |
|
| 37 |
|
| 38 |
apps/stap_time.stp - Provide elapsed times for Passes of SystemTap script compilation |
| 39 |
keywords: application trace |
| 40 |
|
| 41 |
SystemTap has multiple passes to convert the text of a SystemTap |
| 42 |
script into instrumentation that actually collect data on the system. |
| 43 |
The stap_time.stp script uses the markers in SystemTap to note the |
| 44 |
amount of time that each of the passes requires. When SystemTap |
| 45 |
completes pass 4 (compiling the instrumentation into a kernel module) |
| 46 |
the script print out the script name followed by the amount of time |
| 47 |
in milliseconds required for Pass 0 (command line option parsing), |
| 48 |
Pass 1 (script parsing), Pass 2 (elaboration), Pass 3 (code |
| 49 |
generation), and Pass 4 (module compilation). The resulting data can |
| 50 |
be analyzed to determine if there are issues with the amount of time |
| 51 |
that systemtap takes to generate instrumentation. |
| 52 |
|
| 53 |
# stap stap_time.stp -T 1 |
| 54 |
|
| 55 |
|
| 56 |
general/alias_suffixes.stp - Count I/O Syscalls using Alias Suffixes |
| 57 |
keywords: io statistics |
| 58 |
|
| 59 |
alias_suffixes.stp is a demonstration of how alias suffixes in the |
| 60 |
systemtap language might be used. The script tracks the wall clock |
| 61 |
time for each invocation of the system calls open, close, read, and |
| 62 |
write. When the script exists it prints out the minimum, average, and |
| 63 |
maximum times in microseconds for each system call, followed by a |
| 64 |
count of times that each syscall was invoked and a histogram showing |
| 65 |
the distributions of times. |
| 66 |
|
| 67 |
# stap alias_suffixes.stp -T 1 |
| 68 |
|
| 69 |
|
| 70 |
general/also_ran.stp - Keep a tally of executables run on the system |
| 71 |
keywords: prometheus |
| 72 |
|
| 73 |
The also_ran.stp script tallies each time a executable is started or |
| 74 |
a shared library is loaded for execution. This information can be |
| 75 |
useful to determine what software is actually being used on the |
| 76 |
system. The script makes the information available via procfs in |
| 77 |
Prometheus readable format. |
| 78 |
|
| 79 |
# stap also_ran.stp -T 1 |
| 80 |
|
| 81 |
|
| 82 |
general/ansi_colors.stp - Color Table for ansi_set_color() |
| 83 |
keywords: format bpf |
| 84 |
|
| 85 |
The script prints a table showing the available color combinations |
| 86 |
for the ansi_set_color() function in the ansi.stp tapset. |
| 87 |
|
| 88 |
# stap ansi_colors.stp |
| 89 |
|
| 90 |
|
| 91 |
general/ansi_colors2.stp - Show Attribues in Table for ansi_set_color() |
| 92 |
keywords: format bpf |
| 93 |
|
| 94 |
The script prints a table showing the available attributes (bold, |
| 95 |
underline, and inverse) with color combinations for the |
| 96 |
ans_set_color() function in the ansi.stp tapset. |
| 97 |
|
| 98 |
# stap ansi_colors2.stp |
| 99 |
|
| 100 |
|
| 101 |
general/badname.stp - Bad Filename Filter |
| 102 |
keywords: filesystem guru |
| 103 |
|
| 104 |
The badname.stp script shows how one could prevent the creation of |
| 105 |
files with undesirable names using guru mode. |
| 106 |
|
| 107 |
# stap -g badname.stp -c "touch /tmp/myXXXbadnameXXXfile.$$ 2>&1 | grep \ |
| 108 |
denied" |
| 109 |
|
| 110 |
|
| 111 |
general/callgraph.stp - Callgraph Tracing |
| 112 |
keywords: simple trace callgraph |
| 113 |
|
| 114 |
Print a timed per-thread microsecond-timed nested callgraph. The |
| 115 |
first parameter names the function probe points to trace. |
| 116 |
|
| 117 |
# stap callgraph.stp 'kernel.function("*@fs/proc*.c")' -c "cat \ |
| 118 |
/proc/sys/vm/* || true" |
| 119 |
|
| 120 |
|
| 121 |
general/cpu_throttle.stp - Monitor Intel processors for throttling due to power or thermal limits |
| 122 |
keywords: prometheus limits |
| 123 |
|
| 124 |
Intel processors have hardware mechanisms that will reduce the |
| 125 |
effective processors speed to avoid exceeding set thermal or power |
| 126 |
constraints. The cpu_throttle.stp script monitors when CPU throttling |
| 127 |
occurs and accumulates the amount of time in milliseconds that each |
| 128 |
processor is throttled. The script makes the information available |
| 129 |
via procfs in Prometheus readable format. |
| 130 |
|
| 131 |
# stap cpu_throttle.stp -T 1 |
| 132 |
|
| 133 |
|
| 134 |
general/eventcount.stp - Interactive Count Specified Events |
| 135 |
keywords: interactive statistics thread process |
| 136 |
|
| 137 |
The script periodically prints a count of specified events and their |
| 138 |
related tid's over the course of execution. Numerous configuration |
| 139 |
options exist to control filtering / reporting, some of which can be |
| 140 |
modified at runtime. See the script source for more information. |
| 141 |
|
| 142 |
# stap eventcount.stp 'syscall_any' -c 'sleep 3' |
| 143 |
|
| 144 |
|
| 145 |
general/floatingpoint.stp - SystemTap "Floating Point" Program |
| 146 |
keywords: simple floatingpoint |
| 147 |
|
| 148 |
A basic "Floating Point" program implemented in SystemTap script. It |
| 149 |
extracts floating point from benchmark-sdt section in main.cxx and |
| 150 |
takes one pseudo floating point, printing out results of various |
| 151 |
simple floating point operations. |
| 152 |
|
| 153 |
# stap floatingpoint.stp -c "stap --benchmark-sdt" |
| 154 |
|
| 155 |
|
| 156 |
general/func_time_stats.stp - Function Time Statistics |
| 157 |
keywords: function statistics |
| 158 |
|
| 159 |
The func_time_stats.stp script tracks the wall clock time for each |
| 160 |
invocation of the function probe listed as the first command line |
| 161 |
argument. When the script exits it prints out the minimum, average, |
| 162 |
and maximum times in microseconds followed by a count of times that |
| 163 |
the function was called and a histogram showing the distributions of |
| 164 |
times. |
| 165 |
|
| 166 |
# stap func_time_stats.stp 'syscall.read' -T 1 |
| 167 |
|
| 168 |
|
| 169 |
general/graphs.stp - Graphing Disk and CPU Utilization with gnuplot |
| 170 |
keywords: monitoring |
| 171 |
|
| 172 |
The script tracks the disk and CPU utilization. It prints a stream |
| 173 |
of data which, when piped directly into gnuplot, draws historical |
| 174 |
curves for each. |
| 175 |
|
| 176 |
# stap graphs.stp -T 1 |
| 177 |
|
| 178 |
|
| 179 |
general/helloworld.stp - SystemTap "Hello World" Program |
| 180 |
keywords: _best simple bpf |
| 181 |
|
| 182 |
A basic "Hello World" program implemented in SystemTap script. It |
| 183 |
prints out "hello world" message and then immediately exits. |
| 184 |
|
| 185 |
# stap helloworld.stp |
| 186 |
|
| 187 |
|
| 188 |
general/key.stp - make keyboard noises |
| 189 |
keywords: simple |
| 190 |
|
| 191 |
For fans of Leroy Anderson and Typewriters only, this script arranges |
| 192 |
to play a click or a zing for various keystrokes. |
| 193 |
|
| 194 |
# stap key.stp -c 'sleep 5' |
| 195 |
|
| 196 |
|
| 197 |
general/keyhack.stp - Hack the keyboard |
| 198 |
keywords: simple guru |
| 199 |
|
| 200 |
This script makes it appear that one's keyboard is broken, by |
| 201 |
changing keycodes at the kernel device driver level. Annoy your |
| 202 |
friends! |
| 203 |
|
| 204 |
# stap -g keyhack.stp -c 'sleep 5' |
| 205 |
|
| 206 |
|
| 207 |
general/measureinterval.stp - Measure intervals between events |
| 208 |
keywords: monitoring |
| 209 |
|
| 210 |
The measureinteval.stp script allows quick creation of |
| 211 |
instrumentation to measure quantity between different probe points, |
| 212 |
aggregate the measurements, and display the results. The first |
| 213 |
argument to the script is the quantity to measure such as time in |
| 214 |
microseconds via "gettimeofday_us()". There could be multiple |
| 215 |
intervals being measured concurrently and the second argument is the |
| 216 |
means to match the start probe points listed in the fourth argument |
| 217 |
with the end probes listed in the fifth argument. The third argument |
| 218 |
is how to display the aggregated data. The data could be displayed |
| 219 |
as a sum (@sum), an average (@avg), or a histogram (@hist_log). The |
| 220 |
fourth and fifth arguments are lists of probes marking the start and |
| 221 |
end of an interval. An optional sixth argument allows grouping of |
| 222 |
the intervals. One could use "tid()" for the matching argument to |
| 223 |
measure the intervals on a per-thread basis, but then use |
| 224 |
"execname()" for the optional argument to group the measurements by |
| 225 |
executable name. If there is no sixth argument, all the intervals |
| 226 |
are aggregated into a single entry. |
| 227 |
|
| 228 |
# stap measureinterval.stp "gettimeofday_us()" "tid()" @sum vm.pagefault \ |
| 229 |
vm.pagefault.return "execname()" -c 'sleep 3' |
| 230 |
|
| 231 |
|
| 232 |
general/para-callgraph-verbose.stp - Callgraph Tracing with Verbose Arguments |
| 233 |
keywords: trace callgraph |
| 234 |
|
| 235 |
Print a timed per-thread microsecond-timed callgraph, complete with |
| 236 |
pretty-printed function parameters and return values. The first |
| 237 |
parameter names the function probe points to trace. The optional |
| 238 |
second parameter names the probe points for trigger functions, which |
| 239 |
acts to enable tracing for only those functions that occur while the |
| 240 |
current thread is nested within the trigger. |
| 241 |
|
| 242 |
# stap para-callgraph-verbose.stp 'kernel.function("*@fs/proc*.c")' \ |
| 243 |
'kernel.function("vfs_read")' -c "cat /proc/sys/vm/* || true" |
| 244 |
|
| 245 |
|
| 246 |
general/para-callgraph.stp - Callgraph Tracing with Arguments |
| 247 |
keywords: _best trace callgraph |
| 248 |
|
| 249 |
Print a timed per-thread microsecond-timed callgraph, complete with |
| 250 |
function parameters and return values. The first parameter names the |
| 251 |
function probe points to trace. The optional second parameter names |
| 252 |
the probe points for trigger functions, which acts to enable tracing |
| 253 |
for only those functions that occur while the current thread is |
| 254 |
nested within the trigger. |
| 255 |
|
| 256 |
# stap para-callgraph.stp 'kernel.function("*@fs/proc*.c")' \ |
| 257 |
'kernel.function("vfs_read")' -c "cat /proc/sys/vm/* || true" |
| 258 |
|
| 259 |
|
| 260 |
general/pyexample.stp - SystemTap python 2 support tapset |
| 261 |
keywords: simple |
| 262 |
|
| 263 |
A python support tapset that displays backtraces and variable values |
| 264 |
|
| 265 |
# PYTHONPATH=$PYEXECDIR stap -g --suppress-time-limits -c \ |
| 266 |
'/usr/bin/python3 -m HelperSDT pyexample.py 35' pyexample.stp python2 |
| 267 |
|
| 268 |
|
| 269 |
general/pyexample.stp - SystemTap python 3 support tapset |
| 270 |
keywords: simple |
| 271 |
|
| 272 |
A python support tapset that displays backtraces and variable values |
| 273 |
|
| 274 |
# PYTHONPATH=$PY3EXECDIR stap -g --suppress-time-limits -c \ |
| 275 |
'/usr/bin/python3 -m HelperSDT pyexample.py 35' pyexample.stp python3 |
| 276 |
|
| 277 |
|
| 278 |
general/regex.stp - Report opened files whose names match a given regex |
| 279 |
keywords: regex |
| 280 |
|
| 281 |
Uses the regex functionality to detect opened files whose names match |
| 282 |
a pattern given on the command line. If no command line parameter is |
| 283 |
given, demonstrate by filtering for files that end with an extension |
| 284 |
showing them to be an archive. |
| 285 |
|
| 286 |
# stap regex.stp -T 1 |
| 287 |
|
| 288 |
|
| 289 |
general/sizeof.stp - Print the Size of a C Type |
| 290 |
keywords: statistics memory bpf |
| 291 |
|
| 292 |
This script prints the size of a type, based on dwarf debuginfo for |
| 293 |
any kernel or userspace module, or trial-compilation of a given |
| 294 |
header file name. |
| 295 |
|
| 296 |
# stap sizeof.stp FILE '</usr/include/stdio.h>' |
| 297 |
|
| 298 |
|
| 299 |
general/sizeof_interactive.stp - Interactive Print the Size of a C Type |
| 300 |
keywords: statistics memory interactive |
| 301 |
|
| 302 |
This script prints the size of a type, based on dwarf debuginfo for |
| 303 |
any kernel or userspace module, or trial-compilation of a given |
| 304 |
header file name. Types and corresponding locations are provided to |
| 305 |
the script at runtime via keyboard input. The format of the input is |
| 306 |
identical to that of sizeof.stp (see script source for more |
| 307 |
information). Types and locations can be repeatedly given until the |
| 308 |
process is terminated. |
| 309 |
|
| 310 |
# echo "FILE '</usr/include/stdio.h>'" | stap sizeof_interactive.stp -T 1 |
| 311 |
|
| 312 |
|
| 313 |
general/socket-events.stp - Trace Socket Activity of a Process |
| 314 |
keywords: socket syscall |
| 315 |
|
| 316 |
Prints the life cycle of all sockets associated with a process. This |
| 317 |
includes bytes and timing. The timing information that is tracked |
| 318 |
includes event completion relative to the start of said event and the |
| 319 |
end of the previous event. Currently tracks read, write, recv, send, |
| 320 |
connect and close. |
| 321 |
|
| 322 |
# stap socket-events.stp |
| 323 |
|
| 324 |
|
| 325 |
general/stopwatches.stp - See the amount of wall clock time a process spends in various states |
| 326 |
keywords: time bpf |
| 327 |
|
| 328 |
The stopwatch.stp script illustrates how to use multiple stopwatches |
| 329 |
record how much wallclock time a process spends in kernel- and |
| 330 |
user-space. On exit the script prints out the time in seconds, |
| 331 |
milliseconds, microseconds, and nanoseconds. Note that this output of |
| 332 |
this script is not directly comparable to the time command because |
| 333 |
time records the time that the process is actually active in kernel- |
| 334 |
and user-space. |
| 335 |
|
| 336 |
# stap stopwatches.stp -T 1 |
| 337 |
|
| 338 |
|
| 339 |
general/tcl-funtop.stp - Profile Tcl calls |
| 340 |
keywords: profiling |
| 341 |
|
| 342 |
The tcl-funtop.stp script displays a top-like view of most frequently |
| 343 |
used Tcl functions for the each five second interval. |
| 344 |
|
| 345 |
# stap tcl-funtop.stp -T 5 |
| 346 |
|
| 347 |
|
| 348 |
general/tcl-trace.stp - Callgraph Tracing of Tcl code |
| 349 |
keywords: callgraph |
| 350 |
|
| 351 |
Print a timed per-thread microsecond-timed callgraph of executing Tcl |
| 352 |
code. |
| 353 |
|
| 354 |
# stap tcl-trace.stp -T 5 |
| 355 |
|
| 356 |
|
| 357 |
general/varwatch.stp - Watch a Variable Changing Value in a Thread |
| 358 |
keywords: _best monitoring |
| 359 |
|
| 360 |
This script places a set of probes (specified by $1), each of which |
| 361 |
monitors the state of some context $variable expression (specified by |
| 362 |
$2). Whenever the value changes, with respect to the active thread, |
| 363 |
the event is traced. |
| 364 |
|
| 365 |
# stap -w varwatch.stp 'kernel.statement("do_sys_open@fs/open.c:*")' \ |
| 366 |
'$$vars' -T 1 |
| 367 |
|
| 368 |
|
| 369 |
general/watchdog.stp - Watchdog Timer for Arbitrary Events |
| 370 |
keywords: watchdog backtrace |
| 371 |
|
| 372 |
The watchdog.stp script provides a watchdog timer mechanism for |
| 373 |
arbitrary events. The script takes three arguments: the events to |
| 374 |
start watchdog timer, the event to stop the watchdog timer, and the |
| 375 |
time in millseconds for the watchdog. If the watchdog timer is |
| 376 |
exceed, the script will trigger a stack backtrace of the user-process |
| 377 |
that timed out using pstack. This script can be used to diagnose what |
| 378 |
the userspace application is doing when a slower than expected |
| 379 |
operation occurs. |
| 380 |
|
| 381 |
# stap watchdog.stp 'syscall.nanosleep' 'syscall.nanosleep.return' 1000 \ |
| 382 |
-T 1 |
| 383 |
|
| 384 |
|
| 385 |
general/whythefail.stp - Why did the function fail? |
| 386 |
keywords: speculation monitoring function trace _best |
| 387 |
|
| 388 |
The whythefail.stp script prints a statement-execution trace for a |
| 389 |
given function, but only for those runs of the function that ended up |
| 390 |
with a (configurable) post-return condition. |
| 391 |
|
| 392 |
# stap whythefail.stp kernel do_sys_open '$return < 0' -c 'cat \ |
| 393 |
/root/no-such-file || true' |
| 394 |
|
| 395 |
|
| 396 |
interrupt/interrupts-by-dev.stp - Record Interrupts on a Per-Device Basis |
| 397 |
keywords: interrupt |
| 398 |
|
| 399 |
The interrupts-by-dev.stp script profiles interrupts received by each |
| 400 |
device per 100 ms. |
| 401 |
|
| 402 |
# stap interrupts-by-dev.stp -T 1 |
| 403 |
|
| 404 |
|
| 405 |
interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt |
| 406 |
keywords: interrupt backtrace |
| 407 |
|
| 408 |
The Linux kernel function smp_call_function causes expensive |
| 409 |
inter-processor interrupts (IPIs). The scf.stp script tallies the |
| 410 |
processes and backtraces causing the interprocessor interrupts to |
| 411 |
identify the cause of the expensive IPI. On exit the script prints |
| 412 |
the tallies in descending frequency. |
| 413 |
|
| 414 |
# stap scf.stp -T 1 |
| 415 |
|
| 416 |
|
| 417 |
io/capture_ssl_master_secrets.stp - Capture SSL/TLS master secrets from gnutls and openssl users |
| 418 |
keywords: io monitoring |
| 419 |
|
| 420 |
Capture SSL/TLS master secrets from gnutls and openssl users for easy |
| 421 |
traffic decryption |
| 422 |
|
| 423 |
# stap capture_ssl_master_secrets.stp -c 'sleep 3' |
| 424 |
|
| 425 |
|
| 426 |
io/deviceseeks.stp - Histograms of Seek Behavior for Each Device |
| 427 |
keywords: disk |
| 428 |
|
| 429 |
The deviceseeks.stp script generates a periodic histogram showing the |
| 430 |
frequency of different sized seeks (in sectors) on each device, or |
| 431 |
optional given device-name regexp |
| 432 |
|
| 433 |
# stap deviceseeks.stp -T 1 sda |
| 434 |
|
| 435 |
|
| 436 |
io/disktop.stp - Summarize Disk Read/Write Traffic |
| 437 |
keywords: disk |
| 438 |
|
| 439 |
Get the status of reading/writing disk every 5 seconds, output top |
| 440 |
ten entries during that period. |
| 441 |
|
| 442 |
# stap disktop.stp -T 1 |
| 443 |
|
| 444 |
|
| 445 |
io/eatmydata.stp - disable fsync |
| 446 |
keywords: io guru simple |
| 447 |
|
| 448 |
Suppresses fsync() syscalls from processes identified by stap -c/-x |
| 449 |
by turning them into presumed-faster fsync() on some dummy or other |
| 450 |
file descriptor |
| 451 |
|
| 452 |
# stap -g eatmydata.stp -c 'strace ls || true' |
| 453 |
|
| 454 |
|
| 455 |
io/enospc.stp - Report an disk out-of-space condition. |
| 456 |
keywords: disk filesystem |
| 457 |
|
| 458 |
This script monitors a filesystem implementations for early internal |
| 459 |
indications of ENOSPC, and reports these to the system logger and the |
| 460 |
systemtap console. |
| 461 |
|
| 462 |
# stap enospc.stp -T 1 |
| 463 |
|
| 464 |
|
| 465 |
io/inodewatch.stp - Monitoring Reads and Writes to a File |
| 466 |
keywords: io |
| 467 |
|
| 468 |
The inodewatch.stp outputs the executable name and process id each |
| 469 |
time a read or write occurs to the specified inode on the specified |
| 470 |
major/minor device. |
| 471 |
|
| 472 |
# stap inodewatch.stp 0x08 0x01 100 -T 1 |
| 473 |
|
| 474 |
|
| 475 |
io/inodewatch2.stp - Monitoring Attribute Changes to a File |
| 476 |
keywords: io |
| 477 |
|
| 478 |
The inodewatch2.stp script outputs the executable name, process id, |
| 479 |
and attributes each time the attributes are changed on the specified |
| 480 |
inode on the specified major/minor device. |
| 481 |
|
| 482 |
# stap inodewatch2.stp 0x08 0x01 100 -T 1 |
| 483 |
|
| 484 |
|
| 485 |
io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call |
| 486 |
keywords: io backtrace |
| 487 |
|
| 488 |
When a reschedule occurs during an AIO io_submit call, accumulate the |
| 489 |
traceback in a histogram. When the script exits prints out a sorted |
| 490 |
list from most common to least common backtrace. |
| 491 |
|
| 492 |
# stap io_submit.stp -T 1 |
| 493 |
|
| 494 |
|
| 495 |
io/ioblktime.stp - Average Time Block IO Requests Spend in Queue |
| 496 |
keywords: io |
| 497 |
|
| 498 |
The ioblktime.stp script tracks the amount of time that each block IO |
| 499 |
requests spend waiting for completion. The script computes the |
| 500 |
average waiting time for block IO per device and prints list every 10 |
| 501 |
seconds. In some cases there can be too many outstanding block IO |
| 502 |
operations and the script may exceed the default number of |
| 503 |
MAXMAPENTRIES allowed. In this case the allowed number can be |
| 504 |
increased with "-DMAXMAPENTRIES=10000" option on the stap command |
| 505 |
line. |
| 506 |
|
| 507 |
# stap ioblktime.stp -T 1 |
| 508 |
|
| 509 |
|
| 510 |
io/iodevstats.stp - List Executables Reading and Writing the Most Data by Device |
| 511 |
keywords: io profiling |
| 512 |
|
| 513 |
The iodevstats.stp script measures the amount of data successfully |
| 514 |
read and written by all the executables for each io device on the |
| 515 |
system. The output is sorted from greatest sum of bytes read and |
| 516 |
written to a device by an executable to the least. The output |
| 517 |
contains device major/minor number, the count of operations (reads |
| 518 |
and writes), the totals and averages for the number of bytes read and |
| 519 |
written. |
| 520 |
|
| 521 |
# stap iodevstats.stp -T 1 |
| 522 |
|
| 523 |
|
| 524 |
io/iostat-scsi.stp - IO Statistics for SCSI Devices |
| 525 |
keywords: io profiling scsi |
| 526 |
|
| 527 |
The iostat-scsi.stp script provides a breakdown of the number of blks |
| 528 |
read and written on the machine's various SCSI devices. The script |
| 529 |
takes one argument which is the number of seconds between reports. |
| 530 |
|
| 531 |
# stap -g iostat-scsi.stp 1 -T 1 |
| 532 |
|
| 533 |
|
| 534 |
io/iostats.stp - List Executables Reading and Writing the Most Data |
| 535 |
keywords: io profiling |
| 536 |
|
| 537 |
The iostat.stp script measures the amount of data successfully read |
| 538 |
and written by all the executables on the system. The output is |
| 539 |
sorted from most greatest sum of bytes read and written by an |
| 540 |
executable to the least. The output contains the count of operations |
| 541 |
(opens, reads, and writes), the totals and averages for the number of |
| 542 |
bytes read and written. |
| 543 |
|
| 544 |
# stap iostats.stp -T 1 |
| 545 |
|
| 546 |
|
| 547 |
io/iotime.stp - Trace Time Spent in Read and Write for Files |
| 548 |
keywords: profiling syscall io file |
| 549 |
|
| 550 |
The script watches each open, close, read, and write syscalls on the |
| 551 |
system. For each file the scripts observes opened it accumulates the |
| 552 |
amount of wall clock time spent in read and write operations and the |
| 553 |
number of bytes read and written. When a file is closed the script |
| 554 |
prints out a pair of lines for the file. Both lines begin with a |
| 555 |
timestamp in microseconds, the PID number, and the executable name in |
| 556 |
parentheses. The first line with the "access" keyword lists the file |
| 557 |
name, the attempted number of bytes for the read and write |
| 558 |
operations. The second line with the "iotime" keyword list the file |
| 559 |
name and the number of microseconds accumulated in the read and write |
| 560 |
syscalls. |
| 561 |
|
| 562 |
# stap iotime.stp -T 1 |
| 563 |
|
| 564 |
|
| 565 |
io/iotop.stp - Periodically Print IO Activity by Process Name |
| 566 |
keywords: io |
| 567 |
|
| 568 |
Every five seconds print out the top ten executables generating I/O |
| 569 |
traffic during that interval sorted in descending order. |
| 570 |
|
| 571 |
# stap iotop.stp -T 1 |
| 572 |
|
| 573 |
|
| 574 |
io/mbrwatch.stp - Monitor Read/Write of the Boot Sector Area of Block Devices |
| 575 |
keywords: io monitoring disk simple |
| 576 |
|
| 577 |
The mbrwatch.stp script reports any attempted reads/writes of the |
| 578 |
first few sectors of a raw block device. |
| 579 |
|
| 580 |
# stap mbrwatch.stp -c "dd of=/dev/null count=1 if=/dev/`grep -v major \ |
| 581 |
/proc/partitions | grep . | grep -v 'sr[0-9]' | awk '{print $4}' | \ |
| 582 |
head -1`" |
| 583 |
|
| 584 |
|
| 585 |
io/nfs_func_users.stp - Tally the Number of NFS Functions Used by Each Process |
| 586 |
keywords: io profiling |
| 587 |
|
| 588 |
The nfs_func_users.stp script counts the uses of NFS functions in the |
| 589 |
kernel on a per process bases. The output is sorted from the process |
| 590 |
with the greatest number of NFS functions called to the least. The |
| 591 |
output contains the executable name, the process number, and the |
| 592 |
total number of NFS functions called by the process. |
| 593 |
|
| 594 |
# stap nfs_func_users.stp -T 1 |
| 595 |
|
| 596 |
|
| 597 |
io/slowvfs.stp - Trace slow vfs opens. |
| 598 |
keywords: io simple |
| 599 |
|
| 600 |
This script prints a line for every kernel vfs_open operation that |
| 601 |
takes longer than a configurable number of microseconds. Highly |
| 602 |
contended or remote filesystems are likelier to hit this. |
| 603 |
|
| 604 |
# stap slowvfs.stp -G sloth=10 -c 'find /proc >/dev/null || true' |
| 605 |
|
| 606 |
|
| 607 |
io/switchfile.stp - Switch log files |
| 608 |
keywords: io |
| 609 |
|
| 610 |
Every second print a log message and switch log files every 5 |
| 611 |
seconds. |
| 612 |
|
| 613 |
# stap -o /tmp/switchfile.stp.out switchfile.stp -T 8 |
| 614 |
|
| 615 |
|
| 616 |
io/traceaio.stp - Trace calls to io_submit |
| 617 |
keywords: io |
| 618 |
|
| 619 |
Trace calls to io_submit, logging iocbs and iovecs. |
| 620 |
|
| 621 |
# stap traceaio.stp -x 1 -T 1 |
| 622 |
|
| 623 |
|
| 624 |
io/traceio.stp - Track Cumulative IO Activity by Process Name |
| 625 |
keywords: io |
| 626 |
|
| 627 |
Every second print out the top ten executables sorted in descending |
| 628 |
order based on cumulative I/O traffic observed. |
| 629 |
|
| 630 |
# stap traceio.stp -T 1 |
| 631 |
|
| 632 |
|
| 633 |
io/traceio2.stp - Watch IO Activity on a Particular Device |
| 634 |
keywords: io |
| 635 |
|
| 636 |
Print out the executable name and process number as reads and writes |
| 637 |
to the specified device occur. |
| 638 |
|
| 639 |
# stap traceio2.stp 0x0801 -T 1 |
| 640 |
|
| 641 |
|
| 642 |
io/traceio3.stp - Trace VFS writes to files |
| 643 |
keywords: io |
| 644 |
|
| 645 |
Print a list of files being written to at the kernel VFS layer. |
| 646 |
Optionally, accept a regular expression to match file names against. |
| 647 |
|
| 648 |
# stap traceio3.stp /dev -T 5 |
| 649 |
|
| 650 |
|
| 651 |
io/ttyspy.stp - Monitor TTY Typing |
| 652 |
keywords: io tty monitoring guru |
| 653 |
|
| 654 |
The ttyspy.stp script uses tty_audit hooks to monitor recent typing |
| 655 |
activity on the system, printing a scrolling record of recent |
| 656 |
keystrokes, on a per-tty basis. |
| 657 |
|
| 658 |
# stap --skip-badvars -g ttyspy.stp -T 1 |
| 659 |
|
| 660 |
|
| 661 |
locks/bkl.stp - Tracing Contention on Big Kernel Lock |
| 662 |
keywords: locking |
| 663 |
|
| 664 |
The bkl.stp script can help determine whether the Big Kernel Lock |
| 665 |
(BKL) is causing serialization on a multiprocessor system due to |
| 666 |
excessive contention of the BKL. The bkl.stp script takes two |
| 667 |
arguments. The first one is optional, and used to enable backtraces, |
| 668 |
and print them once a process has been holding the BKL for a user |
| 669 |
specified number of nseconds is reached. The second option is |
| 670 |
compulsory and is the number of processes waiting for the Big Kernel |
| 671 |
Lock (BKL). When the number of processes waiting for the BKL is |
| 672 |
reached or exceeded, the script will print a time stamp, the number |
| 673 |
of processes waiting for the BKL, the holder of the BKL, and the |
| 674 |
amount of time the BKL was held. If backtraces are enabled, a |
| 675 |
backtrace will be printed as well. |
| 676 |
|
| 677 |
# stap bkl.stp -T 1 1 |
| 678 |
|
| 679 |
|
| 680 |
locks/bkl_stats.stp - Per Process Statistics on Big Kernel Lock Use |
| 681 |
keywords: locking |
| 682 |
|
| 683 |
The bkl_stats.stp script can indicate which processes have excessive |
| 684 |
waits for the Big Kernel Lock (BKL) and which processes are taking |
| 685 |
the BKL for long periods of time. The bkl_stats.stp script prints |
| 686 |
lists of all the processes that require the BKL. Every five seconds |
| 687 |
two tables are printed out. The first table lists the processes that |
| 688 |
waited for the BKL followed by the number of times that the process |
| 689 |
waited, the minimum time of the wait, the average and the maximum |
| 690 |
time waited. The second table lists has similar information for the |
| 691 |
time spent in holding the lock for each of the processes. |
| 692 |
|
| 693 |
# stap bkl_stats.stp -T 1 |
| 694 |
|
| 695 |
|
| 696 |
lwtools/accept2close-nd.stp - Show socket lifespan, from accept() to close() (non-debuginfo) |
| 697 |
keywords: network socket |
| 698 |
|
| 699 |
This traces socket duration from the accept() syscall to close(), and |
| 700 |
provides details on the lifespan of these passive connections, |
| 701 |
showing the distribution as a histogram. |
| 702 |
|
| 703 |
# stap accept2close-nd.stp -T 1 |
| 704 |
|
| 705 |
|
| 706 |
lwtools/biolatency-nd.stp - Measure block I/O latency distribution (non-debuginfo) |
| 707 |
keywords: io |
| 708 |
|
| 709 |
This measures block I/O latency (storage I/O, ie, disk I/O), and |
| 710 |
shows the distribution as a histogram. This can be useful to identify |
| 711 |
the characteristics of I/O latency, beyond the averages shown by |
| 712 |
iostat(1). For example, to study I/O latency outliers, or multi-modal |
| 713 |
distributions. |
| 714 |
|
| 715 |
# stap biolatency-nd.stp 1 1 |
| 716 |
|
| 717 |
|
| 718 |
lwtools/bitesize-nd.stp - Measure block I/O size distribution (non-debuginfo) |
| 719 |
keywords: io |
| 720 |
|
| 721 |
This uses the kernel tracepoint block_rq_insert to read the size of |
| 722 |
I/O. The output includes the name of the process or thread that was |
| 723 |
on-CPU when the I/O request was inserted on the issue queue. |
| 724 |
|
| 725 |
# stap bitesize-nd.stp -T 1 |
| 726 |
|
| 727 |
|
| 728 |
lwtools/execsnoop-nd.stp - Trace process exec() with command line argument details (non-debuginfo) |
| 729 |
keywords: io |
| 730 |
|
| 731 |
This can identify if CPU is consumed by short-lived processes, by |
| 732 |
tracing new process execution. It works by tracing exec() from the |
| 733 |
fork()->exec() sequence, which means it will not catch new processes |
| 734 |
that only fork(). It will also show every exec(), including those if |
| 735 |
a process re-execs. |
| 736 |
|
| 737 |
# stap execsnoop-nd.stp -T 1 |
| 738 |
|
| 739 |
|
| 740 |
lwtools/fslatency-nd.stp - Measure the distribution of file system synchronous read and write latency (non-debuginfo) |
| 741 |
keywords: io filesystem |
| 742 |
|
| 743 |
This dynamically traces two common file system functions: |
| 744 |
do_sync_read() and do_sync_write(), and reports a histogram |
| 745 |
distribution of latency. Many, but not all, file systems and |
| 746 |
workloads use these functions. Tracing their time provides one view |
| 747 |
of suffered file system latency. |
| 748 |
|
| 749 |
# stap fslatency-nd.stp 1 1 |
| 750 |
|
| 751 |
|
| 752 |
lwtools/fsslower-nd.stp - Trace slow file system synchronous reads and writes (non-debuginfo) |
| 753 |
keywords: io filesystem |
| 754 |
|
| 755 |
This dynamically traces two common file system functions: |
| 756 |
do_sync_read() and do_sync_write(), and shows details of each call |
| 757 |
that is slower than a threshold. Many, but not all, file systems and |
| 758 |
workloads use these functions. Tracing their time provides one view |
| 759 |
of suffered file system latency. |
| 760 |
|
| 761 |
# stap fsslower-nd.stp -T 1 |
| 762 |
|
| 763 |
|
| 764 |
lwtools/killsnoop-nd.stp - Trace kill() signals showing process and signal details (non-debuginfo) |
| 765 |
keywords: io |
| 766 |
|
| 767 |
This traces signals system-wide, including those sent by the kill(1) |
| 768 |
command, and shows various details. |
| 769 |
|
| 770 |
# stap killsnoop-nd.stp -T 1 |
| 771 |
|
| 772 |
|
| 773 |
lwtools/opensnoop-nd.stp - Trace open() syscalls showing filenames (non-debuginfo) |
| 774 |
keywords: io |
| 775 |
|
| 776 |
This traces the open() syscall system-wide, to show which files are |
| 777 |
being opened, and by who. |
| 778 |
|
| 779 |
# stap opensnoop-nd.stp -T 1 |
| 780 |
|
| 781 |
|
| 782 |
lwtools/rwtime-nd.stp - Summarize read() and write() syscall latency (non-debuginfo) |
| 783 |
keywords: io |
| 784 |
|
| 785 |
This traces read() and write() syscalls, producing a histogram |
| 786 |
summary of their durations (aka latencies). |
| 787 |
|
| 788 |
# stap rwtime-nd.stp -T 1 |
| 789 |
|
| 790 |
|
| 791 |
lwtools/syscallbypid-nd.stp - Count syscalls with process details (non-debuginfo) |
| 792 |
keywords: io |
| 793 |
|
| 794 |
This traces syscalls system-wide, and produces a summary report |
| 795 |
showing their counts by process ID, process name, and syscall types. |
| 796 |
|
| 797 |
# stap syscallbypid-nd.stp -T 1 |
| 798 |
|
| 799 |
|
| 800 |
memory/cachestat.stp - Count Page Cache Hits and Misses |
| 801 |
keywords: memory bpf |
| 802 |
|
| 803 |
Monitors hits and misses to the page cache and reports a count every |
| 804 |
5 seconds. Based on a bpftrace tool by David Valin. |
| 805 |
|
| 806 |
# stap cachestat.stp -T 1 |
| 807 |
|
| 808 |
|
| 809 |
memory/glibc-malloc.stp - Overview glibc malloc internal operations |
| 810 |
keywords: memory process |
| 811 |
|
| 812 |
This script reports on internal statistics of the glibc malloc |
| 813 |
implementation, as used by a process restricted by stap -x/-c |
| 814 |
|
| 815 |
# stap glibc-malloc.stp -c 'stap --dump-functions' |
| 816 |
|
| 817 |
|
| 818 |
memory/hugepage_clear_delays.stp - Summarize the time each process spends clearing huge pages |
| 819 |
keywords: memory |
| 820 |
|
| 821 |
When a huge page is initially used by a process it must be cleared of |
| 822 |
its original contents to avoid leaking information between processes. |
| 823 |
On x86_64 machines the huge pages are 2MB in size, 512 times larger |
| 824 |
than a normal 4KB page. Thus, clearing a huge page can delay program |
| 825 |
execution by a hundred or more microseconds and maybe noticeable to |
| 826 |
latency sensitive programs. This script will tally the number of |
| 827 |
times that each process triggers a huge page clear, the total time in |
| 828 |
microseconds spent clearing the pages, and the average time in |
| 829 |
microseconds of the huge page clear. |
| 830 |
|
| 831 |
# stap hugepage_clear_delays.stp -T 1 |
| 832 |
|
| 833 |
|
| 834 |
memory/hugepage_collapse.stp - Log the kernel collapsing normal pages into a huge page |
| 835 |
keywords: memory |
| 836 |
|
| 837 |
The kernel may attempt to group many normal sized pages into a single |
| 838 |
huge page to improve TLB performance. This operation may take a |
| 839 |
significant amount of time and affect program performance. You can |
| 840 |
identify if huge page collapse operations are occurring with the |
| 841 |
systemtap hugepage_collapse.stp script. |
| 842 |
|
| 843 |
# stap hugepage_collapse.stp -T 1 |
| 844 |
|
| 845 |
|
| 846 |
memory/hugepage_cow_delays.stp - Summarize the time each process spends doing copy on write for huge pages |
| 847 |
keywords: memory |
| 848 |
|
| 849 |
The system may attempt to reduce memory use by having two or more |
| 850 |
difference processes share the same writeable page in memory. |
| 851 |
However, when one of the processes write to shared page that is |
| 852 |
marked copy on write (COW) the page must be duplicated and then |
| 853 |
modified. On x86_64 machines the huge pages are 2MB in size, 512 |
| 854 |
times larger than a normal 4KB page. Thus, copy on write operation |
| 855 |
on a huge page can delay program execution by a hundred or more |
| 856 |
microseconds and maybe noticeable to latency sensitive programs. |
| 857 |
This script will tally the number of times that each process triggers |
| 858 |
a huge page copy on write, the total time in microseconds spent |
| 859 |
copying the pages, and the average time in microseconds of the huge |
| 860 |
page copy. |
| 861 |
|
| 862 |
# stap hugepage_cow_delays.stp -T 1 |
| 863 |
|
| 864 |
|
| 865 |
memory/hugepage_split.stp - Log the kernel splitting huge pages into normal sized pages |
| 866 |
keywords: memory |
| 867 |
|
| 868 |
Because some portions of the kernel code only work with normal-sized |
| 869 |
pages the kernel may convert a huge page into a set of normal-sized |
| 870 |
pages using a split operation. This operation may be relatively |
| 871 |
expensive and noticeable to latency sensitive programs. You can |
| 872 |
identify if split operations are occurring with the systemtap |
| 873 |
hugepage_split.stp script. |
| 874 |
|
| 875 |
# stap hugepage_split.stp -T 1 |
| 876 |
|
| 877 |
|
| 878 |
memory/hw_watch_addr.stp - Watch a Kernel Address Using Breakpoint Hardware |
| 879 |
keywords: memory watchpoint |
| 880 |
|
| 881 |
The script will watch accesses to a single kernel address and prints |
| 882 |
a traceback each time the address is accessed. This script needs to |
| 883 |
be run as root to allow access to the breakpoint hardware. |
| 884 |
|
| 885 |
# stap --all-modules hw_watch_addr.stp 0x`grep "vm_dirty_ratio" \ |
| 886 |
/proc/kallsyms | awk '{print $1}'` -T 5 |
| 887 |
|
| 888 |
|
| 889 |
memory/hw_watch_sym.stp - Watch a Kernel Symbol Using Breakpoint Hardware |
| 890 |
keywords: memory watchpoint |
| 891 |
|
| 892 |
The script will watch accesses to the starting address of a single |
| 893 |
kernel symbol and prints a traceback each time the symbol is |
| 894 |
accessed. This script needs to be run as root to allow access to the |
| 895 |
breakpoint hardware. |
| 896 |
|
| 897 |
# stap --all-modules hw_watch_sym.stp vm_dirty_ratio -T 5 |
| 898 |
|
| 899 |
|
| 900 |
memory/kmalloc-top - Show Paths to Kernel Malloc Invocations |
| 901 |
keywords: memory |
| 902 |
|
| 903 |
The kmalloc-top perl program runs a small systemtap script to collect |
| 904 |
stack traces for each call to the kmalloc function and counts the |
| 905 |
time that each stack trace is observed. When kmalloc-top exits it |
| 906 |
prints out sorted list. The output can be filtered to print only the |
| 907 |
first N stack traces (-t), stack traces with a minimum counts (-m), |
| 908 |
or exclude certain stack traces (-e). |
| 909 |
|
| 910 |
# ./kmalloc-top -c "sleep 1" |
| 911 |
|
| 912 |
|
| 913 |
memory/last_100_frees.stp - Log recent free(3) calls. |
| 914 |
keywords: memory process backtrace |
| 915 |
|
| 916 |
This script reports on the last few free(3) libc calls done by |
| 917 |
processes (possibly restricted by stap -x/-c), along with a userspace |
| 918 |
backtrace at those moments. |
| 919 |
|
| 920 |
# stap last_100_frees.stp -c "stap -V" -d `which stap` --ldd |
| 921 |
|
| 922 |
|
| 923 |
memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages |
| 924 |
keywords: memory |
| 925 |
|
| 926 |
The mmanonpage.stp script uses the virtual memory tracepoints |
| 927 |
available in some kernels to track the number of faults, user space |
| 928 |
frees, page ins, copy on writes and unmaps for anonymous pages. When |
| 929 |
the script is terminated the counts are printed for each process that |
| 930 |
allocated pages while the script was running. This script displays |
| 931 |
the anonymous page statistics for each process that ran while the |
| 932 |
script is active. It's useful in debugging leaks in the anonymous |
| 933 |
regions of a process. |
| 934 |
|
| 935 |
# stap mmanonpage.stp -T 1 |
| 936 |
|
| 937 |
|
| 938 |
memory/mmfilepage.stp - Track Virtual Memory System Actions on File Backed Pages |
| 939 |
keywords: memory bpf |
| 940 |
|
| 941 |
The mmfilepage.stp script uses the virtual memory tracepoints |
| 942 |
available in some kernels to track the number of faults, copy on |
| 943 |
writes mapping, and unmapping operations for file backed pages. When |
| 944 |
the script is terminated the counts are printed for each process that |
| 945 |
allocated pages while the script was running. The mmfilepage.stp |
| 946 |
script is useful in debugging leaks in the mapped file regions of a |
| 947 |
process. |
| 948 |
|
| 949 |
# stap mmfilepage.stp -T 1 |
| 950 |
|
| 951 |
|
| 952 |
memory/mmreclaim.stp - Track Virtual Memory System Page Reclamation |
| 953 |
keywords: memory |
| 954 |
|
| 955 |
The mmreclaim.stp script uses the virtual memory tracepoints |
| 956 |
available in some kernels to track page reclaim activity that |
| 957 |
occurred while the script was running. It's useful in debugging |
| 958 |
performance problems that occur due to page reclamation. |
| 959 |
|
| 960 |
# stap mmreclaim.stp -T 1 |
| 961 |
|
| 962 |
|
| 963 |
memory/mmwriteback.stp - Track Virtual Memory System Writing to Disk |
| 964 |
keywords: memory bpf |
| 965 |
|
| 966 |
The mmwriteback.stp script uses the virtual memory tracepoints |
| 967 |
available in some kernels to report all of the file writebacks that |
| 968 |
occur form kupdate, pdflush and kjournald while the script is |
| 969 |
running. It's useful in determining where writes are coming from on |
| 970 |
a supposedly idle system that is experiencing unexpected IO. |
| 971 |
|
| 972 |
# stap mmwriteback.stp -T 1 |
| 973 |
|
| 974 |
|
| 975 |
memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes |
| 976 |
keywords: memory numa |
| 977 |
|
| 978 |
The numa_faults.stp script tracks the read and write pages faults for |
| 979 |
each process. When the script exits it prints out the total read and |
| 980 |
write pages faults for each process. The script also provide a break |
| 981 |
down of page faults per node for each process. This script is useful |
| 982 |
for determining whether the program has good locality (page faults |
| 983 |
limited to a single node) on a NUMA computer. |
| 984 |
|
| 985 |
# stap numa_faults.stp -T 1 |
| 986 |
|
| 987 |
|
| 988 |
memory/overcommit.stp - Log Failed Process Memory Allocation Due to Overcommit Limits |
| 989 |
keywords: memory limits |
| 990 |
|
| 991 |
The overcommit.stp script prints a line each time the kernel refuses |
| 992 |
a memory allocation request from a process because of |
| 993 |
/proc/sys/vm/overcommit* limits. |
| 994 |
|
| 995 |
# stap overcommit.stp -T 1 |
| 996 |
|
| 997 |
|
| 998 |
memory/pfaults.stp - Generate Log of Major and Minor Page Faults |
| 999 |
keywords: memory |
| 1000 |
|
| 1001 |
The pfaults.stp script generates a simple log for each major and |
| 1002 |
minor page fault that occurs on the system. Each line contains a |
| 1003 |
timestamp (in microseconds) when the page fault servicing was |
| 1004 |
completed, the pid of the process, the address of the page fault, the |
| 1005 |
type of access (read or write), the type of fault (major or minor), |
| 1006 |
and the elapsed time for page fault. This log can be examined to |
| 1007 |
determine where the page faults are occurring. |
| 1008 |
|
| 1009 |
# stap pfaults.stp -T 1 |
| 1010 |
|
| 1011 |
|
| 1012 |
memory/swapmonitor.stp - Summarize swap operations |
| 1013 |
keywords: memory swap |
| 1014 |
|
| 1015 |
The swapmonitor.stp script is an example to monitor "swap in/out" in |
| 1016 |
RHEL. This stap monitor the call of "swap_readpage" and |
| 1017 |
"swap_writepage", and then printf the timeframe, func, execname, pid |
| 1018 |
and the count with 10 seconds interval. |
| 1019 |
|
| 1020 |
# stap swapmonitor.stp -T 5 |
| 1021 |
|
| 1022 |
|
| 1023 |
memory/vm.tracepoints.stp - Collect Slab Allocation Statistics |
| 1024 |
keywords: memory statistics |
| 1025 |
|
| 1026 |
The script will probe all memory slab/slub allocations and collects |
| 1027 |
information about the size of the object (bytes requested) and |
| 1028 |
user-space process in execution. When run over a period of time, it |
| 1029 |
helps to correlate kernel-space memory consumption owing to |
| 1030 |
user-space processes. |
| 1031 |
|
| 1032 |
# stap vm.tracepoints.stp -T 10 |
| 1033 |
|
| 1034 |
|
| 1035 |
network/autofs4.stp - Watch autofs4 Operations |
| 1036 |
keywords: network nfs |
| 1037 |
|
| 1038 |
Trace key autofs4 operations such as mounting or unmounting remote |
| 1039 |
filesystems. |
| 1040 |
|
| 1041 |
# stap autofs4.stp -T 1 |
| 1042 |
|
| 1043 |
|
| 1044 |
network/connect_stat.stp - Show Process Ancestry for IP Connections |
| 1045 |
keywords: network socket process |
| 1046 |
|
| 1047 |
The connect_stat.stp script prints a task's entire ancestry (parent |
| 1048 |
process name/uid/gid) whenever it attempts an outgoing socket |
| 1049 |
connection to a given IP address. |
| 1050 |
|
| 1051 |
# stap connect_stat.stp 127.0.0.1 -T 1 |
| 1052 |
|
| 1053 |
|
| 1054 |
network/dropwatch.stp - Watch Where Socket Buffers Are Freed in the Kernel |
| 1055 |
keywords: network tracepoint socket |
| 1056 |
|
| 1057 |
Every five seconds the dropwatch.stp script lists the number of |
| 1058 |
socket buffers freed at locations in the kernel. |
| 1059 |
|
| 1060 |
# stap -d kernel dropwatch.stp -T 1 |
| 1061 |
|
| 1062 |
|
| 1063 |
network/net_xmit_json.stp - Tracks time between packet queue and transmit. |
| 1064 |
keywords: network statistics json |
| 1065 |
|
| 1066 |
This script tracks time between packet queue and transmit. The |
| 1067 |
information is provided to userspace via procfs in JSON format. |
| 1068 |
|
| 1069 |
# stap net_xmit_json.stp -T 1 |
| 1070 |
|
| 1071 |
|
| 1072 |
network/netdev.stp - Trace Activity on Network Devices |
| 1073 |
keywords: network traffic |
| 1074 |
|
| 1075 |
The netdev.stp script traces configuration and transmit/receive |
| 1076 |
activity on network devices. |
| 1077 |
|
| 1078 |
# stap netdev.stp -T 1 |
| 1079 |
|
| 1080 |
|
| 1081 |
network/netfilter_drop.stp - System-Wide Network Packet Dropping Tool |
| 1082 |
keywords: network packets guru |
| 1083 |
|
| 1084 |
The script drops the specified number of packets of the specified |
| 1085 |
protocol. Valid protocols are TCP, UDP, or ALL. If ALL is specified, |
| 1086 |
all incoming packets are dropped. The number of packets to drop can |
| 1087 |
be specified with a positive integer. A value of 0 indicates that |
| 1088 |
packets should be dropped until the user manually exits. |
| 1089 |
|
| 1090 |
# stap -g netfilter_drop.stp TCP 1 -T 2 |
| 1091 |
|
| 1092 |
|
| 1093 |
network/netfilter_summary.stp - System-Wide Count of Network Packets by IPs |
| 1094 |
keywords: _best network traffic |
| 1095 |
|
| 1096 |
The script watches all IPv4 network traffic on the system. On exit |
| 1097 |
the script prints a list showing the number of packets sent along |
| 1098 |
source IP address / destination IP address pair encountered, and the |
| 1099 |
total number of bytes sent among the pair. The list is ordered from |
| 1100 |
greatest to least number of packets seen among the source/destination |
| 1101 |
pairs. |
| 1102 |
|
| 1103 |
# stap netfilter_summary.stp -T 1 |
| 1104 |
|
| 1105 |
|
| 1106 |
network/netfilter_summary_json.stp - System-Wide Count of Network Packets by IPs |
| 1107 |
keywords: _best network traffic json |
| 1108 |
|
| 1109 |
The script watches all IPv4 network traffic on the system. The data |
| 1110 |
is output in JSON format and includes the number of packets sent |
| 1111 |
along source IP address / destination IP address pair encountered, |
| 1112 |
and the total number of bytes sent among the pair. |
| 1113 |
|
| 1114 |
# stap netfilter_summary_json.stp -T 1 |
| 1115 |
|
| 1116 |
|
| 1117 |
network/nettop.stp - Periodic Listing of Processes Using Network Interfaces |
| 1118 |
keywords: network traffic |
| 1119 |
|
| 1120 |
Every five seconds the nettop.stp script prints out a list of |
| 1121 |
processed (PID and command) with the number of packets sent/received |
| 1122 |
and the amount of data sent/received by the process during that |
| 1123 |
interval. |
| 1124 |
|
| 1125 |
# stap nettop.stp -T 1 |
| 1126 |
|
| 1127 |
|
| 1128 |
network/nfsd-recent.stp - Keep track of NFS server statistics |
| 1129 |
keywords: nfs statistics |
| 1130 |
|
| 1131 |
This script tracks all nfsd server operations by client_ip address, |
| 1132 |
and periodically lists those clients that have made recent requests. |
| 1133 |
It's a way of finding out which nfs clients might be considered still |
| 1134 |
connected. |
| 1135 |
|
| 1136 |
# stap nfsd-recent.stp -T 1 |
| 1137 |
|
| 1138 |
|
| 1139 |
network/nfsd-trace.stp - Trace NFSD requests with file names. |
| 1140 |
keywords: nfs trace |
| 1141 |
|
| 1142 |
This script traces all nfsd server operations by client_ip address, |
| 1143 |
operation, and complete file name (if possible). |
| 1144 |
|
| 1145 |
# stap nfsd-trace.stp -T 1 |
| 1146 |
|
| 1147 |
|
| 1148 |
network/nfsd_unlink.stp - Find Which Client Is Removing NFS Files on Server |
| 1149 |
keywords: nfs disk |
| 1150 |
|
| 1151 |
The nfsd_unlink.stp script lists the ip address and file name each |
| 1152 |
time time a file is being removed or unlinked by the nfsd. This |
| 1153 |
script is run on the nfs server. |
| 1154 |
|
| 1155 |
# stap nfsd_unlink.stp -T 1 |
| 1156 |
|
| 1157 |
|
| 1158 |
network/nfsdtop.stp - Keep track of NFS server statistics |
| 1159 |
keywords: nfs statistics |
| 1160 |
|
| 1161 |
The nfsdtop.stp script gathers and displays NFS lookups, |
| 1162 |
|
| 1163 |
# stap nfsdtop.stp -T 1 |
| 1164 |
|
| 1165 |
|
| 1166 |
network/packet_contents.stp - Network packet contents |
| 1167 |
keywords: network traffic |
| 1168 |
|
| 1169 |
The packet_contents.stp script displays the length of each network |
| 1170 |
packet and its contents in both hexadecimal and ASCII. Systemtap |
| 1171 |
strings are MAXSTRINGLEN in length by default which may not be enough |
| 1172 |
for larger packets. In order to print larger packets, this limit can |
| 1173 |
be increased by passing in the "-DMAXSTRINGLEN=65536" command line |
| 1174 |
option. |
| 1175 |
|
| 1176 |
# stap packet_contents.stp -T 1 |
| 1177 |
|
| 1178 |
|
| 1179 |
network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space |
| 1180 |
keywords: network tcp process bpf |
| 1181 |
|
| 1182 |
The sk_stream-wait_memory.stp prints a time stamp, executable, and |
| 1183 |
pid each time a process blocks due to the send buffer being full. A |
| 1184 |
similar entry is printed each time a process continues because there |
| 1185 |
is room in the buffer. |
| 1186 |
|
| 1187 |
# stap sk_stream_wait_memory.stp -T 1 |
| 1188 |
|
| 1189 |
|
| 1190 |
network/socket-trace.stp - Trace Functions Called in Network Socket Code |
| 1191 |
keywords: network socket |
| 1192 |
|
| 1193 |
The script instruments each of the functions in the Linux kernel's |
| 1194 |
net/socket.c file. The script prints out trace data. The first |
| 1195 |
element of a line is time delta in microseconds from the previous |
| 1196 |
entry. This is followed by the command name and the PID. The "->" and |
| 1197 |
"<-" indicates function entry and function exit, respectively. The |
| 1198 |
last element of the line is the function name. |
| 1199 |
|
| 1200 |
# stap socket-trace.stp -T 1 |
| 1201 |
|
| 1202 |
|
| 1203 |
network/socktop - Periodically Summarize Socket Activity on the System |
| 1204 |
keywords: network socket |
| 1205 |
|
| 1206 |
The socktop script periodically prints out a list of the processes |
| 1207 |
with the highest socket activity. Command line options for the |
| 1208 |
script allow filtering to focus on particular types of sockets. The |
| 1209 |
"-h" option lists socktop script's filtering options. |
| 1210 |
|
| 1211 |
# ./socktop -c 1 |
| 1212 |
|
| 1213 |
|
| 1214 |
network/stp_dump.stp - Dump of STP packets |
| 1215 |
keywords: network traffic |
| 1216 |
|
| 1217 |
The stp_dump.stp prints out the packet contents. Each block contains |
| 1218 |
the STP protocol ID, version ID, flags, root and bridge MAC |
| 1219 |
addresses, and various times. |
| 1220 |
|
| 1221 |
# stap stp_dump.stp -T 5 |
| 1222 |
|
| 1223 |
|
| 1224 |
network/tcp_connections.stp - Track Creation of Incoming TCP Connections |
| 1225 |
keywords: network tcp socket |
| 1226 |
|
| 1227 |
The tcp_connections.stp script prints information for each new |
| 1228 |
incoming TCP connection accepted by the computer. The information |
| 1229 |
includes the UID, the command accepting the connection, the PID of |
| 1230 |
the command, the port the connection is on, and the IP address of the |
| 1231 |
originator of the request. |
| 1232 |
|
| 1233 |
# stap tcp_connections.stp -T 1 |
| 1234 |
|
| 1235 |
|
| 1236 |
network/tcp_init_cwnd.stp - Increase Initial TCP Congestion Window to 10 |
| 1237 |
keywords: network tcp socket guru |
| 1238 |
|
| 1239 |
Run the tcp_init_cwnd.stp script in the background to override a |
| 1240 |
kernel's default tcp cwnd value to 10, which has been found to |
| 1241 |
improve latency for web server type workloads. The script prints a |
| 1242 |
count of cwnd value changes when it is stopped. |
| 1243 |
|
| 1244 |
# stap -g tcp_init_cwnd.stp -T 1 |
| 1245 |
|
| 1246 |
|
| 1247 |
network/tcp_retransmission.stp - print tcp retransmission packet |
| 1248 |
keywords: tcp retransmission |
| 1249 |
|
| 1250 |
The tcp_retransmission.stp prints out a line for each tcp |
| 1251 |
retransmission packet |
| 1252 |
|
| 1253 |
# stap tcp_retransmission.stp -T 1 |
| 1254 |
|
| 1255 |
|
| 1256 |
network/tcp_trace.stp - TCP Connection Tracing Utility |
| 1257 |
keywords: network trace |
| 1258 |
|
| 1259 |
This scripts traces a given TCP connection based on the filter |
| 1260 |
parameters given by the user. The indexing is done by the 4 tuples |
| 1261 |
local address, remote address, local port, remote port. |
| 1262 |
|
| 1263 |
# stap tcp_trace.stp 127.0.0.1:*-127.0.0.1:* timeout=1 |
| 1264 |
|
| 1265 |
|
| 1266 |
network/tcpdumplike.stp - Dump of Received UDP/TCP Packets |
| 1267 |
keywords: network traffic |
| 1268 |
|
| 1269 |
The tcpdumplike.stp prints out a line for each TCP & UDP packet |
| 1270 |
received. Each line includes the source and destination IP addresses, |
| 1271 |
the source and destination ports, and flags. |
| 1272 |
|
| 1273 |
# stap tcpdumplike.stp -T 1 |
| 1274 |
|
| 1275 |
|
| 1276 |
network/tcpipstat.stp - Display Network Statistics for Individual TCP Sockets |
| 1277 |
keywords: network statistics |
| 1278 |
|
| 1279 |
The tcpipstat script collects and displays network statistics related |
| 1280 |
to individual TCP sockets or groups of sockets. The statistics that |
| 1281 |
are collected are simular to that of the command netstat -s, only |
| 1282 |
sorted and grouped by individual sockets. |
| 1283 |
|
| 1284 |
# stap tcpipstat.stp timeout=1 |
| 1285 |
|
| 1286 |
|
| 1287 |
network/who_sent_it.stp - Trace threads sending network traffic to given host and/or port |
| 1288 |
keywords: network trace traffic simple |
| 1289 |
|
| 1290 |
This script traces outgoing network packets using the netfilter |
| 1291 |
probes (not requiring debuginfo), printing the source thread name/id |
| 1292 |
and destination host:port. It may be filtered with the_dport and |
| 1293 |
the_daddr globals, e.g., to watch only for DNS traffic (port 53), |
| 1294 |
and/or only to the localhost (127.0.0.1). |
| 1295 |
|
| 1296 |
# stap who_sent_it.stp -G the_dport=53 -c "ping -c 1 sourceware.org || \ |
| 1297 |
true" |
| 1298 |
|
| 1299 |
|
| 1300 |
process/auditbt.stp - Generate backtraces for kernel audit events |
| 1301 |
keywords: monitoring security backtrace |
| 1302 |
|
| 1303 |
Attaches to the kernel audit-log paths (also used by libaudit), and |
| 1304 |
log every record being sent, along with a user-space backtrace of the |
| 1305 |
process that caused it. |
| 1306 |
|
| 1307 |
# stap auditbt.stp -d /usr/bin/sudo --ldd -c "sudo true" |
| 1308 |
|
| 1309 |
|
| 1310 |
process/chng_cpu.stp - Monitor Changes in Processor Executing a Task |
| 1311 |
keywords: scheduler |
| 1312 |
|
| 1313 |
The chng_cpu.stp script takes an argument which is the executable |
| 1314 |
name of the task it should monitor. Each time a task with that |
| 1315 |
executable name is found running on a different processor, the script |
| 1316 |
prints out the thread id (tid), the executable name, the processor |
| 1317 |
now running the task, the thread state, and a backtrace showing the |
| 1318 |
kernel functions that triggered the running of the task on the |
| 1319 |
processor. |
| 1320 |
|
| 1321 |
# stap chng_cpu.stp -T 1 bash |
| 1322 |
|
| 1323 |
|
| 1324 |
process/cycle_thief.stp - Track IRQ's and Other Processes Stealing Cycles from a Task |
| 1325 |
keywords: _best process scheduler time tracepoint interrupt |
| 1326 |
|
| 1327 |
The cycle_thief.stp script instruments the scheduler and IRQ handler |
| 1328 |
to determine which processes and interrupts are competing with the |
| 1329 |
specified task for the cpu cycles. This script uses the '-c' or '-x' |
| 1330 |
options to focus on a specific task. The script output the number of |
| 1331 |
times the task migrates between processors, histograms showing the |
| 1332 |
length of time on and off processor, lists of processes running while |
| 1333 |
the task is off the processor, and the interrupts that occurred while |
| 1334 |
the task was running. |
| 1335 |
|
| 1336 |
# stap cycle_thief.stp -T 1 |
| 1337 |
|
| 1338 |
|
| 1339 |
process/errsnoop.stp - Tabulate System Call Errors |
| 1340 |
keywords: process syscall |
| 1341 |
|
| 1342 |
Prints a periodic tabular report about failing system calls, by |
| 1343 |
process and by syscall failure. The first optional argument |
| 1344 |
specifies the reporting interval (in seconds, default 5); the second |
| 1345 |
optional argument gives a screen height (number of lines in the |
| 1346 |
report, default 20). |
| 1347 |
|
| 1348 |
# stap errsnoop.stp 1 10 -T 1 |
| 1349 |
|
| 1350 |
|
| 1351 |
process/forktracker.stp - Trace Creation of Processes |
| 1352 |
keywords: process scheduler |
| 1353 |
|
| 1354 |
The forktracker.stp script prints out a time-stamped entry showing |
| 1355 |
each fork and exec operation on the machine. This can be useful to |
| 1356 |
determine what process is creating a flurry of short-lived processes. |
| 1357 |
|
| 1358 |
# stap forktracker.stp -T 1 |
| 1359 |
|
| 1360 |
|
| 1361 |
process/futexes.stp - System-Wide Futex Contention |
| 1362 |
keywords: syscall locking futex |
| 1363 |
|
| 1364 |
The script watches the futex syscall on the system. On exit the |
| 1365 |
futex's address, the number of contentions, and the average time for |
| 1366 |
each contention on the futex are printed from lowest pid number to |
| 1367 |
highest. |
| 1368 |
|
| 1369 |
# stap futexes.stp -T 1 |
| 1370 |
|
| 1371 |
|
| 1372 |
process/futexes2.stp - System-Wide Shared Futex Contention |
| 1373 |
keywords: syscall locking futex |
| 1374 |
|
| 1375 |
The script watches just shared futex syscalls on the system. On exit |
| 1376 |
the futex's key, the number of contentions, and the average time for |
| 1377 |
each contention on the futex are printed from lowest pid number to |
| 1378 |
highest. |
| 1379 |
|
| 1380 |
# stap futexes2.stp -T 1 |
| 1381 |
|
| 1382 |
|
| 1383 |
process/ltrace.stp - uprobes-based ltrace |
| 1384 |
keywords: process |
| 1385 |
|
| 1386 |
The ltrace.stp script lists calls that the designated process makes |
| 1387 |
through PLTs (procedure linkage tables), generally into shared |
| 1388 |
libraries. |
| 1389 |
|
| 1390 |
# stap ltrace.stp -c ls || echo PR14738 |
| 1391 |
|
| 1392 |
|
| 1393 |
process/migrate.stp - Track the Migration of Specific Executables |
| 1394 |
keywords: scheduler |
| 1395 |
|
| 1396 |
The migrate.stp script takes an argument which is the executable name |
| 1397 |
of the task it should monitor. Each time a task with that executable |
| 1398 |
name migrates between processors an entry is printed with the process |
| 1399 |
id (pid), the executable name, the processor off loading the task, |
| 1400 |
and the process taking the task. Note that the task may or may not be |
| 1401 |
executing at the time of the migration. |
| 1402 |
|
| 1403 |
# stap migrate.stp -T 1 bash |
| 1404 |
|
| 1405 |
|
| 1406 |
process/mutex-contention.stp - pthread mutex contention analysis |
| 1407 |
keywords: locking |
| 1408 |
|
| 1409 |
Tracks pthread-mutex initialization/use and underlying futex |
| 1410 |
operations, to identify (with backtraces/symbol-names) the mutexes |
| 1411 |
suffering most contention. Invoke with "-d SHLIB --ldd", perhaps |
| 1412 |
with -DMAXMAPENTRIES=NNNN for some large NNNN, if the arrays overflow |
| 1413 |
due to heavy activity. |
| 1414 |
|
| 1415 |
# stap mutex-contention.stp -T 1 |
| 1416 |
|
| 1417 |
|
| 1418 |
process/noptrace.stp - Disable ptrace from Hierarchies of Processes |
| 1419 |
keywords: process security guru |
| 1420 |
|
| 1421 |
Blocks ptrace(2) attempts from processes identified by stap -c/-x, as |
| 1422 |
also specifiable from /proc/systemtap/stap_XXX/ control files. |
| 1423 |
Processes may be added or removed from the blocked list. |
| 1424 |
|
| 1425 |
# stap -g noptrace.stp -c 'strace ls || true' |
| 1426 |
|
| 1427 |
|
| 1428 |
process/pfiles.stp - Print Process File Descriptors |
| 1429 |
keywords: process file |
| 1430 |
|
| 1431 |
Run pfiles.stp to produce a human-readable summary of all open file |
| 1432 |
descriptors of a given process. Specify the process-id as -x PID for |
| 1433 |
fastest performance. |
| 1434 |
|
| 1435 |
# stap -g pfiles.stp -x $$ |
| 1436 |
|
| 1437 |
|
| 1438 |
process/plimit.stp - Print Resource Limits of Process |
| 1439 |
keywords: process |
| 1440 |
|
| 1441 |
The script prints a variety of resource limits for a given pid, like |
| 1442 |
/proc/$$/limits on recent kernels. |
| 1443 |
|
| 1444 |
# stap -g plimit.stp $$ |
| 1445 |
|
| 1446 |
|
| 1447 |
process/procmod_watcher.stp - Monitor process creation/termination and module [un]loading |
| 1448 |
keywords: process monitoring syscall tracepoint |
| 1449 |
|
| 1450 |
The procmod_watcher.stp script monitors calls to fork(), exec(), |
| 1451 |
exit(), init_module(), and delete_module(). Event-specific details |
| 1452 |
are also printed out (e.g. for exec(), the file being exec'ed). This |
| 1453 |
script does not require debuginfo. |
| 1454 |
|
| 1455 |
# stap procmod_watcher.stp -T 1 |
| 1456 |
|
| 1457 |
|
| 1458 |
process/proctop.stp - Periodically Print Process Information With History |
| 1459 |
keywords: process scheduler _best |
| 1460 |
|
| 1461 |
Every 5 seconds, print out a list of 25 processes that took the most |
| 1462 |
system time with information about the processes. Includes |
| 1463 |
information on processes that may have exited while the script was |
| 1464 |
running. The script contains configuration options listed in the |
| 1465 |
script source. |
| 1466 |
|
| 1467 |
# stap proctop.stp -T 1 |
| 1468 |
|
| 1469 |
|
| 1470 |
process/psig.stp - Print Process File Descriptors |
| 1471 |
keywords: process signals |
| 1472 |
|
| 1473 |
Run psig.stp to produce a human-readable summary of the signal |
| 1474 |
handling configuration of a given process. Specify the process-id as |
| 1475 |
-x PID for fastest performance. |
| 1476 |
|
| 1477 |
# stap -DMAXACTION=10000 -g psig.stp -x $$ |
| 1478 |
|
| 1479 |
|
| 1480 |
process/pstrace_exec.stp - Print trace of process ancestors for matching exec commands |
| 1481 |
keywords: process backtrace |
| 1482 |
|
| 1483 |
The pstrace_exec.stp script watches each exec operation. If the exec |
| 1484 |
contains a substring that matches the script's command-line argument, |
| 1485 |
it prints out that process and all of its ancestors. |
| 1486 |
|
| 1487 |
# stap pstrace_exec.stp -T 1 bash |
| 1488 |
|
| 1489 |
|
| 1490 |
process/pstree.stp - Generates a process diagram in DOT form. |
| 1491 |
keywords: process diagram |
| 1492 |
|
| 1493 |
The pstree.stp script generates a process diagram in DOT form. For |
| 1494 |
instance, it may be useful on a 'make' command to see all the |
| 1495 |
processes that are started. |
| 1496 |
|
| 1497 |
# stap pstree.stp -T 1 |
| 1498 |
|
| 1499 |
|
| 1500 |
process/rlimit_nofile.stp - Trace processes running out of file descriptors |
| 1501 |
keywords: limits |
| 1502 |
|
| 1503 |
This script watches processes being scheduled and which try to |
| 1504 |
allocate a file descriptor without luck. |
| 1505 |
|
| 1506 |
# stap rlimit_nofile.stp -T 1 |
| 1507 |
|
| 1508 |
|
| 1509 |
process/sched-latency.stp - track wakeup-to-dispatch latency stats |
| 1510 |
keywords: process scheduler time tracepoint |
| 1511 |
|
| 1512 |
This script periodically reports a histogram of the latency between a |
| 1513 |
task (thread) being woken up and it actually being dispatched to a |
| 1514 |
CPU: the amount of time it's spent in the runnable queue. |
| 1515 |
|
| 1516 |
# stap sched-latency.stp -T 7 |
| 1517 |
|
| 1518 |
|
| 1519 |
process/schedtimes.stp - Track Time Processes Spend in Various States Using Tracepoints |
| 1520 |
keywords: process scheduler time tracepoint |
| 1521 |
|
| 1522 |
The schedtimes.stp script instruments the scheduler to track the |
| 1523 |
amount of time that each process spends in running, sleeping, |
| 1524 |
queuing, and waiting for io. On exit the script prints out the |
| 1525 |
accumulated time for each state of processes observed. Optionally, |
| 1526 |
this script can be used with the '-c' or '-x' options to focus on a |
| 1527 |
specific PID and its children. |
| 1528 |
|
| 1529 |
# stap schedtimes.stp -T 1 |
| 1530 |
|
| 1531 |
|
| 1532 |
process/semop-watch.stp - Watch semop(2)/semtimedop(2) operations |
| 1533 |
keywords: process locking |
| 1534 |
|
| 1535 |
Prints a timed trace of semop(2)/semtimedop(2) syscalls |
| 1536 |
|
| 1537 |
# stap semop-watch.stp -c 'sleep 2' |
| 1538 |
|
| 1539 |
|
| 1540 |
process/sig_by_pid.stp - Signal Counts by Process ID |
| 1541 |
keywords: signals |
| 1542 |
|
| 1543 |
Print signal counts by process ID in descending order. |
| 1544 |
|
| 1545 |
# stap sig_by_pid.stp -T 1 |
| 1546 |
|
| 1547 |
|
| 1548 |
process/sig_by_proc.stp - Signal Counts by Process Name |
| 1549 |
keywords: signals |
| 1550 |
|
| 1551 |
Print signal counts by process name in descending order. |
| 1552 |
|
| 1553 |
# stap sig_by_proc.stp -T 1 |
| 1554 |
|
| 1555 |
|
| 1556 |
process/sigkill.stp - Track SIGKILL Signals |
| 1557 |
keywords: signals |
| 1558 |
|
| 1559 |
The script traces any SIGKILL signals. When that SIGKILL signal is |
| 1560 |
sent to a process, the script prints out the signal name, the |
| 1561 |
destination executable and process ID, the executable name and user |
| 1562 |
ID that sents the signal. |
| 1563 |
|
| 1564 |
# stap sigkill.stp -T 1 |
| 1565 |
|
| 1566 |
|
| 1567 |
process/sigmon.stp - Track a Particular Signal to a Specific Process |
| 1568 |
keywords: signals |
| 1569 |
|
| 1570 |
The script watches for a particular signal sent to a specific |
| 1571 |
process. When that signal is sent to the specified process, the |
| 1572 |
script prints out the PID and executable of the process sending the |
| 1573 |
signal, the PID and executable name of the process receiving the |
| 1574 |
signal, and the signal number and name. |
| 1575 |
|
| 1576 |
# stap sigmon.stp -T 1 SIGKILL |
| 1577 |
|
| 1578 |
|
| 1579 |
process/sleepingBeauties.stp - Generate Backtraces of Threads Waiting for IO Operations |
| 1580 |
keywords: io scheduler backtrace |
| 1581 |
|
| 1582 |
The script monitors the time that threads spend in waiting for IO |
| 1583 |
operations (in "D" state) in the wait_for_completion function. If a |
| 1584 |
thread spends over 10ms, its name and backtrace is printed, and later |
| 1585 |
so is the total delay. |
| 1586 |
|
| 1587 |
# stap sleepingBeauties.stp -T 1 |
| 1588 |
|
| 1589 |
|
| 1590 |
process/sleeptime.stp - Trace Time Spent in Nanosleep Syscalls |
| 1591 |
keywords: syscall nanosleep |
| 1592 |
|
| 1593 |
The script watches each nanosleep syscall on the system. At the end |
| 1594 |
of each nanosleep syscall the script prints out a line with a |
| 1595 |
timestamp in microseconds, the pid, the executable name in |
| 1596 |
parentheses, the "nanosleep:" key, and the duration of the sleep in |
| 1597 |
microseconds. |
| 1598 |
|
| 1599 |
# stap sleeptime.stp -T 1 |
| 1600 |
|
| 1601 |
|
| 1602 |
process/spawn_seeker.stp - Track Creation of Processes by process and execname |
| 1603 |
keywords: process scheduler |
| 1604 |
|
| 1605 |
The spawn_seeker.stp script every minute (and on exit) prints out the |
| 1606 |
local time and sorted lists of which processes and executables |
| 1607 |
spawned tasks during the previous minute. This can be useful to |
| 1608 |
determine what process is creating a flurry of short-lived processes. |
| 1609 |
When a process exits its count of tasks created is added to its |
| 1610 |
parent's count to better account for the indirect task creation by |
| 1611 |
children processes. For more detailed examination of task creation |
| 1612 |
consider using forktracker.stp. |
| 1613 |
|
| 1614 |
# stap spawn_seeker.stp -T 1 |
| 1615 |
|
| 1616 |
|
| 1617 |
process/strace.stp - Trace system calls |
| 1618 |
keywords: _best process syscall |
| 1619 |
|
| 1620 |
The script loosely emulates strace, when applied to individual |
| 1621 |
processes or hierarchies (via -c/-x), or the entire system (without |
| 1622 |
-c/-x). A few output configuration parameters may be set with -G. |
| 1623 |
|
| 1624 |
# stap strace.stp -c "cat /proc/sys/vm/* || true" |
| 1625 |
|
| 1626 |
|
| 1627 |
process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID |
| 1628 |
keywords: syscall |
| 1629 |
|
| 1630 |
The script watches all syscall on the system. On exit the script |
| 1631 |
prints a list showing the number of systemcalls executed by each PID |
| 1632 |
ordered from greatest to least number of syscalls. |
| 1633 |
|
| 1634 |
# stap syscalls_by_pid.stp -T 1 |
| 1635 |
|
| 1636 |
|
| 1637 |
process/syscalls_by_proc.stp - System-Wide Count of Syscalls by Executable |
| 1638 |
keywords: syscall |
| 1639 |
|
| 1640 |
The script watches all syscall on the system. On exit the script |
| 1641 |
prints a list showing the number of systemcalls executed by each |
| 1642 |
executable ordered from greatest to least number of syscalls. |
| 1643 |
|
| 1644 |
# stap syscalls_by_proc.stp -T 1 |
| 1645 |
|
| 1646 |
|
| 1647 |
process/syscalltimes - System-Wide Syscall Statistics with Filtering |
| 1648 |
keywords: syscall |
| 1649 |
|
| 1650 |
Combination shell/systemtap script to measure system call counts and |
| 1651 |
times. Can be filtered by process IDs, process names and users. |
| 1652 |
|
| 1653 |
# ./syscalltimes -c 'sleep 1' |
| 1654 |
|
| 1655 |
|
| 1656 |
process/thread-business.stp - monitor syscall history |
| 1657 |
keywords: _best process syscall |
| 1658 |
|
| 1659 |
Prints a periodic tabular report about the counts of syscall activity |
| 1660 |
of all threads on the system, along with a textual |
| 1661 |
recent-syscall-history for each |
| 1662 |
|
| 1663 |
# stap thread-business.stp -T 10 |
| 1664 |
|
| 1665 |
|
| 1666 |
process/threadstacks.stp - Override default new-pthread stack sizes |
| 1667 |
keywords: thread guru |
| 1668 |
|
| 1669 |
Overrides default NPTL pthread_create stack size for all new threads |
| 1670 |
created by target processes. Reports one line per process when the |
| 1671 |
related glibc variable __default_stacksize is updated. Moot for |
| 1672 |
glibc versions that support $LIBC_PTHREAD_DEFAULT_STACKSIZE_NP. |
| 1673 |
|
| 1674 |
# stap -g threadstacks.stp -Gsize=65536 -T 1 -d `which stap` |
| 1675 |
|
| 1676 |
|
| 1677 |
process/wait4time.stp - Trace Time Spent in wait4 Syscalls |
| 1678 |
keywords: syscall process |
| 1679 |
|
| 1680 |
The script watches each wait4 syscall on the system. At the end of |
| 1681 |
each wait4 syscall the script prints out a line with a timestamp in |
| 1682 |
microseconds, the pid, the executable name in parentheses, the |
| 1683 |
"wait4:" key, the duration of the wait and the PID that the wait4 was |
| 1684 |
waiting for. If the waited for PID is not specified , it is "-1". |
| 1685 |
|
| 1686 |
# stap wait4time.stp -T 1 |
| 1687 |
|
| 1688 |
|
| 1689 |
profiling/container_check.stp - Monitor capabilities and syscalls used by a process and it children |
| 1690 |
keywords: profiling container syscall |
| 1691 |
|
| 1692 |
The container_check.stp script monitors the use of linux capablities |
| 1693 |
and optionally forbidden syscalls by a process and its children. On |
| 1694 |
exit the script prints out lists showing the capabilies used by each |
| 1695 |
executable, which syscall used specific capabilites for each |
| 1696 |
executable, a list of forbidden syscalls used, and details on any |
| 1697 |
syscalls that failed during monitoring. This script is designed to |
| 1698 |
help diagnose issues caused by restricted capabilies and syscalls |
| 1699 |
when running an application in a container. If the script warns |
| 1700 |
about skipped probes, the number of active kretprobes may need to be |
| 1701 |
increased with "-DKRETACTIVE=100" option on the command line |
| 1702 |
|
| 1703 |
# stap container_check.stp -c "ping -c 1 sourceware.org || true" |
| 1704 |
|
| 1705 |
|
| 1706 |
profiling/errno.stp - Show Which Processes and System Calls Return Errors Most Frequently |
| 1707 |
keywords: profiling |
| 1708 |
|
| 1709 |
On exit the errno.stp script provides a sorted list showing which |
| 1710 |
combination of PID, system call, and error occur most frequently. |
| 1711 |
|
| 1712 |
# stap errno.stp -T 1 |
| 1713 |
|
| 1714 |
|
| 1715 |
profiling/fileline-profile.stp - Profile Kernel/User Functions |
| 1716 |
keywords: profiling |
| 1717 |
|
| 1718 |
The fileline-profile.stp script ends by printing out a sorted list of |
| 1719 |
the top twenty kernel and/or user processes providing file:line |
| 1720 |
information, if available, from the samples addresses gathered over |
| 1721 |
the time period the script is run. Use any of --ldd, --all-modules, |
| 1722 |
-d MODULE, -d /PATH/TO/EXEC to add more symbolic info. To include the |
| 1723 |
symbol name in the output, specify guru mode (-g) and add |
| 1724 |
symbolname="yes" to the stap command. |
| 1725 |
|
| 1726 |
# stap fileline-profile.stp -T 6 --all-modules --ldd |
| 1727 |
|
| 1728 |
|
| 1729 |
profiling/fntimes.stp - Show Functions Taking Longer Than Usual |
| 1730 |
keywords: _best profiling |
| 1731 |
|
| 1732 |
The fntimes.stp script monitors the execution time history of a given |
| 1733 |
function family (assumed non-recursive). Each time (beyond a warmup |
| 1734 |
interval) is then compared to the historical maximum. If it exceeds |
| 1735 |
a certain threshold (250%), a message is printed. |
| 1736 |
|
| 1737 |
# stap fntimes.stp 'kernel.function("sys_*")' -T 7 |
| 1738 |
|
| 1739 |
|
| 1740 |
profiling/functioncallcount.stp - Count Times Functions Are Called |
| 1741 |
keywords: profiling function |
| 1742 |
|
| 1743 |
The functioncallcount.stp script takes one argument, a list of |
| 1744 |
functions to probe. The script will run and count the number of times |
| 1745 |
that each of the functions on the list is called. On exit the script |
| 1746 |
will print a sorted list from most frequently to least frequently |
| 1747 |
called function. |
| 1748 |
|
| 1749 |
# stap -w functioncallcount.stp "*@fs/*.c" -T 1 |
| 1750 |
|
| 1751 |
|
| 1752 |
profiling/ioctl_handler.stp - Monitor which executables use ioctl syscalls and what kernel code is handling the ioctl |
| 1753 |
keywords: profiling |
| 1754 |
|
| 1755 |
The ioctl systemcall is used to manipulate devices setting or special |
| 1756 |
files. The way that ioctl syscalls are handled depend greatly on the |
| 1757 |
device the special file is associated with. Using strace to monitor |
| 1758 |
the open and ioctl syscalls may not give a good indication of what |
| 1759 |
kernel code is actually handling the ioctl operations. The |
| 1760 |
ioctl_handler.stp script is designed to provide more details. On exit |
| 1761 |
the ioctl_handler.stp script provides a count of the ioctl syscalls |
| 1762 |
for each executable run on the system. If there was some special |
| 1763 |
device driver code used to handle to the ioctl, the output will have |
| 1764 |
a tally of the times the function name and module was called for that |
| 1765 |
executable. The "--all-modules" option should be included on the |
| 1766 |
command line so the script can provide function name information. |
| 1767 |
|
| 1768 |
# stap ioctl_handler.stp --all-modules -T 1 |
| 1769 |
|
| 1770 |
|
| 1771 |
profiling/latencytap.stp - Show Reasons and Durations for Processes Sleeping |
| 1772 |
keywords: _best profiling |
| 1773 |
|
| 1774 |
The latencytap.stp script collects data on the intervals processes |
| 1775 |
are deactivated (sleeping). The script categorizes the reasons for |
| 1776 |
the sleeps by analyzing the backtraces and displays a sorted list of |
| 1777 |
the top 20 causes from largest total sum time sleeping to smallest. |
| 1778 |
The output is updated every 30 seconds. The script needs to be |
| 1779 |
compiled with the '--all-modules' option to produce reasons for |
| 1780 |
sleeps caused by modules. Optionally, this script can be used with |
| 1781 |
the '-c' or '-x' options to focus on a specific PID. |
| 1782 |
|
| 1783 |
# stap latencytap.stp --all-modules -T 1 |
| 1784 |
|
| 1785 |
|
| 1786 |
profiling/linetimes.stp - Show Time Spent on Each Line of a Function |
| 1787 |
keywords: profiling _best |
| 1788 |
|
| 1789 |
The linetimes.stp script takes two arguments: where to find the |
| 1790 |
function and the function name. linetimes.stp will instrument each |
| 1791 |
line in the function. It will print out the number of times that the |
| 1792 |
function is called, a table with the average and maximum time each |
| 1793 |
line takes, and control flow information when the script exits. |
| 1794 |
|
| 1795 |
# stap linetimes.stp kernel do_nanosleep -T 1 |
| 1796 |
|
| 1797 |
|
| 1798 |
profiling/perf.stp - Show performance ratios using perf.counter to access performance counters |
| 1799 |
keywords: profiling |
| 1800 |
|
| 1801 |
On exit the perf.stp script provides a sorted list showing cycles per |
| 1802 |
insn, branches per insn, and cache refs per insn |
| 1803 |
|
| 1804 |
# stap -w perf.stp -c "find /usr/bin -name \"l*\" -printf \"%h/%f %s %Cx \ |
| 1805 |
%Ck%CM %Y\n\"" |
| 1806 |
|
| 1807 |
|
| 1808 |
profiling/periodic.stp - Show the Period of the Various Timers on the System |
| 1809 |
keywords: profiling |
| 1810 |
|
| 1811 |
The periodic.stp script uses the kernel.trace("timer_expire_entry") |
| 1812 |
tracepoint to collect data on period and frequency of the various |
| 1813 |
timers on the system. The script displays a sorted list of the |
| 1814 |
timers observed on the system from most frequent to least frequent. |
| 1815 |
The script needs to be compiled with the '--all-modules' option to |
| 1816 |
produce list the function names. Optionally, this script can be used |
| 1817 |
with a numerical argument to indicate the interval in seconds between |
| 1818 |
printing output. |
| 1819 |
|
| 1820 |
# stap periodic.stp --all-modules -T 1 |
| 1821 |
|
| 1822 |
|
| 1823 |
profiling/pf2.stp - Profile Kernel Functions |
| 1824 |
keywords: profiling |
| 1825 |
|
| 1826 |
The pf2.stp script sets up time-based sampling. Every five seconds it |
| 1827 |
prints out a sorted list with the top ten kernel functions with |
| 1828 |
samples. |
| 1829 |
|
| 1830 |
# stap pf2.stp -T 1 |
| 1831 |
|
| 1832 |
|
| 1833 |
profiling/pf3.stp - Profile Kernel/User Functions |
| 1834 |
keywords: profiling |
| 1835 |
|
| 1836 |
The pf3.stp script sets up time-based sampling. Every five seconds it |
| 1837 |
prints out a sorted list with the top twenty kernel and/or user |
| 1838 |
functions with samples. Use any of --ldd, --all-modules, -d MODULE, |
| 1839 |
-d /PATH/TO/EXEC to add more symbolic info. |
| 1840 |
|
| 1841 |
# stap pf3.stp -T 6 --all-modules --ldd |
| 1842 |
|
| 1843 |
|
| 1844 |
profiling/pf4.stp - Profile Kernel/User Backtraces |
| 1845 |
keywords: _best profiling backtrace |
| 1846 |
|
| 1847 |
The pf4.stp script sets up time-based sampling. Every five seconds it |
| 1848 |
prints out a sorted list with the top twenty kernel and/or user stack |
| 1849 |
backtraces (on a per-cpu basis). Use any of --ldd, --all-modules, -d |
| 1850 |
MODULE, -d /PATH/TO/EXEC to add more symbolic info. |
| 1851 |
|
| 1852 |
# stap pf4.stp -T 6 --all-modules --ldd |
| 1853 |
|
| 1854 |
|
| 1855 |
profiling/sched_switch.stp - Display the Task Switches Happening in the Scheduler |
| 1856 |
keywords: profiling function |
| 1857 |
|
| 1858 |
The sched_switch.stp script takes two arguments, first argument can |
| 1859 |
be "pid" or "name" to indicate what is being passed as second |
| 1860 |
argument. The script will trace the process based on pid/name and |
| 1861 |
print the scheduler switches happening with the process. If no |
| 1862 |
arguments are passed, it displays all the scheduler switches. This |
| 1863 |
can be used to understand which tasks schedule out the current |
| 1864 |
process being traced, and when it gets scheduled in again. |
| 1865 |
|
| 1866 |
# stap sched_switch.stp -T 1 |
| 1867 |
|
| 1868 |
|
| 1869 |
profiling/syscallerrorsbypid.stp - Provide a per-process syscall error tally on the system |
| 1870 |
keywords: prometheus process syscall tracepoint |
| 1871 |
|
| 1872 |
The syscallerrorsbypid.stp script tallies syscall errors for each |
| 1873 |
running process. This information can be useful to whether there are |
| 1874 |
excessive errors for various processes on the system. The script |
| 1875 |
makes the information available via procfs in Prometheus readable |
| 1876 |
format. When a process exits its data will be eliminated from the |
| 1877 |
prometheus output. To avoid exceeding the storage limitations of |
| 1878 |
SystemTap older entries maybe overwritten by newer entries. This can |
| 1879 |
lead to some active process syscall error counts disappearing and/or |
| 1880 |
later reappearing with a lower value. Also note that the script does |
| 1881 |
not properly name syscalls for 32-bit applications running on 64-bit |
| 1882 |
machines. |
| 1883 |
|
| 1884 |
# stap syscallerrorsbypid.stp -T 1 |
| 1885 |
|
| 1886 |
|
| 1887 |
profiling/syscalllatency.stp - Provide a per-process accumulation of syscall latency on the system |
| 1888 |
keywords: prometheus process syscall tracepoint |
| 1889 |
|
| 1890 |
The syscalllatency.stp script accumulates syscall latency for each |
| 1891 |
running process. This information can be useful to whether excessive |
| 1892 |
time is being spent in particular syscalls on the system. The script |
| 1893 |
makes the information available via procfs in Prometheus readable |
| 1894 |
format. When a process exits its data will be eliminated from the |
| 1895 |
prometheus output. To avoid exceeding the storage limitations of |
| 1896 |
SystemTap older entries maybe overwritten by newer entries. This can |
| 1897 |
lead to some active process syscall error counts disappearing and/or |
| 1898 |
later reappearing with a lower value. Also note that the script does |
| 1899 |
not properly name syscalls for 32-bit applications running on 64-bit |
| 1900 |
machines. |
| 1901 |
|
| 1902 |
# stap syscalllatency.stp -T 1 |
| 1903 |
|
| 1904 |
|
| 1905 |
profiling/syscallsbypid.stp - Provide a per-process syscall tally on the system |
| 1906 |
keywords: prometheus process syscall tracepoint |
| 1907 |
|
| 1908 |
The syscallsbypid.stp script tallies each syscall for each running |
| 1909 |
process. This information can be useful to determine the activity of |
| 1910 |
various processes on the system. The script makes the information |
| 1911 |
available via procfs in Prometheus readable format. When a process |
| 1912 |
exits its data will be eliminated from the prometheus output. To |
| 1913 |
avoid exceeding the storage limitations of SystemTap older entries |
| 1914 |
maybe overwritten by newer entries. This can lead to some active |
| 1915 |
process syscall counts disappearing and/or later reappearing with a |
| 1916 |
lower value. Also note that the script does not properly name |
| 1917 |
syscalls for 32-bit applications running on 64-bit machines. |
| 1918 |
|
| 1919 |
# stap syscallsbypid.stp -T 1 |
| 1920 |
|
| 1921 |
|
| 1922 |
profiling/syscallsrw.stp - Provide a tally of read and write syscalls run on the system |
| 1923 |
keywords: prometheus syscall bpf |
| 1924 |
|
| 1925 |
The syscallsrw.stp script tallies the read and write syscalls. This |
| 1926 |
is a demo script for stapbpf prometheus-exporter scripts. |
| 1927 |
|
| 1928 |
|
| 1929 |
profiling/thread-times.stp - Profile Kernel Functions |
| 1930 |
keywords: _best profiling |
| 1931 |
|
| 1932 |
The thread-times.stp script sets up time-based sampling. Every five |
| 1933 |
seconds it prints out a sorted list with the top twenty threads |
| 1934 |
occupying the CPUs, broken down as a percentage of user and kernel |
| 1935 |
time. |
| 1936 |
|
| 1937 |
# stap thread-times.stp -T 1 |
| 1938 |
|
| 1939 |
|
| 1940 |
profiling/timeout.stp - Show Processes Doing Polling Operations |
| 1941 |
keywords: profiling |
| 1942 |
|
| 1943 |
The timeout.stp script is based on a blog entry |
| 1944 |
(http://udrepper.livejournal.com/19041.html) mentioning a need for a |
| 1945 |
tool to help developers find applications that are polling. The |
| 1946 |
timeout.stp script monitors systemcall used for polling and records |
| 1947 |
the systemcalls that timed out rather than returned because some |
| 1948 |
action occurred. The script updates the screen once a second with the |
| 1949 |
top twenty processes. |
| 1950 |
|
| 1951 |
# stap timeout.stp -T 1 |
| 1952 |
|
| 1953 |
|
| 1954 |
profiling/topsys.stp - Show Processes Doing Polling Operations |
| 1955 |
keywords: profiling |
| 1956 |
|
| 1957 |
The topsys.stp script lists out the top twenty systemcalls for the |
| 1958 |
previous 5 seconds. The output is sorted from most frequent to least |
| 1959 |
frequent. |
| 1960 |
|
| 1961 |
# stap topsys.stp -T 1 |
| 1962 |
|
| 1963 |
|
| 1964 |
profiling/ucalls.stp - Profile method invocations in Java, Perl, Php, Python, Ruby, and Tcl scripts |
| 1965 |
keywords: profiling syscall |
| 1966 |
|
| 1967 |
The ucalls.stp script is modeled after the BCC ucalls script |
| 1968 |
(https://github.com/iovisor/bcc/blob/master/tools/lib/ucalls.py) by |
| 1969 |
Sasha Goldshtein. The ucalls.stp script monitors the process |
| 1970 |
indicated by the -x or -c option. When the scripts exits it prints |
| 1971 |
out information about the number of times that each method is invoked |
| 1972 |
for code written in Java, Perl, Php, Python, Ruby, and Tcl. Include |
| 1973 |
the word "syscalls" on the command line to count syscalls invoked by |
| 1974 |
the process. If you want latency information, include "latency" on |
| 1975 |
the command line. Note that the latency option does not work for |
| 1976 |
recursive functions |
| 1977 |
|
| 1978 |
# stap ucalls.stp syscalls latency -c "python -c 'print(\"hello world\")' \ |
| 1979 |
|| true" |
| 1980 |
|
| 1981 |
|
| 1982 |
security-band-aids/cve-2008-0600.stp - cve-2008-0600 security band-aid |
| 1983 |
keywords: security guru |
| 1984 |
|
| 1985 |
historical emergency security band-aid, for reference/education only |
| 1986 |
|
| 1987 |
|
| 1988 |
security-band-aids/cve-2011-4127.stp - cve-2011-4127 security band-aid |
| 1989 |
keywords: security guru |
| 1990 |
|
| 1991 |
historical emergency security band-aid, for reference/education only |
| 1992 |
|
| 1993 |
|
| 1994 |
security-band-aids/cve-2012-0056.stp - cve-2012-0056 security band-aid |
| 1995 |
keywords: security guru |
| 1996 |
|
| 1997 |
historical emergency security band-aid, for reference/education only |
| 1998 |
|
| 1999 |
|
| 2000 |
security-band-aids/cve-2013-2094.stp - cve-2013-2094 security band-aid |
| 2001 |
keywords: security guru |
| 2002 |
|
| 2003 |
historical emergency security band-aid, for reference/education only |
| 2004 |
|
| 2005 |
|
| 2006 |
security-band-aids/cve-2014-7169.stp - cve-2014-7169 security band-aid |
| 2007 |
keywords: security guru |
| 2008 |
|
| 2009 |
historical emergency security band-aid, for reference/education only |
| 2010 |
|
| 2011 |
|
| 2012 |
security-band-aids/cve-2015-0235.stp - cve-2015-0235 security band-aid |
| 2013 |
keywords: security guru |
| 2014 |
|
| 2015 |
historical emergency security band-aid, for reference/education only |
| 2016 |
|
| 2017 |
|
| 2018 |
security-band-aids/cve-2015-3456.stp - cve-2015-3456 security band-aid |
| 2019 |
keywords: security guru |
| 2020 |
|
| 2021 |
historical emergency security band-aid, for reference/education only |
| 2022 |
|
| 2023 |
|
| 2024 |
security-band-aids/cve-2015-7547.stp - cve-2015-7547 security band-aid |
| 2025 |
keywords: security guru |
| 2026 |
|
| 2027 |
historical emergency security band-aid, for reference/education only |
| 2028 |
|
| 2029 |
|
| 2030 |
security-band-aids/cve-2016-0728.stp - cve-2016-0728 security band-aid |
| 2031 |
keywords: security guru |
| 2032 |
|
| 2033 |
historical emergency security band-aid, for reference/education only |
| 2034 |
|
| 2035 |
|
| 2036 |
security-band-aids/cve-2016-5195.stp - cve-2016-5195 security band-aid |
| 2037 |
keywords: security guru |
| 2038 |
|
| 2039 |
historical emergency security band-aid, for reference/education only |
| 2040 |
|
| 2041 |
|
| 2042 |
security-band-aids/cve-2017-6074.stp - cve-2017-6074 security band-aid |
| 2043 |
keywords: security guru |
| 2044 |
|
| 2045 |
historical emergency security band-aid, for reference/education only |
| 2046 |
|
| 2047 |
|
| 2048 |
security-band-aids/cve-2018-1000001.stp - cve-2018-1000001 security band-aid |
| 2049 |
keywords: security guru |
| 2050 |
|
| 2051 |
historical emergency security band-aid, for reference/education only |
| 2052 |
|
| 2053 |
|
| 2054 |
security-band-aids/cve-2018-14634.stp - cve-2018-14634 security band-aid |
| 2055 |
keywords: security guru |
| 2056 |
|
| 2057 |
historical emergency security band-aid, for reference/education only |
| 2058 |
|
| 2059 |
|
| 2060 |
security-band-aids/cve-2018-6485.stp - cve-2018-6485 security band-aid |
| 2061 |
keywords: security guru |
| 2062 |
|
| 2063 |
historical emergency security band-aid, for reference/education only |
| 2064 |
|
| 2065 |
|
| 2066 |
security-band-aids/cve-2021-4034.stp - cve-2021-4034 security band-aid |
| 2067 |
keywords: security guru |
| 2068 |
|
| 2069 |
historical emergency security band-aid, for reference/education only |
| 2070 |
|
| 2071 |
|
| 2072 |
security-band-aids/cve-2021-4155.stp - cve-2021-4155 security band-aid |
| 2073 |
keywords: security guru |
| 2074 |
|
| 2075 |
historical emergency security band-aid, for reference/education only |
| 2076 |
|
| 2077 |
|
| 2078 |
security-band-aids/cve-2023-4911.stp - cve-2023-4911 security band-aid |
| 2079 |
keywords: security guru |
| 2080 |
|
| 2081 |
historical emergency security band-aid, for reference/education only |
| 2082 |
|
| 2083 |
|
| 2084 |
stapgames/2048.stp - 2048 |
| 2085 |
keywords: _best stapgames |
| 2086 |
|
| 2087 |
The modern classic 2048 sliding-tiles game, using local keyboard and |
| 2088 |
ansi animation. |
| 2089 |
|
| 2090 |
# stap -p4 2048.stp |
| 2091 |
|
| 2092 |
|
| 2093 |
stapgames/block.stp - block breaker game |
| 2094 |
keywords: stapgames |
| 2095 |
|
| 2096 |
A block game where you progressively break the ceiling blocks until |
| 2097 |
clearing the level |
| 2098 |
|
| 2099 |
# stap -p4 -Itapset/ block.stp |
| 2100 |
|
| 2101 |
|
| 2102 |
stapgames/eater.stp - eater game |
| 2103 |
keywords: stapgames |
| 2104 |
|
| 2105 |
walk through a maze, eat stuff |
| 2106 |
|
| 2107 |
# stap -p4 -Itapset/ eater.stp |
| 2108 |
|
| 2109 |
|
| 2110 |
stapgames/lifegame.stp - life game |
| 2111 |
keywords: stapgames |
| 2112 |
|
| 2113 |
watch as your creation morphes into different forms |
| 2114 |
|
| 2115 |
# stap -p4 -Itapset/ lifegame.stp |
| 2116 |
|
| 2117 |
|
| 2118 |
stapgames/pingpong.stp - pingpong game |
| 2119 |
keywords: stapgames |
| 2120 |
|
| 2121 |
A simulated ball bounces around the terminal reflecting at the edges |
| 2122 |
|
| 2123 |
# stap -p4 -Itapset/ pingpong.stp |
| 2124 |
|
| 2125 |
|
| 2126 |
virtualization/kvm_service_time.stp - Time Statistics on KVM Exit Reasons |
| 2127 |
keywords: _best virtualization kvm |
| 2128 |
|
| 2129 |
The kvm_service_time.stp script tracks the statistics about the |
| 2130 |
amount of time that the processor left the guest virtual machine for |
| 2131 |
each exit reason (for example fixing up a page table or handling an |
| 2132 |
IO operation). When the script exits it prints out the number of |
| 2133 |
times each exit reason was encountered, the total duration of time it |
| 2134 |
left the guest VM, the minimum time, the average time, and the |
| 2135 |
maximum time in microseconds for that exit reason. On Linux 2.6.38 |
| 2136 |
and newer kernel the script can automatically determine whether it is |
| 2137 |
running on Intel or AMD processors. For older kernels with a |
| 2138 |
kernel.trace("kvm_exit") tracepoint that does not have the $isa |
| 2139 |
parameter you can explicitly state the kvm type with a "-G kvm=intel" |
| 2140 |
or "-G kvm=amd" on the command line. |
| 2141 |
|
| 2142 |
# stap kvm_service_time.stp -T 1 |
| 2143 |
|
| 2144 |
|
| 2145 |
virtualization/qemu_count.stp - Tally the Number of User-Space QEMU Events |
| 2146 |
keywords: virtualization qemu kvm |
| 2147 |
|
| 2148 |
The qemu_count.stp script tallies the number of times each of the |
| 2149 |
user-space qemu probepoints is encountered. When the script exits, it |
| 2150 |
prints a list of the number of times each user-space qemu probepoint |
| 2151 |
is encountered. |
| 2152 |
|
| 2153 |
# stap qemu_count.stp -T 1 |
| 2154 |
|
| 2155 |
|
| 2156 |
virtualization/qemu_io.stp - Tally the Number of User-Space QEMU IO on Each IO Port |
| 2157 |
keywords: virtualization qemu kvm io |
| 2158 |
|
| 2159 |
The qemu_io.stp script tallies the number of times each of the IO |
| 2160 |
port on the guest virtual machines is touched by a input or output |
| 2161 |
operation. When the script exits, it prints a count of the number of |
| 2162 |
times each IO port read and written. |
| 2163 |
|
| 2164 |
# stap qemu_io.stp -T 1 |
| 2165 |
|
| 2166 |
|