Debian Codegraph @

testsuite/systemtap.examples/keyword-index.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3 <html>
4 <head>
5 <title>SystemTap Examples</title>
6 <link rel="stylesheet" href="html/systemtap.css" type="text/css">
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 <meta http-equiv="Content-Style-Type" content="text/css">
9 </head>
10
11 <body>
12 <table cellspacing="2" cellpadding="2" border="0" width="100%">
13 <tr>
14 <td valign="bottom" height="80"><img src="html/systemtaplogo.png"
15 alt="SystemTap logo" width="165" height="25"></td>
16 <td valign="bottom" class="topnavright" align="right">
17 <a href="http://sourceware.org/systemtap/">SystemTap</a>&nbsp;|&nbsp;
18 </td>
19 </tr>
20 </table>
21
22 <div class="mainbackground">
23 <div class="maintextregion">
24 <img src="html/systemtapcorner.gif">
25 <table cellspacing="2" cellpadding="4" border="0" width="99%"
26 style="margin-top:17;">
27 <tr>
28 <td width="200">&nbsp;</td>
29 <td valign="bottom"><h1>Examples</h1></td>
30 </tr>
31 <tr>
32 <td>&nbsp;</td>
33 <td valign="top">
34
35 <h2>Example Indexes</h2>
36 <ul>
37 <li><a href="index.html">All Examples</a></li>
38 <li><a href="keyword-index.html">By Keyword</a></li>
39 </ul>
40
41 <p><em>For systemtap version 5.4.</em></p><h2>Examples by Keyword</h2>
42 <p><tt><a href="#_BEST">_BEST(17)</a> <a href="#APPLICATION">APPLICATION(2)</a> <a href="#BACKTRACE">BACKTRACE(8)</a> <a href="#BPF">BPF(11)</a> <a href="#CALLGRAPH">CALLGRAPH(4)</a> <a href="#CONTAINER">CONTAINER(1)</a> <a href="#DIAGRAM">DIAGRAM(1)</a> <a href="#DISK">DISK(5)</a> <a href="#DYNINST">DYNINST(1)</a> <a href="#FILE">FILE(2)</a> <a href="#FILESYSTEM">FILESYSTEM(4)</a> <a href="#FLOATINGPOINT">FLOATINGPOINT(1)</a> <a href="#FORMAT">FORMAT(2)</a> <a href="#FUNCTION">FUNCTION(4)</a> <a href="#FUTEX">FUTEX(2)</a> <a href="#GURU">GURU(25)</a> <a href="#INTERACTIVE">INTERACTIVE(2)</a> <a href="#INTERRUPT">INTERRUPT(3)</a> <a href="#IO">IO(32)</a> <a href="#JSON">JSON(2)</a> <a href="#KVM">KVM(3)</a> <a href="#LIMITS">LIMITS(3)</a> <a href="#LOCKING">LOCKING(6)</a> <a href="#MEMORY">MEMORY(21)</a> <a href="#MONITORING">MONITORING(9)</a> <a href="#NANOSLEEP">NANOSLEEP(1)</a> <a href="#NETWORK">NETWORK(21)</a> <a href="#NFS">NFS(5)</a> <a href="#NUMA">NUMA(1)</a> <a href="#PACKETS">PACKETS(1)</a> <a href="#PROCESS">PROCESS(27)</a> <a href="#PROFILING">PROFILING(24)</a> <a href="#PROMETHEUS">PROMETHEUS(6)</a> <a href="#QEMU">QEMU(2)</a> <a href="#REGEX">REGEX(1)</a> <a href="#RETRANSMISSION">RETRANSMISSION(1)</a> <a href="#SCHEDULER">SCHEDULER(9)</a> <a href="#SCSI">SCSI(1)</a> <a href="#SECURITY">SECURITY(19)</a> <a href="#SIGNALS">SIGNALS(5)</a> <a href="#SIMPLE">SIMPLE(11)</a> <a href="#SOCKET">SOCKET(8)</a> <a href="#SPECULATION">SPECULATION(1)</a> <a href="#STAPGAMES">STAPGAMES(5)</a> <a href="#STATISTICS">STATISTICS(10)</a> <a href="#SWAP">SWAP(1)</a> <a href="#SYSCALL">SYSCALL(19)</a> <a href="#TCP">TCP(4)</a> <a href="#THREAD">THREAD(2)</a> <a href="#TIME">TIME(4)</a> <a href="#TRACE">TRACE(11)</a> <a href="#TRACEPOINT">TRACEPOINT(8)</a> <a href="#TRAFFIC">TRAFFIC(8)</a> <a href="#TTY">TTY(1)</a> <a href="#VIRTUALIZATION">VIRTUALIZATION(3)</a> <a href="#WATCHDOG">WATCHDOG(1)</a> <a href="#WATCHPOINT">WATCHPOINT(2)</a> </tt></p>
43 <h3><a name="_BEST"><a href="#_BEST">&para;</a> _BEST</a></h3>
44 <ul>
45 <li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
46 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
47 <p>A basic &quot;Hello World&quot; program implemented in SystemTap script. It prints out &quot;hello world&quot; message and then immediately exits.</p><p><font size="-2"><pre># stap helloworld.stp</pre></font></p>
48 </li><li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Callgraph Tracing with Arguments<br>
49 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
50 <p>Print a timed per-thread microsecond-timed callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.</p><p><i><a href="general/para-callgraph.txt">sample usage in general/para-callgraph.txt</i></font></p>
51 </li><li><a href="general/varwatch.stp">general/varwatch.stp</a> - Watch a Variable Changing Value in a Thread<br>
52 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
53 <p>This script places a set of probes (specified by $1), each of which monitors the state of some context $variable expression (specified by $2). Whenever the value changes, with respect to the active thread, the event is traced.</p><p><i><a href="general/varwatch.txt">sample usage in general/varwatch.txt</i></font></p>
54 </li><li><a href="general/whythefail.stp">general/whythefail.stp</a> - Why did the function fail?<br>
55 keywords: <a href="keyword-index.html#SPECULATION">SPECULATION</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
56 <p>The whythefail.stp script prints a statement-execution trace for a given function, but only for those runs of the function that ended up with a (configurable) post-return condition.</p><p><i><a href="general/whythefail.txt">sample usage in general/whythefail.txt</i></font></p>
57 </li><li><a href="network/netfilter_summary.stp">network/netfilter_summary.stp</a> - System-Wide Count of Network Packets by IPs<br>
58 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
59 <p>The script watches all IPv4 network traffic on the system. On exit the script prints a list showing the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair. The list is ordered from greatest to least number of packets seen among the source/destination pairs.</p><p><i><a href="network/netfilter_summary.txt">sample usage in network/netfilter_summary.txt</i></font></p>
60 </li><li><a href="network/netfilter_summary_json.stp">network/netfilter_summary_json.stp</a> - System-Wide Count of Network Packets by IPs<br>
61 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#JSON">JSON</a> <br>
62 <p>The script watches all IPv4 network traffic on the system. The data is output in JSON format and includes the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair.</p><p><font size="-2"><pre># stap netfilter_summary_json.stp -T 1</pre></font></p>
63 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
64 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
65 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
66 </li><li><a href="process/proctop.stp">process/proctop.stp</a> - Periodically Print Process Information With History<br>
67 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
68 <p>Every 5 seconds, print out a list of 25 processes that took the most system time with information about the processes. Includes information on processes that may have exited while the script was running. The script contains configuration options listed in the script source.</p><p><i><a href="process/proctop.txt">sample usage in process/proctop.txt</i></font></p>
69 </li><li><a href="process/strace.stp">process/strace.stp</a> - Trace system calls<br>
70 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
71 <p>The script loosely emulates strace, when applied to individual processes or hierarchies (via -c/-x), or the entire system (without -c/-x). A few output configuration parameters may be set with -G.</p><p><i><a href="process/strace.txt">sample usage in process/strace.txt</i></font></p>
72 </li><li><a href="process/thread-business.stp">process/thread-business.stp</a> - monitor syscall history<br>
73 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
74 <p>Prints a periodic tabular report about the counts of syscall activity of all threads on the system, along with a textual recent-syscall-history for each</p><p><i><a href="process/thread-business.txt">sample usage in process/thread-business.txt</i></font></p>
75 </li><li><a href="profiling/fntimes.stp">profiling/fntimes.stp</a> - Show Functions Taking Longer Than Usual<br>
76 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
77 <p>The fntimes.stp script monitors the execution time history of a given function family (assumed non-recursive). Each time (beyond a warmup interval) is then compared to the historical maximum. If it exceeds a certain threshold (250%), a message is printed.</p><p><i><a href="profiling/fntimes.txt">sample usage in profiling/fntimes.txt</i></font></p>
78 </li><li><a href="profiling/latencytap.stp">profiling/latencytap.stp</a> - Show Reasons and Durations for Processes Sleeping<br>
79 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
80 <p>The latencytap.stp script collects data on the intervals processes are deactivated (sleeping). The script categorizes the reasons for the sleeps by analyzing the backtraces and displays a sorted list of the top 20 causes from largest total sum time sleeping to smallest. The output is updated every 30 seconds. The script needs to be compiled with the &#39;--all-modules&#39; option to produce reasons for sleeps caused by modules. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID.</p><p><i><a href="profiling/latencytap.txt">sample usage in profiling/latencytap.txt</i></font></p>
81 </li><li><a href="profiling/linetimes.stp">profiling/linetimes.stp</a> - Show Time Spent on Each Line of a Function<br>
82 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
83 <p>The linetimes.stp script takes two arguments: where to find the function and the function name. linetimes.stp will instrument each line in the function. It will print out the number of times that the function is called, a table with the average and maximum time each line takes, and control flow information when the script exits.</p><p><i><a href="profiling/linetimes.txt">sample usage in profiling/linetimes.txt</i></font></p>
84 </li><li><a href="profiling/pf4.stp">profiling/pf4.stp</a> - Profile Kernel/User Backtraces<br>
85 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
86 <p>The pf4.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty kernel and/or user stack backtraces (on a per-cpu basis). Use any of --ldd, --all-modules, -d MODULE, -d /PATH/TO/EXEC to add more symbolic info.</p><p><i><a href="profiling/pf4.txt">sample usage in profiling/pf4.txt</i></font></p>
87 </li><li><a href="profiling/thread-times.stp">profiling/thread-times.stp</a> - Profile Kernel Functions<br>
88 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
89 <p>The thread-times.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty threads occupying the CPUs, broken down as a percentage of user and kernel time.</p><p><i><a href="profiling/thread-times.txt">sample usage in profiling/thread-times.txt</i></font></p>
90 </li><li><a href="stapgames/2048.stp">stapgames/2048.stp</a> - 2048<br>
91 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
92 <p>The modern classic 2048 sliding-tiles game, using local keyboard and ansi animation.</p><p><font size="-2"><pre># stap -p4 2048.stp</pre></font></p>
93 </li><li><a href="virtualization/kvm_service_time.stp">virtualization/kvm_service_time.stp</a> - Time Statistics on KVM Exit Reasons<br>
94 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#KVM">KVM</a> <br>
95 <p>The kvm_service_time.stp script tracks the statistics about the amount of time that the processor left the guest virtual machine for each exit reason (for example fixing up a page table or handling an IO operation). When the script exits it prints out the number of times each exit reason was encountered, the total duration of time it left the guest VM, the minimum time, the average time, and the maximum time in microseconds for that exit reason. On Linux 2.6.38 and newer kernel the script can automatically determine whether it is running on Intel or AMD processors. For older kernels with a kernel.trace(&quot;kvm_exit&quot;) tracepoint that does not have the $isa parameter you can explicitly state the kvm type with a &quot;-G kvm=intel&quot; or &quot;-G kvm=amd&quot; on the command line.</p><p><i><a href="virtualization/kvm_service_time.txt">sample usage in virtualization/kvm_service_time.txt</i></font></p>
96 </li></ul>
97 <h3><a name="APPLICATION"><a href="#APPLICATION">&para;</a> APPLICATION</a></h3>
98 <ul>
99 <li><a href="apps/libguestfs_log.stp">apps/libguestfs_log.stp</a> - Trace libguestfs startup<br>
100 keywords: <a href="keyword-index.html#APPLICATION">APPLICATION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
101 <p>The libguestfs_log.stp script prints a log of when various libgueststartup steps are encountered. The first column is microseconds since the script started. The second column is the time elapsed in microseconds between the previous and current events and the third column is the event name.</p><p><font size="-2"><pre># stap libguestfs_log.stp -T 1</pre></font></p>
102 </li><li><a href="apps/stap_time.stp">apps/stap_time.stp</a> - Provide elapsed times for Passes of SystemTap script compilation<br>
103 keywords: <a href="keyword-index.html#APPLICATION">APPLICATION</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
104 <p>SystemTap has multiple passes to convert the text of a SystemTap script into instrumentation that actually collect data on the system. The stap_time.stp script uses the markers in SystemTap to note the amount of time that each of the passes requires. When SystemTap completes pass 4 (compiling the instrumentation into a kernel module) the script print out the script name followed by the amount of time in milliseconds required for Pass 0 (command line option parsing), Pass 1 (script parsing), Pass 2 (elaboration), Pass 3 (code generation), and Pass 4 (module compilation). The resulting data can be analyzed to determine if there are issues with the amount of time that systemtap takes to generate instrumentation.</p><p><font size="-2"><pre># stap stap_time.stp -T 1</pre></font></p>
105 </li></ul>
106 <h3><a name="BACKTRACE"><a href="#BACKTRACE">&para;</a> BACKTRACE</a></h3>
107 <ul>
108 <li><a href="general/watchdog.stp">general/watchdog.stp</a> - Watchdog Timer for Arbitrary Events<br>
109 keywords: <a href="keyword-index.html#WATCHDOG">WATCHDOG</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
110 <p>The watchdog.stp script provides a watchdog timer mechanism for arbitrary events. The script takes three arguments: the events to start watchdog timer, the event to stop the watchdog timer, and the time in millseconds for the watchdog. If the watchdog timer is exceed, the script will trigger a stack backtrace of the user-process that timed out using pstack. This script can be used to diagnose what the userspace application is doing when a slower than expected operation occurs.</p><p><font size="-2"><pre># stap watchdog.stp &#39;syscall.nanosleep&#39; &#39;syscall.nanosleep.return&#39; 1000 \
111 -T 1</pre></font></p>
112 </li><li><a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt<br>
113 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
114 <p>The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.</p><p><font size="-2"><pre># stap scf.stp -T 1</pre></font></p>
115 </li><li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
116 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
117 <p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p><p><font size="-2"><pre># stap io_submit.stp -T 1</pre></font></p>
118 </li><li><a href="memory/last_100_frees.stp">memory/last_100_frees.stp</a> - Log recent free(3) calls.<br>
119 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
120 <p>This script reports on the last few free(3) libc calls done by processes (possibly restricted by stap -x/-c), along with a userspace backtrace at those moments.</p><p><i><a href="memory/last_100_frees.txt">sample usage in memory/last_100_frees.txt</i></font></p>
121 </li><li><a href="process/auditbt.stp">process/auditbt.stp</a> - Generate backtraces for kernel audit events<br>
122 keywords: <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
123 <p>Attaches to the kernel audit-log paths (also used by libaudit), and log every record being sent, along with a user-space backtrace of the process that caused it.</p><p><font size="-2"><pre># stap auditbt.stp -d /usr/bin/sudo --ldd -c &quot;sudo true&quot;</pre></font></p>
124 </li><li><a href="process/pstrace_exec.stp">process/pstrace_exec.stp</a> - Print trace of process ancestors for matching exec commands<br>
125 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
126 <p>The pstrace_exec.stp script watches each exec operation. If the exec contains a substring that matches the script&#39;s command-line argument, it prints out that process and all of its ancestors.</p><p><font size="-2"><pre># stap pstrace_exec.stp -T 1 bash</pre></font></p>
127 </li><li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generate Backtraces of Threads Waiting for IO Operations<br>
128 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
129 <p>The script monitors the time that threads spend in waiting for IO operations (in &quot;D&quot; state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.</p><p><font size="-2"><pre># stap sleepingBeauties.stp -T 1</pre></font></p>
130 </li><li><a href="profiling/pf4.stp">profiling/pf4.stp</a> - Profile Kernel/User Backtraces<br>
131 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
132 <p>The pf4.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty kernel and/or user stack backtraces (on a per-cpu basis). Use any of --ldd, --all-modules, -d MODULE, -d /PATH/TO/EXEC to add more symbolic info.</p><p><i><a href="profiling/pf4.txt">sample usage in profiling/pf4.txt</i></font></p>
133 </li></ul>
134 <h3><a name="BPF"><a href="#BPF">&para;</a> BPF</a></h3>
135 <ul>
136 <li><a href="apps/libguestfs_log.stp">apps/libguestfs_log.stp</a> - Trace libguestfs startup<br>
137 keywords: <a href="keyword-index.html#APPLICATION">APPLICATION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
138 <p>The libguestfs_log.stp script prints a log of when various libgueststartup steps are encountered. The first column is microseconds since the script started. The second column is the time elapsed in microseconds between the previous and current events and the third column is the event name.</p><p><font size="-2"><pre># stap libguestfs_log.stp -T 1</pre></font></p>
139 </li><li><a href="general/ansi_colors.stp">general/ansi_colors.stp</a> - Color Table for ansi_set_color()<br>
140 keywords: <a href="keyword-index.html#FORMAT">FORMAT</a> <a href="keyword-index.html#BPF">BPF</a> <br>
141 <p>The script prints a table showing the available color combinations for the ansi_set_color() function in the ansi.stp tapset.</p><p><font size="-2"><pre># stap ansi_colors.stp</pre></font></p>
142 </li><li><a href="general/ansi_colors2.stp">general/ansi_colors2.stp</a> - Show Attribues in Table for ansi_set_color()<br>
143 keywords: <a href="keyword-index.html#FORMAT">FORMAT</a> <a href="keyword-index.html#BPF">BPF</a> <br>
144 <p>The script prints a table showing the available attributes (bold, underline, and inverse) with color combinations for the ans_set_color() function in the ansi.stp tapset.</p><p><font size="-2"><pre># stap ansi_colors2.stp</pre></font></p>
145 </li><li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
146 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
147 <p>A basic &quot;Hello World&quot; program implemented in SystemTap script. It prints out &quot;hello world&quot; message and then immediately exits.</p><p><font size="-2"><pre># stap helloworld.stp</pre></font></p>
148 </li><li><a href="general/sizeof.stp">general/sizeof.stp</a> - Print the Size of a C Type<br>
149 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
150 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name.</p><p><i><a href="general/sizeof.txt">sample usage in general/sizeof.txt</i></font></p>
151 </li><li><a href="general/stopwatches.stp">general/stopwatches.stp</a> - See the amount of wall clock time a process spends in various states<br>
152 keywords: <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#BPF">BPF</a> <br>
153 <p>The stopwatch.stp script illustrates how to use multiple stopwatches record how much wallclock time a process spends in kernel- and user-space. On exit the script prints out the time in seconds, milliseconds, microseconds, and nanoseconds. Note that this output of this script is not directly comparable to the time command because time records the time that the process is actually active in kernel- and user-space.</p><p><font size="-2"><pre># stap stopwatches.stp -T 1</pre></font></p>
154 </li><li><a href="memory/cachestat.stp">memory/cachestat.stp</a> - Count Page Cache Hits and Misses<br>
155 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
156 <p>Monitors hits and misses to the page cache and reports a count every 5 seconds. Based on a bpftrace tool by David Valin.</p><p><font size="-2"><pre># stap cachestat.stp -T 1</pre></font></p>
157 </li><li><a href="memory/mmfilepage.stp">memory/mmfilepage.stp</a> - Track Virtual Memory System Actions on File Backed Pages<br>
158 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
159 <p>The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.</p><p><font size="-2"><pre># stap mmfilepage.stp -T 1</pre></font></p>
160 </li><li><a href="memory/mmwriteback.stp">memory/mmwriteback.stp</a> - Track Virtual Memory System Writing to Disk<br>
161 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
162 <p>The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It&#39;s useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.</p><p><font size="-2"><pre># stap mmwriteback.stp -T 1</pre></font></p>
163 </li><li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br>
164 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BPF">BPF</a> <br>
165 <p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p><p><font size="-2"><pre># stap sk_stream_wait_memory.stp -T 1</pre></font></p>
166 </li><li><a href="profiling/syscallsrw.stp">profiling/syscallsrw.stp</a> - Provide a tally of read and write syscalls run on the system <br>
167 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#BPF">BPF</a> <br>
168 <p>The syscallsrw.stp script tallies the read and write syscalls. This is a demo script for stapbpf prometheus-exporter scripts.</p></p>
169 </li></ul>
170 <h3><a name="CALLGRAPH"><a href="#CALLGRAPH">&para;</a> CALLGRAPH</a></h3>
171 <ul>
172 <li><a href="general/callgraph.stp">general/callgraph.stp</a> - Callgraph Tracing<br>
173 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
174 <p>Print a timed per-thread microsecond-timed nested callgraph. The first parameter names the function probe points to trace.</p><p><i><a href="general/callgraph.txt">sample usage in general/callgraph.txt</i></font></p>
175 </li><li><a href="general/para-callgraph-verbose.stp">general/para-callgraph-verbose.stp</a> - Callgraph Tracing with Verbose Arguments<br>
176 keywords: <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
177 <p>Print a timed per-thread microsecond-timed callgraph, complete with pretty-printed function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.</p><p><font size="-2"><pre># stap para-callgraph-verbose.stp &#39;kernel.function(&quot;*@fs/proc*.c&quot;)&#39; \
178 &#39;kernel.function(&quot;vfs_read&quot;)&#39; -c &quot;cat /proc/sys/vm/* || true&quot;</pre></font></p>
179 </li><li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Callgraph Tracing with Arguments<br>
180 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
181 <p>Print a timed per-thread microsecond-timed callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.</p><p><i><a href="general/para-callgraph.txt">sample usage in general/para-callgraph.txt</i></font></p>
182 </li><li><a href="general/tcl-trace.stp">general/tcl-trace.stp</a> - Callgraph Tracing of Tcl code<br>
183 keywords: <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
184 <p>Print a timed per-thread microsecond-timed callgraph of executing Tcl code.</p><p><font size="-2"><pre># stap tcl-trace.stp -T 5</pre></font></p>
185 </li></ul>
186 <h3><a name="CONTAINER"><a href="#CONTAINER">&para;</a> CONTAINER</a></h3>
187 <ul>
188 <li><a href="profiling/container_check.stp">profiling/container_check.stp</a> - Monitor capabilities and syscalls used by a process and it children<br>
189 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#CONTAINER">CONTAINER</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
190 <p>The container_check.stp script monitors the use of linux capablities and optionally forbidden syscalls by a process and its children. On exit the script prints out lists showing the capabilies used by each executable, which syscall used specific capabilites for each executable, a list of forbidden syscalls used, and details on any syscalls that failed during monitoring. This script is designed to help diagnose issues caused by restricted capabilies and syscalls when running an application in a container. If the script warns about skipped probes, the number of active kretprobes may need to be increased with &quot;-DKRETACTIVE=100&quot; option on the command line</p><p><font size="-2"><pre># stap container_check.stp -c &quot;ping -c 1 sourceware.org || true&quot;</pre></font></p>
191 </li></ul>
192 <h3><a name="DIAGRAM"><a href="#DIAGRAM">&para;</a> DIAGRAM</a></h3>
193 <ul>
194 <li><a href="process/pstree.stp">process/pstree.stp</a> - Generates a process diagram in DOT form.<br>
195 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#DIAGRAM">DIAGRAM</a> <br>
196 <p>The pstree.stp script generates a process diagram in DOT form. For instance, it may be useful on a &#39;make&#39; command to see all the processes that are started.</p><p><font size="-2"><pre># stap pstree.stp -T 1</pre></font></p>
197 </li></ul>
198 <h3><a name="DISK"><a href="#DISK">&para;</a> DISK</a></h3>
199 <ul>
200 <li><a href="io/deviceseeks.stp">io/deviceseeks.stp</a> - Histograms of Seek Behavior for Each Device<br>
201 keywords: <a href="keyword-index.html#DISK">DISK</a> <br>
202 <p>The deviceseeks.stp script generates a periodic histogram showing the frequency of different sized seeks (in sectors) on each device, or optional given device-name regexp</p><p><i><a href="io/deviceseeks.txt">sample usage in io/deviceseeks.txt</i></font></p>
203 </li><li><a href="io/disktop.stp">io/disktop.stp</a> - Summarize Disk Read/Write Traffic<br>
204 keywords: <a href="keyword-index.html#DISK">DISK</a> <br>
205 <p>Get the status of reading/writing disk every 5 seconds, output top ten entries during that period.</p><p><font size="-2"><pre># stap disktop.stp -T 1</pre></font></p>
206 </li><li><a href="io/enospc.stp">io/enospc.stp</a> - Report an disk out-of-space condition.<br>
207 keywords: <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
208 <p>This script monitors a filesystem implementations for early internal indications of ENOSPC, and reports these to the system logger and the systemtap console.</p><p><font size="-2"><pre># stap enospc.stp -T 1</pre></font></p>
209 </li><li><a href="io/mbrwatch.stp">io/mbrwatch.stp</a> - Monitor Read/Write of the Boot Sector Area of Block Devices<br>
210 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
211 <p> The mbrwatch.stp script reports any attempted reads/writes of the first few sectors of a raw block device.</p><p><i><a href="io/mbrwatch.txt">sample usage in io/mbrwatch.txt</i></font></p>
212 </li><li><a href="network/nfsd_unlink.stp">network/nfsd_unlink.stp</a> - Find Which Client Is Removing NFS Files on Server<br>
213 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#DISK">DISK</a> <br>
214 <p>The nfsd_unlink.stp script lists the ip address and file name each time time a file is being removed or unlinked by the nfsd. This script is run on the nfs server.</p><p><font size="-2"><pre># stap nfsd_unlink.stp -T 1</pre></font></p>
215 </li></ul>
216 <h3><a name="DYNINST"><a href="#DYNINST">&para;</a> DYNINST</a></h3>
217 <ul>
218 <li><a href="apps/php-trace.stp">apps/php-trace.stp</a> - Tracing of PHP code execution<br>
219 keywords: <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#DYNINST">DYNINST</a> <br>
220 <p>Trace of executing PHP code using the enabled markers.</p><p><font size="-2"><pre># stap php-trace.stp -c &#39;php -f hello.php&#39;</pre></font></p>
221 </li></ul>
222 <h3><a name="FILE"><a href="#FILE">&para;</a> FILE</a></h3>
223 <ul>
224 <li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
225 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILE">FILE</a> <br>
226 <p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the &quot;access&quot; keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the &quot;iotime&quot; keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p><p><font size="-2"><pre># stap iotime.stp -T 1</pre></font></p>
227 </li><li><a href="process/pfiles.stp">process/pfiles.stp</a> - Print Process File Descriptors<br>
228 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#FILE">FILE</a> <br>
229 <p>Run pfiles.stp to produce a human-readable summary of all open file descriptors of a given process. Specify the process-id as -x PID for fastest performance.</p><p><font size="-2"><pre># stap -g pfiles.stp -x $$</pre></font></p>
230 </li></ul>
231 <h3><a name="FILESYSTEM"><a href="#FILESYSTEM">&para;</a> FILESYSTEM</a></h3>
232 <ul>
233 <li><a href="general/badname.stp">general/badname.stp</a> - Bad Filename Filter<br>
234 keywords: <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <a href="keyword-index.html#GURU">GURU</a> <br>
235 <p>The badname.stp script shows how one could prevent the creation of files with undesirable names using guru mode.</p><p><i><a href="general/badname.txt">sample usage in general/badname.txt</i></font></p>
236 </li><li><a href="io/enospc.stp">io/enospc.stp</a> - Report an disk out-of-space condition.<br>
237 keywords: <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
238 <p>This script monitors a filesystem implementations for early internal indications of ENOSPC, and reports these to the system logger and the systemtap console.</p><p><font size="-2"><pre># stap enospc.stp -T 1</pre></font></p>
239 </li><li><a href="lwtools/fslatency-nd.stp">lwtools/fslatency-nd.stp</a> - Measure the distribution of file system synchronous read and write latency (non-debuginfo)<br>
240 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
241 <p>This dynamically traces two common file system functions: do_sync_read() and do_sync_write(), and reports a histogram distribution of latency. Many, but not all, file systems and workloads use these functions. Tracing their time provides one view of suffered file system latency.</p><p><font size="-2"><pre># stap fslatency-nd.stp 1 1</pre></font></p>
242 </li><li><a href="lwtools/fsslower-nd.stp">lwtools/fsslower-nd.stp</a> - Trace slow file system synchronous reads and writes (non-debuginfo)<br>
243 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
244 <p>This dynamically traces two common file system functions: do_sync_read() and do_sync_write(), and shows details of each call that is slower than a threshold. Many, but not all, file systems and workloads use these functions. Tracing their time provides one view of suffered file system latency.</p><p><font size="-2"><pre># stap fsslower-nd.stp -T 1</pre></font></p>
245 </li></ul>
246 <h3><a name="FLOATINGPOINT"><a href="#FLOATINGPOINT">&para;</a> FLOATINGPOINT</a></h3>
247 <ul>
248 <li><a href="general/floatingpoint.stp">general/floatingpoint.stp</a> - SystemTap "Floating Point" Program<br>
249 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#FLOATINGPOINT">FLOATINGPOINT</a> <br>
250 <p>A basic &quot;Floating Point&quot; program implemented in SystemTap script. It extracts floating point from benchmark-sdt section in main.cxx and takes one pseudo floating point, printing out results of various simple floating point operations.</p><p><i><a href="general/floatingpoint.txt">sample usage in general/floatingpoint.txt</i></font></p>
251 </li></ul>
252 <h3><a name="FORMAT"><a href="#FORMAT">&para;</a> FORMAT</a></h3>
253 <ul>
254 <li><a href="general/ansi_colors.stp">general/ansi_colors.stp</a> - Color Table for ansi_set_color()<br>
255 keywords: <a href="keyword-index.html#FORMAT">FORMAT</a> <a href="keyword-index.html#BPF">BPF</a> <br>
256 <p>The script prints a table showing the available color combinations for the ansi_set_color() function in the ansi.stp tapset.</p><p><font size="-2"><pre># stap ansi_colors.stp</pre></font></p>
257 </li><li><a href="general/ansi_colors2.stp">general/ansi_colors2.stp</a> - Show Attribues in Table for ansi_set_color()<br>
258 keywords: <a href="keyword-index.html#FORMAT">FORMAT</a> <a href="keyword-index.html#BPF">BPF</a> <br>
259 <p>The script prints a table showing the available attributes (bold, underline, and inverse) with color combinations for the ans_set_color() function in the ansi.stp tapset.</p><p><font size="-2"><pre># stap ansi_colors2.stp</pre></font></p>
260 </li></ul>
261 <h3><a name="FUNCTION"><a href="#FUNCTION">&para;</a> FUNCTION</a></h3>
262 <ul>
263 <li><a href="general/func_time_stats.stp">general/func_time_stats.stp</a> - Function Time Statistics<br>
264 keywords: <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
265 <p>The func_time_stats.stp script tracks the wall clock time for each invocation of the function probe listed as the first command line argument. When the script exits it prints out the minimum, average, and maximum times in microseconds followed by a count of times that the function was called and a histogram showing the distributions of times.</p><p><i><a href="general/func_time_stats.txt">sample usage in general/func_time_stats.txt</i></font></p>
266 </li><li><a href="general/whythefail.stp">general/whythefail.stp</a> - Why did the function fail?<br>
267 keywords: <a href="keyword-index.html#SPECULATION">SPECULATION</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
268 <p>The whythefail.stp script prints a statement-execution trace for a given function, but only for those runs of the function that ended up with a (configurable) post-return condition.</p><p><i><a href="general/whythefail.txt">sample usage in general/whythefail.txt</i></font></p>
269 </li><li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Are Called<br>
270 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <br>
271 <p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p><p><font size="-2"><pre># stap -w functioncallcount.stp &quot;*@fs/*.c&quot; -T 1</pre></font></p>
272 </li><li><a href="profiling/sched_switch.stp">profiling/sched_switch.stp</a> - Display the Task Switches Happening in the Scheduler<br>
273 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <br>
274 <p>The sched_switch.stp script takes two arguments, first argument can be &quot;pid&quot; or &quot;name&quot; to indicate what is being passed as second argument. The script will trace the process based on pid/name and print the scheduler switches happening with the process. If no arguments are passed, it displays all the scheduler switches. This can be used to understand which tasks schedule out the current process being traced, and when it gets scheduled in again.</p><p><font size="-2"><pre># stap sched_switch.stp -T 1</pre></font></p>
275 </li></ul>
276 <h3><a name="FUTEX"><a href="#FUTEX">&para;</a> FUTEX</a></h3>
277 <ul>
278 <li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
279 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
280 <p>The script watches the futex syscall on the system. On exit the futex&#39;s address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><i><a href="process/futexes.txt">sample usage in process/futexes.txt</i></font></p>
281 </li><li><a href="process/futexes2.stp">process/futexes2.stp</a> - System-Wide Shared Futex Contention<br>
282 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
283 <p>The script watches just shared futex syscalls on the system. On exit the futex&#39;s key, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><font size="-2"><pre># stap futexes2.stp -T 1</pre></font></p>
284 </li></ul>
285 <h3><a name="GURU"><a href="#GURU">&para;</a> GURU</a></h3>
286 <ul>
287 <li><a href="general/badname.stp">general/badname.stp</a> - Bad Filename Filter<br>
288 keywords: <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <a href="keyword-index.html#GURU">GURU</a> <br>
289 <p>The badname.stp script shows how one could prevent the creation of files with undesirable names using guru mode.</p><p><i><a href="general/badname.txt">sample usage in general/badname.txt</i></font></p>
290 </li><li><a href="general/keyhack.stp">general/keyhack.stp</a> - Hack the keyboard<br>
291 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#GURU">GURU</a> <br>
292 <p>This script makes it appear that one&#39;s keyboard is broken, by changing keycodes at the kernel device driver level. Annoy your friends!</p><p><font size="-2"><pre># stap -g keyhack.stp -c &#39;sleep 5&#39;</pre></font></p>
293 </li><li><a href="io/eatmydata.stp">io/eatmydata.stp</a> - disable fsync<br>
294 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#GURU">GURU</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
295 <p>Suppresses fsync() syscalls from processes identified by stap -c/-x by turning them into presumed-faster fsync() on some dummy or other file descriptor</p><p><i><a href="io/eatmydata.txt">sample usage in io/eatmydata.txt</i></font></p>
296 </li><li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor TTY Typing<br>
297 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#TTY">TTY</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#GURU">GURU</a> <br>
298 <p>The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis.</p><p><i><a href="io/ttyspy.txt">sample usage in io/ttyspy.txt</i></font></p>
299 </li><li><a href="network/netfilter_drop.stp">network/netfilter_drop.stp</a> - System-Wide Network Packet Dropping Tool<br>
300 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#PACKETS">PACKETS</a> <a href="keyword-index.html#GURU">GURU</a> <br>
301 <p>The script drops the specified number of packets of the specified protocol. Valid protocols are TCP, UDP, or ALL. If ALL is specified, all incoming packets are dropped. The number of packets to drop can be specified with a positive integer. A value of 0 indicates that packets should be dropped until the user manually exits.</p><p><font size="-2"><pre># stap -g netfilter_drop.stp TCP 1 -T 2</pre></font></p>
302 </li><li><a href="network/tcp_init_cwnd.stp">network/tcp_init_cwnd.stp</a> - Increase Initial TCP Congestion Window to 10<br>
303 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#GURU">GURU</a> <br>
304 <p>Run the tcp_init_cwnd.stp script in the background to override a kernel&#39;s default tcp cwnd value to 10, which has been found to improve latency for web server type workloads. The script prints a count of cwnd value changes when it is stopped.</p><p><font size="-2"><pre># stap -g tcp_init_cwnd.stp -T 1</pre></font></p>
305 </li><li><a href="process/noptrace.stp">process/noptrace.stp</a> - Disable ptrace from Hierarchies of Processes<br>
306 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
307 <p>Blocks ptrace(2) attempts from processes identified by stap -c/-x, as also specifiable from /proc/systemtap/stap_XXX/ control files. Processes may be added or removed from the blocked list.</p><p><i><a href="process/noptrace.txt">sample usage in process/noptrace.txt</i></font></p>
308 </li><li><a href="process/threadstacks.stp">process/threadstacks.stp</a> - Override default new-pthread stack sizes<br>
309 keywords: <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#GURU">GURU</a> <br>
310 <p>Overrides default NPTL pthread_create stack size for all new threads created by target processes. Reports one line per process when the related glibc variable __default_stacksize is updated. Moot for glibc versions that support $LIBC_PTHREAD_DEFAULT_STACKSIZE_NP.</p><p><font size="-2"><pre># stap -g threadstacks.stp -Gsize=65536 -T 1 -d `which stap`</pre></font></p>
311 </li><li><a href="security-band-aids/cve-2008-0600.stp">security-band-aids/cve-2008-0600.stp</a> - cve-2008-0600 security band-aid<br>
312 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
313 <p>historical emergency security band-aid, for reference/education only</p><p><i><a href="security-band-aids/cve-2008-0600.txt">sample usage in security-band-aids/cve-2008-0600.txt</i></font></p>
314 </li><li><a href="security-band-aids/cve-2011-4127.stp">security-band-aids/cve-2011-4127.stp</a> - cve-2011-4127 security band-aid<br>
315 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
316 <p>historical emergency security band-aid, for reference/education only</p></p>
317 </li><li><a href="security-band-aids/cve-2012-0056.stp">security-band-aids/cve-2012-0056.stp</a> - cve-2012-0056 security band-aid<br>
318 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
319 <p>historical emergency security band-aid, for reference/education only</p></p>
320 </li><li><a href="security-band-aids/cve-2013-2094.stp">security-band-aids/cve-2013-2094.stp</a> - cve-2013-2094 security band-aid<br>
321 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
322 <p>historical emergency security band-aid, for reference/education only</p></p>
323 </li><li><a href="security-band-aids/cve-2014-7169.stp">security-band-aids/cve-2014-7169.stp</a> - cve-2014-7169 security band-aid<br>
324 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
325 <p>historical emergency security band-aid, for reference/education only</p></p>
326 </li><li><a href="security-band-aids/cve-2015-0235.stp">security-band-aids/cve-2015-0235.stp</a> - cve-2015-0235 security band-aid<br>
327 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
328 <p>historical emergency security band-aid, for reference/education only</p></p>
329 </li><li><a href="security-band-aids/cve-2015-3456.stp">security-band-aids/cve-2015-3456.stp</a> - cve-2015-3456 security band-aid<br>
330 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
331 <p>historical emergency security band-aid, for reference/education only</p></p>
332 </li><li><a href="security-band-aids/cve-2015-7547.stp">security-band-aids/cve-2015-7547.stp</a> - cve-2015-7547 security band-aid<br>
333 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
334 <p>historical emergency security band-aid, for reference/education only</p></p>
335 </li><li><a href="security-band-aids/cve-2016-0728.stp">security-band-aids/cve-2016-0728.stp</a> - cve-2016-0728 security band-aid<br>
336 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
337 <p>historical emergency security band-aid, for reference/education only</p></p>
338 </li><li><a href="security-band-aids/cve-2016-5195.stp">security-band-aids/cve-2016-5195.stp</a> - cve-2016-5195 security band-aid<br>
339 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
340 <p>historical emergency security band-aid, for reference/education only</p></p>
341 </li><li><a href="security-band-aids/cve-2017-6074.stp">security-band-aids/cve-2017-6074.stp</a> - cve-2017-6074 security band-aid<br>
342 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
343 <p>historical emergency security band-aid, for reference/education only</p></p>
344 </li><li><a href="security-band-aids/cve-2018-1000001.stp">security-band-aids/cve-2018-1000001.stp</a> - cve-2018-1000001 security band-aid<br>
345 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
346 <p>historical emergency security band-aid, for reference/education only</p></p>
347 </li><li><a href="security-band-aids/cve-2018-14634.stp">security-band-aids/cve-2018-14634.stp</a> - cve-2018-14634 security band-aid<br>
348 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
349 <p>historical emergency security band-aid, for reference/education only</p></p>
350 </li><li><a href="security-band-aids/cve-2018-6485.stp">security-band-aids/cve-2018-6485.stp</a> - cve-2018-6485 security band-aid<br>
351 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
352 <p>historical emergency security band-aid, for reference/education only</p></p>
353 </li><li><a href="security-band-aids/cve-2021-4034.stp">security-band-aids/cve-2021-4034.stp</a> - cve-2021-4034 security band-aid<br>
354 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
355 <p>historical emergency security band-aid, for reference/education only</p></p>
356 </li><li><a href="security-band-aids/cve-2021-4155.stp">security-band-aids/cve-2021-4155.stp</a> - cve-2021-4155 security band-aid<br>
357 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
358 <p>historical emergency security band-aid, for reference/education only</p></p>
359 </li><li><a href="security-band-aids/cve-2023-4911.stp">security-band-aids/cve-2023-4911.stp</a> - cve-2023-4911 security band-aid<br>
360 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
361 <p>historical emergency security band-aid, for reference/education only</p></p>
362 </li></ul>
363 <h3><a name="INTERACTIVE"><a href="#INTERACTIVE">&para;</a> INTERACTIVE</a></h3>
364 <ul>
365 <li><a href="general/eventcount.stp">general/eventcount.stp</a> - Interactive Count Specified Events<br>
366 keywords: <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
367 <p>The script periodically prints a count of specified events and their related tid&#39;s over the course of execution. Numerous configuration options exist to control filtering / reporting, some of which can be modified at runtime. See the script source for more information.</p><p><i><a href="general/eventcount.txt">sample usage in general/eventcount.txt</i></font></p>
368 </li><li><a href="general/sizeof_interactive.stp">general/sizeof_interactive.stp</a> - Interactive Print the Size of a C Type<br>
369 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <br>
370 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name. Types and corresponding locations are provided to the script at runtime via keyboard input. The format of the input is identical to that of sizeof.stp (see script source for more information). Types and locations can be repeatedly given until the process is terminated. </p><p><i><a href="general/sizeof_interactive.txt">sample usage in general/sizeof_interactive.txt</i></font></p>
371 </li></ul>
372 <h3><a name="INTERRUPT"><a href="#INTERRUPT">&para;</a> INTERRUPT</a></h3>
373 <ul>
374 <li><a href="interrupt/interrupts-by-dev.stp">interrupt/interrupts-by-dev.stp</a> - Record Interrupts on a Per-Device Basis<br>
375 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
376 <p>The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.</p><p><i><a href="interrupt/interrupts-by-dev.txt">sample usage in interrupt/interrupts-by-dev.txt</i></font></p>
377 </li><li><a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt<br>
378 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
379 <p>The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.</p><p><font size="-2"><pre># stap scf.stp -T 1</pre></font></p>
380 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
381 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
382 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
383 </li></ul>
384 <h3><a name="IO"><a href="#IO">&para;</a> IO</a></h3>
385 <ul>
386 <li><a href="general/alias_suffixes.stp">general/alias_suffixes.stp</a> - Count I/O Syscalls using Alias Suffixes<br>
387 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
388 <p>alias_suffixes.stp is a demonstration of how alias suffixes in the systemtap language might be used. The script tracks the wall clock time for each invocation of the system calls open, close, read, and write. When the script exists it prints out the minimum, average, and maximum times in microseconds for each system call, followed by a count of times that each syscall was invoked and a histogram showing the distributions of times.</p><p><font size="-2"><pre># stap alias_suffixes.stp -T 1</pre></font></p>
389 </li><li><a href="io/capture_ssl_master_secrets.stp">io/capture_ssl_master_secrets.stp</a> - Capture SSL/TLS master secrets from gnutls and openssl users<br>
390 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
391 <p>Capture SSL/TLS master secrets from gnutls and openssl users for easy traffic decryption</p><p><i><a href="io/capture_ssl_master_secrets.txt">sample usage in io/capture_ssl_master_secrets.txt</i></font></p>
392 </li><li><a href="io/eatmydata.stp">io/eatmydata.stp</a> - disable fsync<br>
393 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#GURU">GURU</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
394 <p>Suppresses fsync() syscalls from processes identified by stap -c/-x by turning them into presumed-faster fsync() on some dummy or other file descriptor</p><p><i><a href="io/eatmydata.txt">sample usage in io/eatmydata.txt</i></font></p>
395 </li><li><a href="io/inodewatch.stp">io/inodewatch.stp</a> - Monitoring Reads and Writes to a File<br>
396 keywords: <a href="keyword-index.html#IO">IO</a> <br>
397 <p> The inodewatch.stp outputs the executable name and process id each time a read or write occurs to the specified inode on the specified major/minor device.</p><p><font size="-2"><pre># stap inodewatch.stp 0x08 0x01 100 -T 1</pre></font></p>
398 </li><li><a href="io/inodewatch2.stp">io/inodewatch2.stp</a> - Monitoring Attribute Changes to a File<br>
399 keywords: <a href="keyword-index.html#IO">IO</a> <br>
400 <p> The inodewatch2.stp script outputs the executable name, process id, and attributes each time the attributes are changed on the specified inode on the specified major/minor device.</p><p><font size="-2"><pre># stap inodewatch2.stp 0x08 0x01 100 -T 1</pre></font></p>
401 </li><li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
402 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
403 <p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p><p><font size="-2"><pre># stap io_submit.stp -T 1</pre></font></p>
404 </li><li><a href="io/ioblktime.stp">io/ioblktime.stp</a> - Average Time Block IO Requests Spend in Queue <br>
405 keywords: <a href="keyword-index.html#IO">IO</a> <br>
406 <p>The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with &quot;-DMAXMAPENTRIES=10000&quot; option on the stap command line.</p><p><font size="-2"><pre># stap ioblktime.stp -T 1</pre></font></p>
407 </li><li><a href="io/iodevstats.stp">io/iodevstats.stp</a> - List Executables Reading and Writing the Most Data by Device<br>
408 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
409 <p> The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.</p><p><i><a href="io/iodevstats.txt">sample usage in io/iodevstats.txt</i></font></p>
410 </li><li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - IO Statistics for SCSI Devices<br>
411 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
412 <p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine&#39;s various SCSI devices. The script takes one argument which is the number of seconds between reports.</p><p><i><a href="io/iostat-scsi.txt">sample usage in io/iostat-scsi.txt</i></font></p>
413 </li><li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
414 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
415 <p> The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.</p><p><i><a href="io/iostats.txt">sample usage in io/iostats.txt</i></font></p>
416 </li><li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
417 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILE">FILE</a> <br>
418 <p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the &quot;access&quot; keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the &quot;iotime&quot; keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p><p><font size="-2"><pre># stap iotime.stp -T 1</pre></font></p>
419 </li><li><a href="io/iotop.stp">io/iotop.stp</a> - Periodically Print IO Activity by Process Name<br>
420 keywords: <a href="keyword-index.html#IO">IO</a> <br>
421 <p>Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.</p><p><font size="-2"><pre># stap iotop.stp -T 1</pre></font></p>
422 </li><li><a href="io/mbrwatch.stp">io/mbrwatch.stp</a> - Monitor Read/Write of the Boot Sector Area of Block Devices<br>
423 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
424 <p> The mbrwatch.stp script reports any attempted reads/writes of the first few sectors of a raw block device.</p><p><i><a href="io/mbrwatch.txt">sample usage in io/mbrwatch.txt</i></font></p>
425 </li><li><a href="io/nfs_func_users.stp">io/nfs_func_users.stp</a> - Tally the Number of NFS Functions Used by Each Process<br>
426 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
427 <p>The nfs_func_users.stp script counts the uses of NFS functions in the kernel on a per process bases. The output is sorted from the process with the greatest number of NFS functions called to the least. The output contains the executable name, the process number, and the total number of NFS functions called by the process.</p><p><font size="-2"><pre># stap nfs_func_users.stp -T 1</pre></font></p>
428 </li><li><a href="io/slowvfs.stp">io/slowvfs.stp</a> - Trace slow vfs opens.<br>
429 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
430 <p>This script prints a line for every kernel vfs_open operation that takes longer than a configurable number of microseconds. Highly contended or remote filesystems are likelier to hit this.</p><p><font size="-2"><pre># stap slowvfs.stp -G sloth=10 -c &#39;find /proc &gt;/dev/null || true&#39;</pre></font></p>
431 </li><li><a href="io/switchfile.stp">io/switchfile.stp</a> - Switch log files<br>
432 keywords: <a href="keyword-index.html#IO">IO</a> <br>
433 <p>Every second print a log message and switch log files every 5 seconds.</p><p><font size="-2"><pre># stap -o /tmp/switchfile.stp.out switchfile.stp -T 8</pre></font></p>
434 </li><li><a href="io/traceaio.stp">io/traceaio.stp</a> - Trace calls to io_submit<br>
435 keywords: <a href="keyword-index.html#IO">IO</a> <br>
436 <p>Trace calls to io_submit, logging iocbs and iovecs.</p><p><i><a href="io/traceaio.txt">sample usage in io/traceaio.txt</i></font></p>
437 </li><li><a href="io/traceio.stp">io/traceio.stp</a> - Track Cumulative IO Activity by Process Name<br>
438 keywords: <a href="keyword-index.html#IO">IO</a> <br>
439 <p>Every second print out the top ten executables sorted in descending order based on cumulative I/O traffic observed.</p><p><font size="-2"><pre># stap traceio.stp -T 1</pre></font></p>
440 </li><li><a href="io/traceio2.stp">io/traceio2.stp</a> - Watch IO Activity on a Particular Device<br>
441 keywords: <a href="keyword-index.html#IO">IO</a> <br>
442 <p>Print out the executable name and process number as reads and writes to the specified device occur.</p><p><font size="-2"><pre># stap traceio2.stp 0x0801 -T 1</pre></font></p>
443 </li><li><a href="io/traceio3.stp">io/traceio3.stp</a> - Trace VFS writes to files<br>
444 keywords: <a href="keyword-index.html#IO">IO</a> <br>
445 <p>Print a list of files being written to at the kernel VFS layer. Optionally, accept a regular expression to match file names against.</p><p><font size="-2"><pre># stap traceio3.stp /dev -T 5</pre></font></p>
446 </li><li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor TTY Typing<br>
447 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#TTY">TTY</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#GURU">GURU</a> <br>
448 <p>The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis.</p><p><i><a href="io/ttyspy.txt">sample usage in io/ttyspy.txt</i></font></p>
449 </li><li><a href="lwtools/biolatency-nd.stp">lwtools/biolatency-nd.stp</a> - Measure block I/O latency distribution (non-debuginfo)<br>
450 keywords: <a href="keyword-index.html#IO">IO</a> <br>
451 <p>This measures block I/O latency (storage I/O, ie, disk I/O), and shows the distribution as a histogram. This can be useful to identify the characteristics of I/O latency, beyond the averages shown by iostat(1). For example, to study I/O latency outliers, or multi-modal distributions.</p><p><font size="-2"><pre># stap biolatency-nd.stp 1 1</pre></font></p>
452 </li><li><a href="lwtools/bitesize-nd.stp">lwtools/bitesize-nd.stp</a> - Measure block I/O size distribution (non-debuginfo)<br>
453 keywords: <a href="keyword-index.html#IO">IO</a> <br>
454 <p>This uses the kernel tracepoint block_rq_insert to read the size of I/O. The output includes the name of the process or thread that was on-CPU when the I/O request was inserted on the issue queue.</p><p><font size="-2"><pre># stap bitesize-nd.stp -T 1</pre></font></p>
455 </li><li><a href="lwtools/execsnoop-nd.stp">lwtools/execsnoop-nd.stp</a> - Trace process exec() with command line argument details (non-debuginfo)<br>
456 keywords: <a href="keyword-index.html#IO">IO</a> <br>
457 <p>This can identify if CPU is consumed by short-lived processes, by tracing new process execution. It works by tracing exec() from the fork()-&gt;exec() sequence, which means it will not catch new processes that only fork(). It will also show every exec(), including those if a process re-execs.</p><p><font size="-2"><pre># stap execsnoop-nd.stp -T 1</pre></font></p>
458 </li><li><a href="lwtools/fslatency-nd.stp">lwtools/fslatency-nd.stp</a> - Measure the distribution of file system synchronous read and write latency (non-debuginfo)<br>
459 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
460 <p>This dynamically traces two common file system functions: do_sync_read() and do_sync_write(), and reports a histogram distribution of latency. Many, but not all, file systems and workloads use these functions. Tracing their time provides one view of suffered file system latency.</p><p><font size="-2"><pre># stap fslatency-nd.stp 1 1</pre></font></p>
461 </li><li><a href="lwtools/fsslower-nd.stp">lwtools/fsslower-nd.stp</a> - Trace slow file system synchronous reads and writes (non-debuginfo)<br>
462 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILESYSTEM">FILESYSTEM</a> <br>
463 <p>This dynamically traces two common file system functions: do_sync_read() and do_sync_write(), and shows details of each call that is slower than a threshold. Many, but not all, file systems and workloads use these functions. Tracing their time provides one view of suffered file system latency.</p><p><font size="-2"><pre># stap fsslower-nd.stp -T 1</pre></font></p>
464 </li><li><a href="lwtools/killsnoop-nd.stp">lwtools/killsnoop-nd.stp</a> - Trace kill() signals showing process and signal details (non-debuginfo)<br>
465 keywords: <a href="keyword-index.html#IO">IO</a> <br>
466 <p>This traces signals system-wide, including those sent by the kill(1) command, and shows various details.</p><p><font size="-2"><pre># stap killsnoop-nd.stp -T 1</pre></font></p>
467 </li><li><a href="lwtools/opensnoop-nd.stp">lwtools/opensnoop-nd.stp</a> - Trace open() syscalls showing filenames (non-debuginfo)<br>
468 keywords: <a href="keyword-index.html#IO">IO</a> <br>
469 <p>This traces the open() syscall system-wide, to show which files are being opened, and by who.</p><p><font size="-2"><pre># stap opensnoop-nd.stp -T 1</pre></font></p>
470 </li><li><a href="lwtools/rwtime-nd.stp">lwtools/rwtime-nd.stp</a> - Summarize read() and write() syscall latency (non-debuginfo)<br>
471 keywords: <a href="keyword-index.html#IO">IO</a> <br>
472 <p>This traces read() and write() syscalls, producing a histogram summary of their durations (aka latencies).</p><p><font size="-2"><pre># stap rwtime-nd.stp -T 1</pre></font></p>
473 </li><li><a href="lwtools/syscallbypid-nd.stp">lwtools/syscallbypid-nd.stp</a> - Count syscalls with process details (non-debuginfo)<br>
474 keywords: <a href="keyword-index.html#IO">IO</a> <br>
475 <p>This traces syscalls system-wide, and produces a summary report showing their counts by process ID, process name, and syscall types.</p><p><font size="-2"><pre># stap syscallbypid-nd.stp -T 1</pre></font></p>
476 </li><li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generate Backtraces of Threads Waiting for IO Operations<br>
477 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
478 <p>The script monitors the time that threads spend in waiting for IO operations (in &quot;D&quot; state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.</p><p><font size="-2"><pre># stap sleepingBeauties.stp -T 1</pre></font></p>
479 </li><li><a href="virtualization/qemu_io.stp">virtualization/qemu_io.stp</a> - Tally the Number of User-Space QEMU IO on Each IO Port<br>
480 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <a href="keyword-index.html#IO">IO</a> <br>
481 <p>The qemu_io.stp script tallies the number of times each of the IO port on the guest virtual machines is touched by a input or output operation. When the script exits, it prints a count of the number of times each IO port read and written.</p><p><font size="-2"><pre># stap qemu_io.stp -T 1</pre></font></p>
482 </li></ul>
483 <h3><a name="JSON"><a href="#JSON">&para;</a> JSON</a></h3>
484 <ul>
485 <li><a href="network/net_xmit_json.stp">network/net_xmit_json.stp</a> - Tracks time between packet queue and transmit.<br>
486 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#JSON">JSON</a> <br>
487 <p>This script tracks time between packet queue and transmit. The information is provided to userspace via procfs in JSON format.</p><p><font size="-2"><pre># stap net_xmit_json.stp -T 1</pre></font></p>
488 </li><li><a href="network/netfilter_summary_json.stp">network/netfilter_summary_json.stp</a> - System-Wide Count of Network Packets by IPs<br>
489 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#JSON">JSON</a> <br>
490 <p>The script watches all IPv4 network traffic on the system. The data is output in JSON format and includes the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair.</p><p><font size="-2"><pre># stap netfilter_summary_json.stp -T 1</pre></font></p>
491 </li></ul>
492 <h3><a name="KVM"><a href="#KVM">&para;</a> KVM</a></h3>
493 <ul>
494 <li><a href="virtualization/kvm_service_time.stp">virtualization/kvm_service_time.stp</a> - Time Statistics on KVM Exit Reasons<br>
495 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#KVM">KVM</a> <br>
496 <p>The kvm_service_time.stp script tracks the statistics about the amount of time that the processor left the guest virtual machine for each exit reason (for example fixing up a page table or handling an IO operation). When the script exits it prints out the number of times each exit reason was encountered, the total duration of time it left the guest VM, the minimum time, the average time, and the maximum time in microseconds for that exit reason. On Linux 2.6.38 and newer kernel the script can automatically determine whether it is running on Intel or AMD processors. For older kernels with a kernel.trace(&quot;kvm_exit&quot;) tracepoint that does not have the $isa parameter you can explicitly state the kvm type with a &quot;-G kvm=intel&quot; or &quot;-G kvm=amd&quot; on the command line.</p><p><i><a href="virtualization/kvm_service_time.txt">sample usage in virtualization/kvm_service_time.txt</i></font></p>
497 </li><li><a href="virtualization/qemu_count.stp">virtualization/qemu_count.stp</a> - Tally the Number of User-Space QEMU Events<br>
498 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <br>
499 <p>The qemu_count.stp script tallies the number of times each of the user-space qemu probepoints is encountered. When the script exits, it prints a list of the number of times each user-space qemu probepoint is encountered.</p><p><font size="-2"><pre># stap qemu_count.stp -T 1</pre></font></p>
500 </li><li><a href="virtualization/qemu_io.stp">virtualization/qemu_io.stp</a> - Tally the Number of User-Space QEMU IO on Each IO Port<br>
501 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <a href="keyword-index.html#IO">IO</a> <br>
502 <p>The qemu_io.stp script tallies the number of times each of the IO port on the guest virtual machines is touched by a input or output operation. When the script exits, it prints a count of the number of times each IO port read and written.</p><p><font size="-2"><pre># stap qemu_io.stp -T 1</pre></font></p>
503 </li></ul>
504 <h3><a name="LIMITS"><a href="#LIMITS">&para;</a> LIMITS</a></h3>
505 <ul>
506 <li><a href="general/cpu_throttle.stp">general/cpu_throttle.stp</a> - Monitor Intel processors for throttling due to power or thermal limits<br>
507 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#LIMITS">LIMITS</a> <br>
508 <p>Intel processors have hardware mechanisms that will reduce the effective processors speed to avoid exceeding set thermal or power constraints. The cpu_throttle.stp script monitors when CPU throttling occurs and accumulates the amount of time in milliseconds that each processor is throttled. The script makes the information available via procfs in Prometheus readable format.</p><p><font size="-2"><pre># stap cpu_throttle.stp -T 1</pre></font></p>
509 </li><li><a href="memory/overcommit.stp">memory/overcommit.stp</a> - Log Failed Process Memory Allocation Due to Overcommit Limits<br>
510 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#LIMITS">LIMITS</a> <br>
511 <p>The overcommit.stp script prints a line each time the kernel refuses a memory allocation request from a process because of /proc/sys/vm/overcommit* limits.</p><p><font size="-2"><pre># stap overcommit.stp -T 1</pre></font></p>
512 </li><li><a href="process/rlimit_nofile.stp">process/rlimit_nofile.stp</a> - Trace processes running out of file descriptors <br>
513 keywords: <a href="keyword-index.html#LIMITS">LIMITS</a> <br>
514 <p>This script watches processes being scheduled and which try to allocate a file descriptor without luck.</p><p><font size="-2"><pre># stap rlimit_nofile.stp -T 1</pre></font></p>
515 </li></ul>
516 <h3><a name="LOCKING"><a href="#LOCKING">&para;</a> LOCKING</a></h3>
517 <ul>
518 <li><a href="locks/bkl.stp">locks/bkl.stp</a> - Tracing Contention on Big Kernel Lock<br>
519 keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br>
520 <p>The bkl.stp script can help determine whether the Big Kernel Lock (BKL) is causing serialization on a multiprocessor system due to excessive contention of the BKL. The bkl.stp script takes two arguments. The first one is optional, and used to enable backtraces, and print them once a process has been holding the BKL for a user specified number of nseconds is reached. The second option is compulsory and is the number of processes waiting for the Big Kernel Lock (BKL). When the number of processes waiting for the BKL is reached or exceeded, the script will print a time stamp, the number of processes waiting for the BKL, the holder of the BKL, and the amount of time the BKL was held. If backtraces are enabled, a backtrace will be printed as well.</p><p><font size="-2"><pre># stap bkl.stp -T 1 1</pre></font></p>
521 </li><li><a href="locks/bkl_stats.stp">locks/bkl_stats.stp</a> - Per Process Statistics on Big Kernel Lock Use<br>
522 keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br>
523 <p>The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent in holding the lock for each of the processes.</p><p><font size="-2"><pre># stap bkl_stats.stp -T 1</pre></font></p>
524 </li><li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
525 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
526 <p>The script watches the futex syscall on the system. On exit the futex&#39;s address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><i><a href="process/futexes.txt">sample usage in process/futexes.txt</i></font></p>
527 </li><li><a href="process/futexes2.stp">process/futexes2.stp</a> - System-Wide Shared Futex Contention<br>
528 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
529 <p>The script watches just shared futex syscalls on the system. On exit the futex&#39;s key, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><font size="-2"><pre># stap futexes2.stp -T 1</pre></font></p>
530 </li><li><a href="process/mutex-contention.stp">process/mutex-contention.stp</a> - pthread mutex contention analysis<br>
531 keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br>
532 <p>Tracks pthread-mutex initialization/use and underlying futex operations, to identify (with backtraces/symbol-names) the mutexes suffering most contention. Invoke with &quot;-d SHLIB --ldd&quot;, perhaps with -DMAXMAPENTRIES=NNNN for some large NNNN, if the arrays overflow due to heavy activity.</p><p><font size="-2"><pre># stap mutex-contention.stp -T 1</pre></font></p>
533 </li><li><a href="process/semop-watch.stp">process/semop-watch.stp</a> - Watch semop(2)/semtimedop(2) operations<br>
534 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <br>
535 <p>Prints a timed trace of semop(2)/semtimedop(2) syscalls</p><p><font size="-2"><pre># stap semop-watch.stp -c &#39;sleep 2&#39;</pre></font></p>
536 </li></ul>
537 <h3><a name="MEMORY"><a href="#MEMORY">&para;</a> MEMORY</a></h3>
538 <ul>
539 <li><a href="general/sizeof.stp">general/sizeof.stp</a> - Print the Size of a C Type<br>
540 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
541 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name.</p><p><i><a href="general/sizeof.txt">sample usage in general/sizeof.txt</i></font></p>
542 </li><li><a href="general/sizeof_interactive.stp">general/sizeof_interactive.stp</a> - Interactive Print the Size of a C Type<br>
543 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <br>
544 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name. Types and corresponding locations are provided to the script at runtime via keyboard input. The format of the input is identical to that of sizeof.stp (see script source for more information). Types and locations can be repeatedly given until the process is terminated. </p><p><i><a href="general/sizeof_interactive.txt">sample usage in general/sizeof_interactive.txt</i></font></p>
545 </li><li><a href="memory/cachestat.stp">memory/cachestat.stp</a> - Count Page Cache Hits and Misses<br>
546 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
547 <p>Monitors hits and misses to the page cache and reports a count every 5 seconds. Based on a bpftrace tool by David Valin.</p><p><font size="-2"><pre># stap cachestat.stp -T 1</pre></font></p>
548 </li><li><a href="memory/glibc-malloc.stp">memory/glibc-malloc.stp</a> - Overview glibc malloc internal operations<br>
549 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
550 <p>This script reports on internal statistics of the glibc malloc implementation, as used by a process restricted by stap -x/-c</p><p><font size="-2"><pre># stap glibc-malloc.stp -c &#39;stap --dump-functions&#39;</pre></font></p>
551 </li><li><a href="memory/hugepage_clear_delays.stp">memory/hugepage_clear_delays.stp</a> - Summarize the time each process spends clearing huge pages<br>
552 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
553 <p>When a huge page is initially used by a process it must be cleared of its original contents to avoid leaking information between processes. On x86_64 machines the huge pages are 2MB in size, 512 times larger than a normal 4KB page. Thus, clearing a huge page can delay program execution by a hundred or more microseconds and maybe noticeable to latency sensitive programs. This script will tally the number of times that each process triggers a huge page clear, the total time in microseconds spent clearing the pages, and the average time in microseconds of the huge page clear.</p><p><font size="-2"><pre># stap hugepage_clear_delays.stp -T 1</pre></font></p>
554 </li><li><a href="memory/hugepage_collapse.stp">memory/hugepage_collapse.stp</a> - Log the kernel collapsing normal pages into a huge page<br>
555 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
556 <p>The kernel may attempt to group many normal sized pages into a single huge page to improve TLB performance. This operation may take a significant amount of time and affect program performance. You can identify if huge page collapse operations are occurring with the systemtap hugepage_collapse.stp script.</p><p><font size="-2"><pre># stap hugepage_collapse.stp -T 1</pre></font></p>
557 </li><li><a href="memory/hugepage_cow_delays.stp">memory/hugepage_cow_delays.stp</a> - Summarize the time each process spends doing copy on write for huge pages<br>
558 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
559 <p>The system may attempt to reduce memory use by having two or more difference processes share the same writeable page in memory. However, when one of the processes write to shared page that is marked copy on write (COW) the page must be duplicated and then modified. On x86_64 machines the huge pages are 2MB in size, 512 times larger than a normal 4KB page. Thus, copy on write operation on a huge page can delay program execution by a hundred or more microseconds and maybe noticeable to latency sensitive programs. This script will tally the number of times that each process triggers a huge page copy on write, the total time in microseconds spent copying the pages, and the average time in microseconds of the huge page copy.</p><p><font size="-2"><pre># stap hugepage_cow_delays.stp -T 1</pre></font></p>
560 </li><li><a href="memory/hugepage_split.stp">memory/hugepage_split.stp</a> - Log the kernel splitting huge pages into normal sized pages<br>
561 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
562 <p>Because some portions of the kernel code only work with normal-sized pages the kernel may convert a huge page into a set of normal-sized pages using a split operation. This operation may be relatively expensive and noticeable to latency sensitive programs. You can identify if split operations are occurring with the systemtap hugepage_split.stp script.</p><p><font size="-2"><pre># stap hugepage_split.stp -T 1</pre></font></p>
563 </li><li><a href="memory/hw_watch_addr.stp">memory/hw_watch_addr.stp</a> - Watch a Kernel Address Using Breakpoint Hardware<br>
564 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#WATCHPOINT">WATCHPOINT</a> <br>
565 <p>The script will watch accesses to a single kernel address and prints a traceback each time the address is accessed. This script needs to be run as root to allow access to the breakpoint hardware.</p><p><font size="-2"><pre># stap --all-modules hw_watch_addr.stp 0x`grep &quot;vm_dirty_ratio&quot; \
566 /proc/kallsyms | awk &#39;{print $1}&#39;` -T 5</pre></font></p>
567 </li><li><a href="memory/hw_watch_sym.stp">memory/hw_watch_sym.stp</a> - Watch a Kernel Symbol Using Breakpoint Hardware<br>
568 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#WATCHPOINT">WATCHPOINT</a> <br>
569 <p>The script will watch accesses to the starting address of a single kernel symbol and prints a traceback each time the symbol is accessed. This script needs to be run as root to allow access to the breakpoint hardware.</p><p><font size="-2"><pre># stap --all-modules hw_watch_sym.stp vm_dirty_ratio -T 5</pre></font></p>
570 </li><li><a href="memory/kmalloc-top">memory/kmalloc-top</a> - Show Paths to Kernel Malloc Invocations<br>
571 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
572 <p>The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be filtered to print only the first N stack traces (-t), stack traces with a minimum counts (-m), or exclude certain stack traces (-e).</p><p><i><a href="memory/kmalloc-top">sample usage in memory/kmalloc-top</i></font></p>
573 </li><li><a href="memory/last_100_frees.stp">memory/last_100_frees.stp</a> - Log recent free(3) calls.<br>
574 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
575 <p>This script reports on the last few free(3) libc calls done by processes (possibly restricted by stap -x/-c), along with a userspace backtrace at those moments.</p><p><i><a href="memory/last_100_frees.txt">sample usage in memory/last_100_frees.txt</i></font></p>
576 </li><li><a href="memory/mmanonpage.stp">memory/mmanonpage.stp</a> - Track Virtual Memory System Actions on Anonymous Pages<br>
577 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
578 <p>The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. It&#39;s useful in debugging leaks in the anonymous regions of a process.</p><p><font size="-2"><pre># stap mmanonpage.stp -T 1</pre></font></p>
579 </li><li><a href="memory/mmfilepage.stp">memory/mmfilepage.stp</a> - Track Virtual Memory System Actions on File Backed Pages<br>
580 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
581 <p>The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.</p><p><font size="-2"><pre># stap mmfilepage.stp -T 1</pre></font></p>
582 </li><li><a href="memory/mmreclaim.stp">memory/mmreclaim.stp</a> - Track Virtual Memory System Page Reclamation<br>
583 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
584 <p>The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. It&#39;s useful in debugging performance problems that occur due to page reclamation.</p><p><font size="-2"><pre># stap mmreclaim.stp -T 1</pre></font></p>
585 </li><li><a href="memory/mmwriteback.stp">memory/mmwriteback.stp</a> - Track Virtual Memory System Writing to Disk<br>
586 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
587 <p>The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It&#39;s useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.</p><p><font size="-2"><pre># stap mmwriteback.stp -T 1</pre></font></p>
588 </li><li><a href="memory/numa_faults.stp">memory/numa_faults.stp</a> - Summarize Process Misses across NUMA Nodes<br>
589 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#NUMA">NUMA</a> <br>
590 <p>The numa_faults.stp script tracks the read and write pages faults for each process. When the script exits it prints out the total read and write pages faults for each process. The script also provide a break down of page faults per node for each process. This script is useful for determining whether the program has good locality (page faults limited to a single node) on a NUMA computer.</p><p><i><a href="memory/numa_faults.txt">sample usage in memory/numa_faults.txt</i></font></p>
591 </li><li><a href="memory/overcommit.stp">memory/overcommit.stp</a> - Log Failed Process Memory Allocation Due to Overcommit Limits<br>
592 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#LIMITS">LIMITS</a> <br>
593 <p>The overcommit.stp script prints a line each time the kernel refuses a memory allocation request from a process because of /proc/sys/vm/overcommit* limits.</p><p><font size="-2"><pre># stap overcommit.stp -T 1</pre></font></p>
594 </li><li><a href="memory/pfaults.stp">memory/pfaults.stp</a> - Generate Log of Major and Minor Page Faults<br>
595 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br>
596 <p>The pfaults.stp script generates a simple log for each major and minor page fault that occurs on the system. Each line contains a timestamp (in microseconds) when the page fault servicing was completed, the pid of the process, the address of the page fault, the type of access (read or write), the type of fault (major or minor), and the elapsed time for page fault. This log can be examined to determine where the page faults are occurring.</p><p><i><a href="memory/pfaults.txt">sample usage in memory/pfaults.txt</i></font></p>
597 </li><li><a href="memory/swapmonitor.stp">memory/swapmonitor.stp</a> - Summarize swap operations<br>
598 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#SWAP">SWAP</a> <br>
599 <p>The swapmonitor.stp script is an example to monitor &quot;swap in/out&quot; in RHEL. This stap monitor the call of &quot;swap_readpage&quot; and &quot;swap_writepage&quot;, and then printf the timeframe, func, execname, pid and the count with 10 seconds interval.</p><p><font size="-2"><pre># stap swapmonitor.stp -T 5</pre></font></p>
600 </li><li><a href="memory/vm.tracepoints.stp">memory/vm.tracepoints.stp</a> - Collect Slab Allocation Statistics<br>
601 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
602 <p>The script will probe all memory slab/slub allocations and collects information about the size of the object (bytes requested) and user-space process in execution. When run over a period of time, it helps to correlate kernel-space memory consumption owing to user-space processes.</p><p><i><a href="memory/vm.tracepoints.txt">sample usage in memory/vm.tracepoints.txt</i></font></p>
603 </li></ul>
604 <h3><a name="MONITORING"><a href="#MONITORING">&para;</a> MONITORING</a></h3>
605 <ul>
606 <li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization with gnuplot<br>
607 keywords: <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
608 <p>The script tracks the disk and CPU utilization. It prints a stream of data which, when piped directly into gnuplot, draws historical curves for each.</p><p><font size="-2"><pre># stap graphs.stp -T 1</pre></font></p>
609 </li><li><a href="general/measureinterval.stp">general/measureinterval.stp</a> - Measure intervals between events<br>
610 keywords: <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
611 <p>The measureinteval.stp script allows quick creation of instrumentation to measure quantity between different probe points, aggregate the measurements, and display the results. The first argument to the script is the quantity to measure such as time in microseconds via &quot;gettimeofday_us()&quot;. There could be multiple intervals being measured concurrently and the second argument is the means to match the start probe points listed in the fourth argument with the end probes listed in the fifth argument. The third argument is how to display the aggregated data. The data could be displayed as a sum (@sum), an average (@avg), or a histogram (@hist_log). The fourth and fifth arguments are lists of probes marking the start and end of an interval. An optional sixth argument allows grouping of the intervals. One could use &quot;tid()&quot; for the matching argument to measure the intervals on a per-thread basis, but then use &quot;execname()&quot; for the optional argument to group the measurements by executable name. If there is no sixth argument, all the intervals are aggregated into a single entry.</p><p><font size="-2"><pre># stap measureinterval.stp &quot;gettimeofday_us()&quot; &quot;tid()&quot; @sum vm.pagefault \
612 vm.pagefault.return &quot;execname()&quot; -c &#39;sleep 3&#39;</pre></font></p>
613 </li><li><a href="general/varwatch.stp">general/varwatch.stp</a> - Watch a Variable Changing Value in a Thread<br>
614 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
615 <p>This script places a set of probes (specified by $1), each of which monitors the state of some context $variable expression (specified by $2). Whenever the value changes, with respect to the active thread, the event is traced.</p><p><i><a href="general/varwatch.txt">sample usage in general/varwatch.txt</i></font></p>
616 </li><li><a href="general/whythefail.stp">general/whythefail.stp</a> - Why did the function fail?<br>
617 keywords: <a href="keyword-index.html#SPECULATION">SPECULATION</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
618 <p>The whythefail.stp script prints a statement-execution trace for a given function, but only for those runs of the function that ended up with a (configurable) post-return condition.</p><p><i><a href="general/whythefail.txt">sample usage in general/whythefail.txt</i></font></p>
619 </li><li><a href="io/capture_ssl_master_secrets.stp">io/capture_ssl_master_secrets.stp</a> - Capture SSL/TLS master secrets from gnutls and openssl users<br>
620 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <br>
621 <p>Capture SSL/TLS master secrets from gnutls and openssl users for easy traffic decryption</p><p><i><a href="io/capture_ssl_master_secrets.txt">sample usage in io/capture_ssl_master_secrets.txt</i></font></p>
622 </li><li><a href="io/mbrwatch.stp">io/mbrwatch.stp</a> - Monitor Read/Write of the Boot Sector Area of Block Devices<br>
623 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
624 <p> The mbrwatch.stp script reports any attempted reads/writes of the first few sectors of a raw block device.</p><p><i><a href="io/mbrwatch.txt">sample usage in io/mbrwatch.txt</i></font></p>
625 </li><li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor TTY Typing<br>
626 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#TTY">TTY</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#GURU">GURU</a> <br>
627 <p>The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis.</p><p><i><a href="io/ttyspy.txt">sample usage in io/ttyspy.txt</i></font></p>
628 </li><li><a href="process/auditbt.stp">process/auditbt.stp</a> - Generate backtraces for kernel audit events<br>
629 keywords: <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
630 <p>Attaches to the kernel audit-log paths (also used by libaudit), and log every record being sent, along with a user-space backtrace of the process that caused it.</p><p><font size="-2"><pre># stap auditbt.stp -d /usr/bin/sudo --ldd -c &quot;sudo true&quot;</pre></font></p>
631 </li><li><a href="process/procmod_watcher.stp">process/procmod_watcher.stp</a> - Monitor process creation/termination and module [un]loading<br>
632 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
633 <p>The procmod_watcher.stp script monitors calls to fork(), exec(), exit(), init_module(), and delete_module(). Event-specific details are also printed out (e.g. for exec(), the file being exec&#39;ed). This script does not require debuginfo.</p><p><font size="-2"><pre># stap procmod_watcher.stp -T 1</pre></font></p>
634 </li></ul>
635 <h3><a name="NANOSLEEP"><a href="#NANOSLEEP">&para;</a> NANOSLEEP</a></h3>
636 <ul>
637 <li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in Nanosleep Syscalls<br>
638 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#NANOSLEEP">NANOSLEEP</a> <br>
639 <p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in parentheses, the &quot;nanosleep:&quot; key, and the duration of the sleep in microseconds.</p><p><font size="-2"><pre># stap sleeptime.stp -T 1</pre></font></p>
640 </li></ul>
641 <h3><a name="NETWORK"><a href="#NETWORK">&para;</a> NETWORK</a></h3>
642 <ul>
643 <li><a href="lwtools/accept2close-nd.stp">lwtools/accept2close-nd.stp</a> - Show socket lifespan, from accept() to close() (non-debuginfo)<br>
644 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
645 <p>This traces socket duration from the accept() syscall to close(), and provides details on the lifespan of these passive connections, showing the distribution as a histogram.</p><p><i><a href="lwtools/accept2close-nd.txt">sample usage in lwtools/accept2close-nd.txt</i></font></p>
646 </li><li><a href="network/autofs4.stp">network/autofs4.stp</a> - Watch autofs4 Operations<br>
647 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#NFS">NFS</a> <br>
648 <p>Trace key autofs4 operations such as mounting or unmounting remote filesystems.</p><p><font size="-2"><pre># stap autofs4.stp -T 1</pre></font></p>
649 </li><li><a href="network/connect_stat.stp">network/connect_stat.stp</a> - Show Process Ancestry for IP Connections<br>
650 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
651 <p>The connect_stat.stp script prints a task&#39;s entire ancestry (parent process name/uid/gid) whenever it attempts an outgoing socket connection to a given IP address.</p><p><font size="-2"><pre># stap connect_stat.stp 127.0.0.1 -T 1</pre></font></p>
652 </li><li><a href="network/dropwatch.stp">network/dropwatch.stp</a> - Watch Where Socket Buffers Are Freed in the Kernel<br>
653 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
654 <p>Every five seconds the dropwatch.stp script lists the number of socket buffers freed at locations in the kernel.</p><p><font size="-2"><pre># stap -d kernel dropwatch.stp -T 1</pre></font></p>
655 </li><li><a href="network/net_xmit_json.stp">network/net_xmit_json.stp</a> - Tracks time between packet queue and transmit.<br>
656 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#JSON">JSON</a> <br>
657 <p>This script tracks time between packet queue and transmit. The information is provided to userspace via procfs in JSON format.</p><p><font size="-2"><pre># stap net_xmit_json.stp -T 1</pre></font></p>
658 </li><li><a href="network/netdev.stp">network/netdev.stp</a> - Trace Activity on Network Devices<br>
659 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
660 <p>The netdev.stp script traces configuration and transmit/receive activity on network devices.</p><p><font size="-2"><pre># stap netdev.stp -T 1</pre></font></p>
661 </li><li><a href="network/netfilter_drop.stp">network/netfilter_drop.stp</a> - System-Wide Network Packet Dropping Tool<br>
662 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#PACKETS">PACKETS</a> <a href="keyword-index.html#GURU">GURU</a> <br>
663 <p>The script drops the specified number of packets of the specified protocol. Valid protocols are TCP, UDP, or ALL. If ALL is specified, all incoming packets are dropped. The number of packets to drop can be specified with a positive integer. A value of 0 indicates that packets should be dropped until the user manually exits.</p><p><font size="-2"><pre># stap -g netfilter_drop.stp TCP 1 -T 2</pre></font></p>
664 </li><li><a href="network/netfilter_summary.stp">network/netfilter_summary.stp</a> - System-Wide Count of Network Packets by IPs<br>
665 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
666 <p>The script watches all IPv4 network traffic on the system. On exit the script prints a list showing the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair. The list is ordered from greatest to least number of packets seen among the source/destination pairs.</p><p><i><a href="network/netfilter_summary.txt">sample usage in network/netfilter_summary.txt</i></font></p>
667 </li><li><a href="network/netfilter_summary_json.stp">network/netfilter_summary_json.stp</a> - System-Wide Count of Network Packets by IPs<br>
668 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#JSON">JSON</a> <br>
669 <p>The script watches all IPv4 network traffic on the system. The data is output in JSON format and includes the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair.</p><p><font size="-2"><pre># stap netfilter_summary_json.stp -T 1</pre></font></p>
670 </li><li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
671 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
672 <p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p><p><i><a href="network/nettop.txt">sample usage in network/nettop.txt</i></font></p>
673 </li><li><a href="network/packet_contents.stp">network/packet_contents.stp</a> - Network packet contents<br>
674 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
675 <p>The packet_contents.stp script displays the length of each network packet and its contents in both hexadecimal and ASCII. Systemtap strings are MAXSTRINGLEN in length by default which may not be enough for larger packets. In order to print larger packets, this limit can be increased by passing in the &quot;-DMAXSTRINGLEN=65536&quot; command line option.</p><p><i><a href="network/packet_contents.txt">sample usage in network/packet_contents.txt</i></font></p>
676 </li><li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br>
677 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BPF">BPF</a> <br>
678 <p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p><p><font size="-2"><pre># stap sk_stream_wait_memory.stp -T 1</pre></font></p>
679 </li><li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions Called in Network Socket Code<br>
680 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
681 <p>The script instruments each of the functions in the Linux kernel&#39;s net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The &quot;-&gt;&quot; and &quot;&lt;-&quot; indicates function entry and function exit, respectively. The last element of the line is the function name.</p><p><font size="-2"><pre># stap socket-trace.stp -T 1</pre></font></p>
682 </li><li><a href="network/socktop">network/socktop</a> - Periodically Summarize Socket Activity on the System<br>
683 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
684 <p>The socktop script periodically prints out a list of the processes with the highest socket activity. Command line options for the script allow filtering to focus on particular types of sockets. The &quot;-h&quot; option lists socktop script&#39;s filtering options.</p><p><i><a href="network/socktop">sample usage in network/socktop</i></font></p>
685 </li><li><a href="network/stp_dump.stp">network/stp_dump.stp</a> - Dump of STP packets<br>
686 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
687 <p>The stp_dump.stp prints out the packet contents. Each block contains the STP protocol ID, version ID, flags, root and bridge MAC addresses, and various times.</p><p><i><a href="network/stp_dump.txt">sample usage in network/stp_dump.txt</i></font></p>
688 </li><li><a href="network/tcp_connections.stp">network/tcp_connections.stp</a> - Track Creation of Incoming TCP Connections<br>
689 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
690 <p>The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.</p><p><font size="-2"><pre># stap tcp_connections.stp -T 1</pre></font></p>
691 </li><li><a href="network/tcp_init_cwnd.stp">network/tcp_init_cwnd.stp</a> - Increase Initial TCP Congestion Window to 10<br>
692 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#GURU">GURU</a> <br>
693 <p>Run the tcp_init_cwnd.stp script in the background to override a kernel&#39;s default tcp cwnd value to 10, which has been found to improve latency for web server type workloads. The script prints a count of cwnd value changes when it is stopped.</p><p><font size="-2"><pre># stap -g tcp_init_cwnd.stp -T 1</pre></font></p>
694 </li><li><a href="network/tcp_trace.stp">network/tcp_trace.stp</a> - TCP Connection Tracing Utility<br>
695 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
696 <p>This scripts traces a given TCP connection based on the filter parameters given by the user. The indexing is done by the 4 tuples local address, remote address, local port, remote port.</p><p><i><a href="network/tcp_trace.txt">sample usage in network/tcp_trace.txt</i></font></p>
697 </li><li><a href="network/tcpdumplike.stp">network/tcpdumplike.stp</a> - Dump of Received UDP/TCP Packets<br>
698 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
699 <p>The tcpdumplike.stp prints out a line for each TCP &amp; UDP packet received. Each line includes the source and destination IP addresses, the source and destination ports, and flags.</p><p><font size="-2"><pre># stap tcpdumplike.stp -T 1</pre></font></p>
700 </li><li><a href="network/tcpipstat.stp">network/tcpipstat.stp</a> - Display Network Statistics for Individual TCP Sockets<br>
701 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
702 <p>The tcpipstat script collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets.</p><p><i><a href="network/tcpipstat.txt">sample usage in network/tcpipstat.txt</i></font></p>
703 </li><li><a href="network/who_sent_it.stp">network/who_sent_it.stp</a> - Trace threads sending network traffic to given host and/or port<br>
704 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
705 <p>This script traces outgoing network packets using the netfilter probes (not requiring debuginfo), printing the source thread name/id and destination host:port. It may be filtered with the_dport and the_daddr globals, e.g., to watch only for DNS traffic (port 53), and/or only to the localhost (127.0.0.1).</p><p><i><a href="network/who_sent_it.txt">sample usage in network/who_sent_it.txt</i></font></p>
706 </li></ul>
707 <h3><a name="NFS"><a href="#NFS">&para;</a> NFS</a></h3>
708 <ul>
709 <li><a href="network/autofs4.stp">network/autofs4.stp</a> - Watch autofs4 Operations<br>
710 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#NFS">NFS</a> <br>
711 <p>Trace key autofs4 operations such as mounting or unmounting remote filesystems.</p><p><font size="-2"><pre># stap autofs4.stp -T 1</pre></font></p>
712 </li><li><a href="network/nfsd-recent.stp">network/nfsd-recent.stp</a> - Keep track of NFS server statistics<br>
713 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
714 <p>This script tracks all nfsd server operations by client_ip address, and periodically lists those clients that have made recent requests. It&#39;s a way of finding out which nfs clients might be considered still connected.</p><p><font size="-2"><pre># stap nfsd-recent.stp -T 1</pre></font></p>
715 </li><li><a href="network/nfsd-trace.stp">network/nfsd-trace.stp</a> - Trace NFSD requests with file names.<br>
716 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
717 <p>This script traces all nfsd server operations by client_ip address, operation, and complete file name (if possible).</p><p><i><a href="network/nfsd-trace.txt">sample usage in network/nfsd-trace.txt</i></font></p>
718 </li><li><a href="network/nfsd_unlink.stp">network/nfsd_unlink.stp</a> - Find Which Client Is Removing NFS Files on Server<br>
719 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#DISK">DISK</a> <br>
720 <p>The nfsd_unlink.stp script lists the ip address and file name each time time a file is being removed or unlinked by the nfsd. This script is run on the nfs server.</p><p><font size="-2"><pre># stap nfsd_unlink.stp -T 1</pre></font></p>
721 </li><li><a href="network/nfsdtop.stp">network/nfsdtop.stp</a> - Keep track of NFS server statistics<br>
722 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
723 <p>The nfsdtop.stp script gathers and displays NFS lookups,</p><p><font size="-2"><pre># stap nfsdtop.stp -T 1</pre></font></p>
724 </li></ul>
725 <h3><a name="NUMA"><a href="#NUMA">&para;</a> NUMA</a></h3>
726 <ul>
727 <li><a href="memory/numa_faults.stp">memory/numa_faults.stp</a> - Summarize Process Misses across NUMA Nodes<br>
728 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#NUMA">NUMA</a> <br>
729 <p>The numa_faults.stp script tracks the read and write pages faults for each process. When the script exits it prints out the total read and write pages faults for each process. The script also provide a break down of page faults per node for each process. This script is useful for determining whether the program has good locality (page faults limited to a single node) on a NUMA computer.</p><p><i><a href="memory/numa_faults.txt">sample usage in memory/numa_faults.txt</i></font></p>
730 </li></ul>
731 <h3><a name="PACKETS"><a href="#PACKETS">&para;</a> PACKETS</a></h3>
732 <ul>
733 <li><a href="network/netfilter_drop.stp">network/netfilter_drop.stp</a> - System-Wide Network Packet Dropping Tool<br>
734 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#PACKETS">PACKETS</a> <a href="keyword-index.html#GURU">GURU</a> <br>
735 <p>The script drops the specified number of packets of the specified protocol. Valid protocols are TCP, UDP, or ALL. If ALL is specified, all incoming packets are dropped. The number of packets to drop can be specified with a positive integer. A value of 0 indicates that packets should be dropped until the user manually exits.</p><p><font size="-2"><pre># stap -g netfilter_drop.stp TCP 1 -T 2</pre></font></p>
736 </li></ul>
737 <h3><a name="PROCESS"><a href="#PROCESS">&para;</a> PROCESS</a></h3>
738 <ul>
739 <li><a href="general/eventcount.stp">general/eventcount.stp</a> - Interactive Count Specified Events<br>
740 keywords: <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
741 <p>The script periodically prints a count of specified events and their related tid&#39;s over the course of execution. Numerous configuration options exist to control filtering / reporting, some of which can be modified at runtime. See the script source for more information.</p><p><i><a href="general/eventcount.txt">sample usage in general/eventcount.txt</i></font></p>
742 </li><li><a href="memory/glibc-malloc.stp">memory/glibc-malloc.stp</a> - Overview glibc malloc internal operations<br>
743 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
744 <p>This script reports on internal statistics of the glibc malloc implementation, as used by a process restricted by stap -x/-c</p><p><font size="-2"><pre># stap glibc-malloc.stp -c &#39;stap --dump-functions&#39;</pre></font></p>
745 </li><li><a href="memory/last_100_frees.stp">memory/last_100_frees.stp</a> - Log recent free(3) calls.<br>
746 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
747 <p>This script reports on the last few free(3) libc calls done by processes (possibly restricted by stap -x/-c), along with a userspace backtrace at those moments.</p><p><i><a href="memory/last_100_frees.txt">sample usage in memory/last_100_frees.txt</i></font></p>
748 </li><li><a href="network/connect_stat.stp">network/connect_stat.stp</a> - Show Process Ancestry for IP Connections<br>
749 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
750 <p>The connect_stat.stp script prints a task&#39;s entire ancestry (parent process name/uid/gid) whenever it attempts an outgoing socket connection to a given IP address.</p><p><font size="-2"><pre># stap connect_stat.stp 127.0.0.1 -T 1</pre></font></p>
751 </li><li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br>
752 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BPF">BPF</a> <br>
753 <p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p><p><font size="-2"><pre># stap sk_stream_wait_memory.stp -T 1</pre></font></p>
754 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
755 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
756 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
757 </li><li><a href="process/errsnoop.stp">process/errsnoop.stp</a> - Tabulate System Call Errors<br>
758 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
759 <p>Prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).</p><p><font size="-2"><pre># stap errsnoop.stp 1 10 -T 1</pre></font></p>
760 </li><li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br>
761 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
762 <p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes.</p><p><font size="-2"><pre># stap forktracker.stp -T 1</pre></font></p>
763 </li><li><a href="process/ltrace.stp">process/ltrace.stp</a> - uprobes-based ltrace<br>
764 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
765 <p>The ltrace.stp script lists calls that the designated process makes through PLTs (procedure linkage tables), generally into shared libraries.</p><p><font size="-2"><pre># stap ltrace.stp -c ls || echo PR14738</pre></font></p>
766 </li><li><a href="process/noptrace.stp">process/noptrace.stp</a> - Disable ptrace from Hierarchies of Processes<br>
767 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
768 <p>Blocks ptrace(2) attempts from processes identified by stap -c/-x, as also specifiable from /proc/systemtap/stap_XXX/ control files. Processes may be added or removed from the blocked list.</p><p><i><a href="process/noptrace.txt">sample usage in process/noptrace.txt</i></font></p>
769 </li><li><a href="process/pfiles.stp">process/pfiles.stp</a> - Print Process File Descriptors<br>
770 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#FILE">FILE</a> <br>
771 <p>Run pfiles.stp to produce a human-readable summary of all open file descriptors of a given process. Specify the process-id as -x PID for fastest performance.</p><p><font size="-2"><pre># stap -g pfiles.stp -x $$</pre></font></p>
772 </li><li><a href="process/plimit.stp">process/plimit.stp</a> - Print Resource Limits of Process<br>
773 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
774 <p>The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.</p><p><font size="-2"><pre># stap -g plimit.stp $$</pre></font></p>
775 </li><li><a href="process/procmod_watcher.stp">process/procmod_watcher.stp</a> - Monitor process creation/termination and module [un]loading<br>
776 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
777 <p>The procmod_watcher.stp script monitors calls to fork(), exec(), exit(), init_module(), and delete_module(). Event-specific details are also printed out (e.g. for exec(), the file being exec&#39;ed). This script does not require debuginfo.</p><p><font size="-2"><pre># stap procmod_watcher.stp -T 1</pre></font></p>
778 </li><li><a href="process/proctop.stp">process/proctop.stp</a> - Periodically Print Process Information With History<br>
779 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
780 <p>Every 5 seconds, print out a list of 25 processes that took the most system time with information about the processes. Includes information on processes that may have exited while the script was running. The script contains configuration options listed in the script source.</p><p><i><a href="process/proctop.txt">sample usage in process/proctop.txt</i></font></p>
781 </li><li><a href="process/psig.stp">process/psig.stp</a> - Print Process File Descriptors<br>
782 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
783 <p>Run psig.stp to produce a human-readable summary of the signal handling configuration of a given process. Specify the process-id as -x PID for fastest performance.</p><p><font size="-2"><pre># stap -DMAXACTION=10000 -g psig.stp -x $$</pre></font></p>
784 </li><li><a href="process/pstrace_exec.stp">process/pstrace_exec.stp</a> - Print trace of process ancestors for matching exec commands<br>
785 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
786 <p>The pstrace_exec.stp script watches each exec operation. If the exec contains a substring that matches the script&#39;s command-line argument, it prints out that process and all of its ancestors.</p><p><font size="-2"><pre># stap pstrace_exec.stp -T 1 bash</pre></font></p>
787 </li><li><a href="process/pstree.stp">process/pstree.stp</a> - Generates a process diagram in DOT form.<br>
788 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#DIAGRAM">DIAGRAM</a> <br>
789 <p>The pstree.stp script generates a process diagram in DOT form. For instance, it may be useful on a &#39;make&#39; command to see all the processes that are started.</p><p><font size="-2"><pre># stap pstree.stp -T 1</pre></font></p>
790 </li><li><a href="process/sched-latency.stp">process/sched-latency.stp</a> - track wakeup-to-dispatch latency stats<br>
791 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
792 <p>This script periodically reports a histogram of the latency between a task (thread) being woken up and it actually being dispatched to a CPU: the amount of time it&#39;s spent in the runnable queue.</p><p><i><a href="process/sched-latency.txt">sample usage in process/sched-latency.txt</i></font></p>
793 </li><li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States Using Tracepoints<br>
794 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
795 <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID and its children.</p><p><i><a href="process/schedtimes.txt">sample usage in process/schedtimes.txt</i></font></p>
796 </li><li><a href="process/semop-watch.stp">process/semop-watch.stp</a> - Watch semop(2)/semtimedop(2) operations<br>
797 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <br>
798 <p>Prints a timed trace of semop(2)/semtimedop(2) syscalls</p><p><font size="-2"><pre># stap semop-watch.stp -c &#39;sleep 2&#39;</pre></font></p>
799 </li><li><a href="process/spawn_seeker.stp">process/spawn_seeker.stp</a> - Track Creation of Processes by process and execname<br>
800 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
801 <p>The spawn_seeker.stp script every minute (and on exit) prints out the local time and sorted lists of which processes and executables spawned tasks during the previous minute. This can be useful to determine what process is creating a flurry of short-lived processes. When a process exits its count of tasks created is added to its parent&#39;s count to better account for the indirect task creation by children processes. For more detailed examination of task creation consider using forktracker.stp.</p><p><i><a href="process/spawn_seeker.txt">sample usage in process/spawn_seeker.txt</i></font></p>
802 </li><li><a href="process/strace.stp">process/strace.stp</a> - Trace system calls<br>
803 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
804 <p>The script loosely emulates strace, when applied to individual processes or hierarchies (via -c/-x), or the entire system (without -c/-x). A few output configuration parameters may be set with -G.</p><p><i><a href="process/strace.txt">sample usage in process/strace.txt</i></font></p>
805 </li><li><a href="process/thread-business.stp">process/thread-business.stp</a> - monitor syscall history<br>
806 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
807 <p>Prints a periodic tabular report about the counts of syscall activity of all threads on the system, along with a textual recent-syscall-history for each</p><p><i><a href="process/thread-business.txt">sample usage in process/thread-business.txt</i></font></p>
808 </li><li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
809 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
810 <p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in parentheses, the &quot;wait4:&quot; key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is &quot;-1&quot;.</p><p><font size="-2"><pre># stap wait4time.stp -T 1</pre></font></p>
811 </li><li><a href="profiling/syscallerrorsbypid.stp">profiling/syscallerrorsbypid.stp</a> - Provide a per-process syscall error tally on the system<br>
812 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
813 <p>The syscallerrorsbypid.stp script tallies syscall errors for each running process. This information can be useful to whether there are excessive errors for various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallerrorsbypid.stp -T 1</pre></font></p>
814 </li><li><a href="profiling/syscalllatency.stp">profiling/syscalllatency.stp</a> - Provide a per-process accumulation of syscall latency on the system<br>
815 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
816 <p>The syscalllatency.stp script accumulates syscall latency for each running process. This information can be useful to whether excessive time is being spent in particular syscalls on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscalllatency.stp -T 1</pre></font></p>
817 </li><li><a href="profiling/syscallsbypid.stp">profiling/syscallsbypid.stp</a> - Provide a per-process syscall tally on the system<br>
818 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
819 <p>The syscallsbypid.stp script tallies each syscall for each running process. This information can be useful to determine the activity of various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallsbypid.stp -T 1</pre></font></p>
820 </li></ul>
821 <h3><a name="PROFILING"><a href="#PROFILING">&para;</a> PROFILING</a></h3>
822 <ul>
823 <li><a href="general/tcl-funtop.stp">general/tcl-funtop.stp</a> - Profile Tcl calls<br>
824 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
825 <p>The tcl-funtop.stp script displays a top-like view of most frequently used Tcl functions for the each five second interval.</p><p><font size="-2"><pre># stap tcl-funtop.stp -T 5</pre></font></p>
826 </li><li><a href="io/iodevstats.stp">io/iodevstats.stp</a> - List Executables Reading and Writing the Most Data by Device<br>
827 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
828 <p> The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.</p><p><i><a href="io/iodevstats.txt">sample usage in io/iodevstats.txt</i></font></p>
829 </li><li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - IO Statistics for SCSI Devices<br>
830 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
831 <p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine&#39;s various SCSI devices. The script takes one argument which is the number of seconds between reports.</p><p><i><a href="io/iostat-scsi.txt">sample usage in io/iostat-scsi.txt</i></font></p>
832 </li><li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
833 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
834 <p> The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.</p><p><i><a href="io/iostats.txt">sample usage in io/iostats.txt</i></font></p>
835 </li><li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
836 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILE">FILE</a> <br>
837 <p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the &quot;access&quot; keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the &quot;iotime&quot; keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p><p><font size="-2"><pre># stap iotime.stp -T 1</pre></font></p>
838 </li><li><a href="io/nfs_func_users.stp">io/nfs_func_users.stp</a> - Tally the Number of NFS Functions Used by Each Process<br>
839 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
840 <p>The nfs_func_users.stp script counts the uses of NFS functions in the kernel on a per process bases. The output is sorted from the process with the greatest number of NFS functions called to the least. The output contains the executable name, the process number, and the total number of NFS functions called by the process.</p><p><font size="-2"><pre># stap nfs_func_users.stp -T 1</pre></font></p>
841 </li><li><a href="profiling/container_check.stp">profiling/container_check.stp</a> - Monitor capabilities and syscalls used by a process and it children<br>
842 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#CONTAINER">CONTAINER</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
843 <p>The container_check.stp script monitors the use of linux capablities and optionally forbidden syscalls by a process and its children. On exit the script prints out lists showing the capabilies used by each executable, which syscall used specific capabilites for each executable, a list of forbidden syscalls used, and details on any syscalls that failed during monitoring. This script is designed to help diagnose issues caused by restricted capabilies and syscalls when running an application in a container. If the script warns about skipped probes, the number of active kretprobes may need to be increased with &quot;-DKRETACTIVE=100&quot; option on the command line</p><p><font size="-2"><pre># stap container_check.stp -c &quot;ping -c 1 sourceware.org || true&quot;</pre></font></p>
844 </li><li><a href="profiling/errno.stp">profiling/errno.stp</a> - Show Which Processes and System Calls Return Errors Most Frequently<br>
845 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
846 <p>On exit the errno.stp script provides a sorted list showing which combination of PID, system call, and error occur most frequently.</p><p><font size="-2"><pre># stap errno.stp -T 1</pre></font></p>
847 </li><li><a href="profiling/fileline-profile.stp">profiling/fileline-profile.stp</a> - Profile Kernel/User Functions<br>
848 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
849 <p>The fileline-profile.stp script ends by printing out a sorted list of the top twenty kernel and/or user processes providing file:line information, if available, from the samples addresses gathered over the time period the script is run. Use any of --ldd, --all-modules, -d MODULE, -d /PATH/TO/EXEC to add more symbolic info. To include the symbol name in the output, specify guru mode (-g) and add symbolname=&quot;yes&quot; to the stap command.</p><p><font size="-2"><pre># stap fileline-profile.stp -T 6 --all-modules --ldd</pre></font></p>
850 </li><li><a href="profiling/fntimes.stp">profiling/fntimes.stp</a> - Show Functions Taking Longer Than Usual<br>
851 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
852 <p>The fntimes.stp script monitors the execution time history of a given function family (assumed non-recursive). Each time (beyond a warmup interval) is then compared to the historical maximum. If it exceeds a certain threshold (250%), a message is printed.</p><p><i><a href="profiling/fntimes.txt">sample usage in profiling/fntimes.txt</i></font></p>
853 </li><li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Are Called<br>
854 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <br>
855 <p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p><p><font size="-2"><pre># stap -w functioncallcount.stp &quot;*@fs/*.c&quot; -T 1</pre></font></p>
856 </li><li><a href="profiling/ioctl_handler.stp">profiling/ioctl_handler.stp</a> - Monitor which executables use ioctl syscalls and what kernel code is handling the ioctl<br>
857 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
858 <p>The ioctl systemcall is used to manipulate devices setting or special files. The way that ioctl syscalls are handled depend greatly on the device the special file is associated with. Using strace to monitor the open and ioctl syscalls may not give a good indication of what kernel code is actually handling the ioctl operations. The ioctl_handler.stp script is designed to provide more details. On exit the ioctl_handler.stp script provides a count of the ioctl syscalls for each executable run on the system. If there was some special device driver code used to handle to the ioctl, the output will have a tally of the times the function name and module was called for that executable. The &quot;--all-modules&quot; option should be included on the command line so the script can provide function name information.</p><p><font size="-2"><pre># stap ioctl_handler.stp --all-modules -T 1</pre></font></p>
859 </li><li><a href="profiling/latencytap.stp">profiling/latencytap.stp</a> - Show Reasons and Durations for Processes Sleeping<br>
860 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
861 <p>The latencytap.stp script collects data on the intervals processes are deactivated (sleeping). The script categorizes the reasons for the sleeps by analyzing the backtraces and displays a sorted list of the top 20 causes from largest total sum time sleeping to smallest. The output is updated every 30 seconds. The script needs to be compiled with the &#39;--all-modules&#39; option to produce reasons for sleeps caused by modules. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID.</p><p><i><a href="profiling/latencytap.txt">sample usage in profiling/latencytap.txt</i></font></p>
862 </li><li><a href="profiling/linetimes.stp">profiling/linetimes.stp</a> - Show Time Spent on Each Line of a Function<br>
863 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
864 <p>The linetimes.stp script takes two arguments: where to find the function and the function name. linetimes.stp will instrument each line in the function. It will print out the number of times that the function is called, a table with the average and maximum time each line takes, and control flow information when the script exits.</p><p><i><a href="profiling/linetimes.txt">sample usage in profiling/linetimes.txt</i></font></p>
865 </li><li><a href="profiling/perf.stp">profiling/perf.stp</a> - Show performance ratios using perf.counter to access performance counters<br>
866 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
867 <p>On exit the perf.stp script provides a sorted list showing cycles per insn, branches per insn, and cache refs per insn</p><p><font size="-2"><pre># stap -w perf.stp -c &quot;find /usr/bin -name \&quot;l*\&quot; -printf \&quot;%h/%f %s %Cx \
868 %Ck%CM %Y\n\&quot;&quot;</pre></font></p>
869 </li><li><a href="profiling/periodic.stp">profiling/periodic.stp</a> - Show the Period of the Various Timers on the System<br>
870 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
871 <p>The periodic.stp script uses the kernel.trace(&quot;timer_expire_entry&quot;) tracepoint to collect data on period and frequency of the various timers on the system. The script displays a sorted list of the timers observed on the system from most frequent to least frequent. The script needs to be compiled with the &#39;--all-modules&#39; option to produce list the function names. Optionally, this script can be used with a numerical argument to indicate the interval in seconds between printing output.</p><p><font size="-2"><pre># stap periodic.stp --all-modules -T 1</pre></font></p>
872 </li><li><a href="profiling/pf2.stp">profiling/pf2.stp</a> - Profile Kernel Functions<br>
873 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
874 <p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p><p><i><a href="profiling/pf2.txt">sample usage in profiling/pf2.txt</i></font></p>
875 </li><li><a href="profiling/pf3.stp">profiling/pf3.stp</a> - Profile Kernel/User Functions<br>
876 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
877 <p>The pf3.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty kernel and/or user functions with samples. Use any of --ldd, --all-modules, -d MODULE, -d /PATH/TO/EXEC to add more symbolic info.</p><p><i><a href="profiling/pf3.txt">sample usage in profiling/pf3.txt</i></font></p>
878 </li><li><a href="profiling/pf4.stp">profiling/pf4.stp</a> - Profile Kernel/User Backtraces<br>
879 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
880 <p>The pf4.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty kernel and/or user stack backtraces (on a per-cpu basis). Use any of --ldd, --all-modules, -d MODULE, -d /PATH/TO/EXEC to add more symbolic info.</p><p><i><a href="profiling/pf4.txt">sample usage in profiling/pf4.txt</i></font></p>
881 </li><li><a href="profiling/sched_switch.stp">profiling/sched_switch.stp</a> - Display the Task Switches Happening in the Scheduler<br>
882 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <br>
883 <p>The sched_switch.stp script takes two arguments, first argument can be &quot;pid&quot; or &quot;name&quot; to indicate what is being passed as second argument. The script will trace the process based on pid/name and print the scheduler switches happening with the process. If no arguments are passed, it displays all the scheduler switches. This can be used to understand which tasks schedule out the current process being traced, and when it gets scheduled in again.</p><p><font size="-2"><pre># stap sched_switch.stp -T 1</pre></font></p>
884 </li><li><a href="profiling/thread-times.stp">profiling/thread-times.stp</a> - Profile Kernel Functions<br>
885 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
886 <p>The thread-times.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty threads occupying the CPUs, broken down as a percentage of user and kernel time.</p><p><i><a href="profiling/thread-times.txt">sample usage in profiling/thread-times.txt</i></font></p>
887 </li><li><a href="profiling/timeout.stp">profiling/timeout.stp</a> - Show Processes Doing Polling Operations<br>
888 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
889 <p>The timeout.stp script is based on a blog entry (http://udrepper.livejournal.com/19041.html) mentioning a need for a tool to help developers find applications that are polling. The timeout.stp script monitors systemcall used for polling and records the systemcalls that timed out rather than returned because some action occurred. The script updates the screen once a second with the top twenty processes.</p><p><font size="-2"><pre># stap timeout.stp -T 1</pre></font></p>
890 </li><li><a href="profiling/topsys.stp">profiling/topsys.stp</a> - Show Processes Doing Polling Operations<br>
891 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
892 <p> The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent.</p><p><font size="-2"><pre># stap topsys.stp -T 1</pre></font></p>
893 </li><li><a href="profiling/ucalls.stp">profiling/ucalls.stp</a> - Profile method invocations in Java, Perl, Php, Python, Ruby, and Tcl scripts<br>
894 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
895 <p>The ucalls.stp script is modeled after the BCC ucalls script (https://github.com/iovisor/bcc/blob/master/tools/lib/ucalls.py) by Sasha Goldshtein. The ucalls.stp script monitors the process indicated by the -x or -c option. When the scripts exits it prints out information about the number of times that each method is invoked for code written in Java, Perl, Php, Python, Ruby, and Tcl. Include the word &quot;syscalls&quot; on the command line to count syscalls invoked by the process. If you want latency information, include &quot;latency&quot; on the command line. Note that the latency option does not work for recursive functions</p><p><font size="-2"><pre># stap ucalls.stp syscalls latency -c &quot;python -c &#39;print(\&quot;hello world\&quot;)&#39; \
896 || true&quot;</pre></font></p>
897 </li></ul>
898 <h3><a name="PROMETHEUS"><a href="#PROMETHEUS">&para;</a> PROMETHEUS</a></h3>
899 <ul>
900 <li><a href="general/also_ran.stp">general/also_ran.stp</a> - Keep a tally of executables run on the system<br>
901 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <br>
902 <p>The also_ran.stp script tallies each time a executable is started or a shared library is loaded for execution. This information can be useful to determine what software is actually being used on the system. The script makes the information available via procfs in Prometheus readable format.</p><p><font size="-2"><pre># stap also_ran.stp -T 1</pre></font></p>
903 </li><li><a href="general/cpu_throttle.stp">general/cpu_throttle.stp</a> - Monitor Intel processors for throttling due to power or thermal limits<br>
904 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#LIMITS">LIMITS</a> <br>
905 <p>Intel processors have hardware mechanisms that will reduce the effective processors speed to avoid exceeding set thermal or power constraints. The cpu_throttle.stp script monitors when CPU throttling occurs and accumulates the amount of time in milliseconds that each processor is throttled. The script makes the information available via procfs in Prometheus readable format.</p><p><font size="-2"><pre># stap cpu_throttle.stp -T 1</pre></font></p>
906 </li><li><a href="profiling/syscallerrorsbypid.stp">profiling/syscallerrorsbypid.stp</a> - Provide a per-process syscall error tally on the system<br>
907 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
908 <p>The syscallerrorsbypid.stp script tallies syscall errors for each running process. This information can be useful to whether there are excessive errors for various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallerrorsbypid.stp -T 1</pre></font></p>
909 </li><li><a href="profiling/syscalllatency.stp">profiling/syscalllatency.stp</a> - Provide a per-process accumulation of syscall latency on the system<br>
910 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
911 <p>The syscalllatency.stp script accumulates syscall latency for each running process. This information can be useful to whether excessive time is being spent in particular syscalls on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscalllatency.stp -T 1</pre></font></p>
912 </li><li><a href="profiling/syscallsbypid.stp">profiling/syscallsbypid.stp</a> - Provide a per-process syscall tally on the system<br>
913 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
914 <p>The syscallsbypid.stp script tallies each syscall for each running process. This information can be useful to determine the activity of various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallsbypid.stp -T 1</pre></font></p>
915 </li><li><a href="profiling/syscallsrw.stp">profiling/syscallsrw.stp</a> - Provide a tally of read and write syscalls run on the system <br>
916 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#BPF">BPF</a> <br>
917 <p>The syscallsrw.stp script tallies the read and write syscalls. This is a demo script for stapbpf prometheus-exporter scripts.</p></p>
918 </li></ul>
919 <h3><a name="QEMU"><a href="#QEMU">&para;</a> QEMU</a></h3>
920 <ul>
921 <li><a href="virtualization/qemu_count.stp">virtualization/qemu_count.stp</a> - Tally the Number of User-Space QEMU Events<br>
922 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <br>
923 <p>The qemu_count.stp script tallies the number of times each of the user-space qemu probepoints is encountered. When the script exits, it prints a list of the number of times each user-space qemu probepoint is encountered.</p><p><font size="-2"><pre># stap qemu_count.stp -T 1</pre></font></p>
924 </li><li><a href="virtualization/qemu_io.stp">virtualization/qemu_io.stp</a> - Tally the Number of User-Space QEMU IO on Each IO Port<br>
925 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <a href="keyword-index.html#IO">IO</a> <br>
926 <p>The qemu_io.stp script tallies the number of times each of the IO port on the guest virtual machines is touched by a input or output operation. When the script exits, it prints a count of the number of times each IO port read and written.</p><p><font size="-2"><pre># stap qemu_io.stp -T 1</pre></font></p>
927 </li></ul>
928 <h3><a name="REGEX"><a href="#REGEX">&para;</a> REGEX</a></h3>
929 <ul>
930 <li><a href="general/regex.stp">general/regex.stp</a> - Report opened files whose names match a given regex<br>
931 keywords: <a href="keyword-index.html#REGEX">REGEX</a> <br>
932 <p>Uses the regex functionality to detect opened files whose names match a pattern given on the command line. If no command line parameter is given, demonstrate by filtering for files that end with an extension showing them to be an archive.</p><p><font size="-2"><pre># stap regex.stp -T 1</pre></font></p>
933 </li></ul>
934 <h3><a name="RETRANSMISSION"><a href="#RETRANSMISSION">&para;</a> RETRANSMISSION</a></h3>
935 <ul>
936 <li><a href="network/tcp_retransmission.stp">network/tcp_retransmission.stp</a> - print tcp retransmission packet<br>
937 keywords: <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#RETRANSMISSION">RETRANSMISSION</a> <br>
938 <p>The tcp_retransmission.stp prints out a line for each tcp retransmission packet</p><p><font size="-2"><pre># stap tcp_retransmission.stp -T 1</pre></font></p>
939 </li></ul>
940 <h3><a name="SCHEDULER"><a href="#SCHEDULER">&para;</a> SCHEDULER</a></h3>
941 <ul>
942 <li><a href="process/chng_cpu.stp">process/chng_cpu.stp</a> - Monitor Changes in Processor Executing a Task<br>
943 keywords: <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
944 <p>The chng_cpu.stp script takes an argument which is the executable name of the task it should monitor. Each time a task with that executable name is found running on a different processor, the script prints out the thread id (tid), the executable name, the processor now running the task, the thread state, and a backtrace showing the kernel functions that triggered the running of the task on the processor.</p><p><font size="-2"><pre># stap chng_cpu.stp -T 1 bash</pre></font></p>
945 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
946 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
947 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
948 </li><li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br>
949 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
950 <p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes.</p><p><font size="-2"><pre># stap forktracker.stp -T 1</pre></font></p>
951 </li><li><a href="process/migrate.stp">process/migrate.stp</a> - Track the Migration of Specific Executables<br>
952 keywords: <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
953 <p>The migrate.stp script takes an argument which is the executable name of the task it should monitor. Each time a task with that executable name migrates between processors an entry is printed with the process id (pid), the executable name, the processor off loading the task, and the process taking the task. Note that the task may or may not be executing at the time of the migration.</p><p><font size="-2"><pre># stap migrate.stp -T 1 bash</pre></font></p>
954 </li><li><a href="process/proctop.stp">process/proctop.stp</a> - Periodically Print Process Information With History<br>
955 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
956 <p>Every 5 seconds, print out a list of 25 processes that took the most system time with information about the processes. Includes information on processes that may have exited while the script was running. The script contains configuration options listed in the script source.</p><p><i><a href="process/proctop.txt">sample usage in process/proctop.txt</i></font></p>
957 </li><li><a href="process/sched-latency.stp">process/sched-latency.stp</a> - track wakeup-to-dispatch latency stats<br>
958 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
959 <p>This script periodically reports a histogram of the latency between a task (thread) being woken up and it actually being dispatched to a CPU: the amount of time it&#39;s spent in the runnable queue.</p><p><i><a href="process/sched-latency.txt">sample usage in process/sched-latency.txt</i></font></p>
960 </li><li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States Using Tracepoints<br>
961 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
962 <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID and its children.</p><p><i><a href="process/schedtimes.txt">sample usage in process/schedtimes.txt</i></font></p>
963 </li><li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generate Backtraces of Threads Waiting for IO Operations<br>
964 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
965 <p>The script monitors the time that threads spend in waiting for IO operations (in &quot;D&quot; state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.</p><p><font size="-2"><pre># stap sleepingBeauties.stp -T 1</pre></font></p>
966 </li><li><a href="process/spawn_seeker.stp">process/spawn_seeker.stp</a> - Track Creation of Processes by process and execname<br>
967 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
968 <p>The spawn_seeker.stp script every minute (and on exit) prints out the local time and sorted lists of which processes and executables spawned tasks during the previous minute. This can be useful to determine what process is creating a flurry of short-lived processes. When a process exits its count of tasks created is added to its parent&#39;s count to better account for the indirect task creation by children processes. For more detailed examination of task creation consider using forktracker.stp.</p><p><i><a href="process/spawn_seeker.txt">sample usage in process/spawn_seeker.txt</i></font></p>
969 </li></ul>
970 <h3><a name="SCSI"><a href="#SCSI">&para;</a> SCSI</a></h3>
971 <ul>
972 <li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - IO Statistics for SCSI Devices<br>
973 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
974 <p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine&#39;s various SCSI devices. The script takes one argument which is the number of seconds between reports.</p><p><i><a href="io/iostat-scsi.txt">sample usage in io/iostat-scsi.txt</i></font></p>
975 </li></ul>
976 <h3><a name="SECURITY"><a href="#SECURITY">&para;</a> SECURITY</a></h3>
977 <ul>
978 <li><a href="process/auditbt.stp">process/auditbt.stp</a> - Generate backtraces for kernel audit events<br>
979 keywords: <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
980 <p>Attaches to the kernel audit-log paths (also used by libaudit), and log every record being sent, along with a user-space backtrace of the process that caused it.</p><p><font size="-2"><pre># stap auditbt.stp -d /usr/bin/sudo --ldd -c &quot;sudo true&quot;</pre></font></p>
981 </li><li><a href="process/noptrace.stp">process/noptrace.stp</a> - Disable ptrace from Hierarchies of Processes<br>
982 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
983 <p>Blocks ptrace(2) attempts from processes identified by stap -c/-x, as also specifiable from /proc/systemtap/stap_XXX/ control files. Processes may be added or removed from the blocked list.</p><p><i><a href="process/noptrace.txt">sample usage in process/noptrace.txt</i></font></p>
984 </li><li><a href="security-band-aids/cve-2008-0600.stp">security-band-aids/cve-2008-0600.stp</a> - cve-2008-0600 security band-aid<br>
985 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
986 <p>historical emergency security band-aid, for reference/education only</p><p><i><a href="security-band-aids/cve-2008-0600.txt">sample usage in security-band-aids/cve-2008-0600.txt</i></font></p>
987 </li><li><a href="security-band-aids/cve-2011-4127.stp">security-band-aids/cve-2011-4127.stp</a> - cve-2011-4127 security band-aid<br>
988 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
989 <p>historical emergency security band-aid, for reference/education only</p></p>
990 </li><li><a href="security-band-aids/cve-2012-0056.stp">security-band-aids/cve-2012-0056.stp</a> - cve-2012-0056 security band-aid<br>
991 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
992 <p>historical emergency security band-aid, for reference/education only</p></p>
993 </li><li><a href="security-band-aids/cve-2013-2094.stp">security-band-aids/cve-2013-2094.stp</a> - cve-2013-2094 security band-aid<br>
994 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
995 <p>historical emergency security band-aid, for reference/education only</p></p>
996 </li><li><a href="security-band-aids/cve-2014-7169.stp">security-band-aids/cve-2014-7169.stp</a> - cve-2014-7169 security band-aid<br>
997 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
998 <p>historical emergency security band-aid, for reference/education only</p></p>
999 </li><li><a href="security-band-aids/cve-2015-0235.stp">security-band-aids/cve-2015-0235.stp</a> - cve-2015-0235 security band-aid<br>
1000 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1001 <p>historical emergency security band-aid, for reference/education only</p></p>
1002 </li><li><a href="security-band-aids/cve-2015-3456.stp">security-band-aids/cve-2015-3456.stp</a> - cve-2015-3456 security band-aid<br>
1003 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1004 <p>historical emergency security band-aid, for reference/education only</p></p>
1005 </li><li><a href="security-band-aids/cve-2015-7547.stp">security-band-aids/cve-2015-7547.stp</a> - cve-2015-7547 security band-aid<br>
1006 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1007 <p>historical emergency security band-aid, for reference/education only</p></p>
1008 </li><li><a href="security-band-aids/cve-2016-0728.stp">security-band-aids/cve-2016-0728.stp</a> - cve-2016-0728 security band-aid<br>
1009 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1010 <p>historical emergency security band-aid, for reference/education only</p></p>
1011 </li><li><a href="security-band-aids/cve-2016-5195.stp">security-band-aids/cve-2016-5195.stp</a> - cve-2016-5195 security band-aid<br>
1012 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1013 <p>historical emergency security band-aid, for reference/education only</p></p>
1014 </li><li><a href="security-band-aids/cve-2017-6074.stp">security-band-aids/cve-2017-6074.stp</a> - cve-2017-6074 security band-aid<br>
1015 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1016 <p>historical emergency security band-aid, for reference/education only</p></p>
1017 </li><li><a href="security-band-aids/cve-2018-1000001.stp">security-band-aids/cve-2018-1000001.stp</a> - cve-2018-1000001 security band-aid<br>
1018 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1019 <p>historical emergency security band-aid, for reference/education only</p></p>
1020 </li><li><a href="security-band-aids/cve-2018-14634.stp">security-band-aids/cve-2018-14634.stp</a> - cve-2018-14634 security band-aid<br>
1021 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1022 <p>historical emergency security band-aid, for reference/education only</p></p>
1023 </li><li><a href="security-band-aids/cve-2018-6485.stp">security-band-aids/cve-2018-6485.stp</a> - cve-2018-6485 security band-aid<br>
1024 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1025 <p>historical emergency security band-aid, for reference/education only</p></p>
1026 </li><li><a href="security-band-aids/cve-2021-4034.stp">security-band-aids/cve-2021-4034.stp</a> - cve-2021-4034 security band-aid<br>
1027 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1028 <p>historical emergency security band-aid, for reference/education only</p></p>
1029 </li><li><a href="security-band-aids/cve-2021-4155.stp">security-band-aids/cve-2021-4155.stp</a> - cve-2021-4155 security band-aid<br>
1030 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1031 <p>historical emergency security band-aid, for reference/education only</p></p>
1032 </li><li><a href="security-band-aids/cve-2023-4911.stp">security-band-aids/cve-2023-4911.stp</a> - cve-2023-4911 security band-aid<br>
1033 keywords: <a href="keyword-index.html#SECURITY">SECURITY</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1034 <p>historical emergency security band-aid, for reference/education only</p></p>
1035 </li></ul>
1036 <h3><a name="SIGNALS"><a href="#SIGNALS">&para;</a> SIGNALS</a></h3>
1037 <ul>
1038 <li><a href="process/psig.stp">process/psig.stp</a> - Print Process File Descriptors<br>
1039 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
1040 <p>Run psig.stp to produce a human-readable summary of the signal handling configuration of a given process. Specify the process-id as -x PID for fastest performance.</p><p><font size="-2"><pre># stap -DMAXACTION=10000 -g psig.stp -x $$</pre></font></p>
1041 </li><li><a href="process/sig_by_pid.stp">process/sig_by_pid.stp</a> - Signal Counts by Process ID<br>
1042 keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
1043 <p>Print signal counts by process ID in descending order.</p><p><i><a href="process/sig_by_pid.txt">sample usage in process/sig_by_pid.txt</i></font></p>
1044 </li><li><a href="process/sig_by_proc.stp">process/sig_by_proc.stp</a> - Signal Counts by Process Name<br>
1045 keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
1046 <p>Print signal counts by process name in descending order.</p><p><i><a href="process/sig_by_proc.txt">sample usage in process/sig_by_proc.txt</i></font></p>
1047 </li><li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
1048 keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
1049 <p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name and user ID that sents the signal.</p><p><font size="-2"><pre># stap sigkill.stp -T 1</pre></font></p>
1050 </li><li><a href="process/sigmon.stp">process/sigmon.stp</a> - Track a Particular Signal to a Specific Process<br>
1051 keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
1052 <p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p><p><font size="-2"><pre># stap sigmon.stp -T 1 SIGKILL</pre></font></p>
1053 </li></ul>
1054 <h3><a name="SIMPLE"><a href="#SIMPLE">&para;</a> SIMPLE</a></h3>
1055 <ul>
1056 <li><a href="general/callgraph.stp">general/callgraph.stp</a> - Callgraph Tracing<br>
1057 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
1058 <p>Print a timed per-thread microsecond-timed nested callgraph. The first parameter names the function probe points to trace.</p><p><i><a href="general/callgraph.txt">sample usage in general/callgraph.txt</i></font></p>
1059 </li><li><a href="general/floatingpoint.stp">general/floatingpoint.stp</a> - SystemTap "Floating Point" Program<br>
1060 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#FLOATINGPOINT">FLOATINGPOINT</a> <br>
1061 <p>A basic &quot;Floating Point&quot; program implemented in SystemTap script. It extracts floating point from benchmark-sdt section in main.cxx and takes one pseudo floating point, printing out results of various simple floating point operations.</p><p><i><a href="general/floatingpoint.txt">sample usage in general/floatingpoint.txt</i></font></p>
1062 </li><li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
1063 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1064 <p>A basic &quot;Hello World&quot; program implemented in SystemTap script. It prints out &quot;hello world&quot; message and then immediately exits.</p><p><font size="-2"><pre># stap helloworld.stp</pre></font></p>
1065 </li><li><a href="general/key.stp">general/key.stp</a> - make keyboard noises<br>
1066 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1067 <p>For fans of Leroy Anderson and Typewriters only, this script arranges to play a click or a zing for various keystrokes.</p><p><font size="-2"><pre># stap key.stp -c &#39;sleep 5&#39;</pre></font></p>
1068 </li><li><a href="general/keyhack.stp">general/keyhack.stp</a> - Hack the keyboard<br>
1069 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1070 <p>This script makes it appear that one&#39;s keyboard is broken, by changing keycodes at the kernel device driver level. Annoy your friends!</p><p><font size="-2"><pre># stap -g keyhack.stp -c &#39;sleep 5&#39;</pre></font></p>
1071 </li><li><a href="general/pyexample.stp">general/pyexample.stp</a> - SystemTap python 2 support tapset<br>
1072 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1073 <p>A python support tapset that displays backtraces and variable values</p><p><font size="-2"><pre># PYTHONPATH=$PYEXECDIR stap -g --suppress-time-limits -c \
1074 &#39;/usr/bin/python3 -m HelperSDT pyexample.py 35&#39; pyexample.stp python2</pre></font></p>
1075 </li><li><a href="general/pyexample.stp">general/pyexample.stp</a> - SystemTap python 3 support tapset<br>
1076 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1077 <p>A python support tapset that displays backtraces and variable values</p><p><font size="-2"><pre># PYTHONPATH=$PY3EXECDIR stap -g --suppress-time-limits -c \
1078 &#39;/usr/bin/python3 -m HelperSDT pyexample.py 35&#39; pyexample.stp python3</pre></font></p>
1079 </li><li><a href="io/eatmydata.stp">io/eatmydata.stp</a> - disable fsync<br>
1080 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#GURU">GURU</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1081 <p>Suppresses fsync() syscalls from processes identified by stap -c/-x by turning them into presumed-faster fsync() on some dummy or other file descriptor</p><p><i><a href="io/eatmydata.txt">sample usage in io/eatmydata.txt</i></font></p>
1082 </li><li><a href="io/mbrwatch.stp">io/mbrwatch.stp</a> - Monitor Read/Write of the Boot Sector Area of Block Devices<br>
1083 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#DISK">DISK</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1084 <p> The mbrwatch.stp script reports any attempted reads/writes of the first few sectors of a raw block device.</p><p><i><a href="io/mbrwatch.txt">sample usage in io/mbrwatch.txt</i></font></p>
1085 </li><li><a href="io/slowvfs.stp">io/slowvfs.stp</a> - Trace slow vfs opens.<br>
1086 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1087 <p>This script prints a line for every kernel vfs_open operation that takes longer than a configurable number of microseconds. Highly contended or remote filesystems are likelier to hit this.</p><p><font size="-2"><pre># stap slowvfs.stp -G sloth=10 -c &#39;find /proc &gt;/dev/null || true&#39;</pre></font></p>
1088 </li><li><a href="network/who_sent_it.stp">network/who_sent_it.stp</a> - Trace threads sending network traffic to given host and/or port<br>
1089 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1090 <p>This script traces outgoing network packets using the netfilter probes (not requiring debuginfo), printing the source thread name/id and destination host:port. It may be filtered with the_dport and the_daddr globals, e.g., to watch only for DNS traffic (port 53), and/or only to the localhost (127.0.0.1).</p><p><i><a href="network/who_sent_it.txt">sample usage in network/who_sent_it.txt</i></font></p>
1091 </li></ul>
1092 <h3><a name="SOCKET"><a href="#SOCKET">&para;</a> SOCKET</a></h3>
1093 <ul>
1094 <li><a href="general/socket-events.stp">general/socket-events.stp</a> - Trace Socket Activity of a Process<br>
1095 keywords: <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1096 <p>Prints the life cycle of all sockets associated with a process. This includes bytes and timing. The timing information that is tracked includes event completion relative to the start of said event and the end of the previous event. Currently tracks read, write, recv, send, connect and close.</p><p><font size="-2"><pre># stap socket-events.stp</pre></font></p>
1097 </li><li><a href="lwtools/accept2close-nd.stp">lwtools/accept2close-nd.stp</a> - Show socket lifespan, from accept() to close() (non-debuginfo)<br>
1098 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1099 <p>This traces socket duration from the accept() syscall to close(), and provides details on the lifespan of these passive connections, showing the distribution as a histogram.</p><p><i><a href="lwtools/accept2close-nd.txt">sample usage in lwtools/accept2close-nd.txt</i></font></p>
1100 </li><li><a href="network/connect_stat.stp">network/connect_stat.stp</a> - Show Process Ancestry for IP Connections<br>
1101 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
1102 <p>The connect_stat.stp script prints a task&#39;s entire ancestry (parent process name/uid/gid) whenever it attempts an outgoing socket connection to a given IP address.</p><p><font size="-2"><pre># stap connect_stat.stp 127.0.0.1 -T 1</pre></font></p>
1103 </li><li><a href="network/dropwatch.stp">network/dropwatch.stp</a> - Watch Where Socket Buffers Are Freed in the Kernel<br>
1104 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1105 <p>Every five seconds the dropwatch.stp script lists the number of socket buffers freed at locations in the kernel.</p><p><font size="-2"><pre># stap -d kernel dropwatch.stp -T 1</pre></font></p>
1106 </li><li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions Called in Network Socket Code<br>
1107 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1108 <p>The script instruments each of the functions in the Linux kernel&#39;s net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The &quot;-&gt;&quot; and &quot;&lt;-&quot; indicates function entry and function exit, respectively. The last element of the line is the function name.</p><p><font size="-2"><pre># stap socket-trace.stp -T 1</pre></font></p>
1109 </li><li><a href="network/socktop">network/socktop</a> - Periodically Summarize Socket Activity on the System<br>
1110 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1111 <p>The socktop script periodically prints out a list of the processes with the highest socket activity. Command line options for the script allow filtering to focus on particular types of sockets. The &quot;-h&quot; option lists socktop script&#39;s filtering options.</p><p><i><a href="network/socktop">sample usage in network/socktop</i></font></p>
1112 </li><li><a href="network/tcp_connections.stp">network/tcp_connections.stp</a> - Track Creation of Incoming TCP Connections<br>
1113 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1114 <p>The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.</p><p><font size="-2"><pre># stap tcp_connections.stp -T 1</pre></font></p>
1115 </li><li><a href="network/tcp_init_cwnd.stp">network/tcp_init_cwnd.stp</a> - Increase Initial TCP Congestion Window to 10<br>
1116 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1117 <p>Run the tcp_init_cwnd.stp script in the background to override a kernel&#39;s default tcp cwnd value to 10, which has been found to improve latency for web server type workloads. The script prints a count of cwnd value changes when it is stopped.</p><p><font size="-2"><pre># stap -g tcp_init_cwnd.stp -T 1</pre></font></p>
1118 </li></ul>
1119 <h3><a name="SPECULATION"><a href="#SPECULATION">&para;</a> SPECULATION</a></h3>
1120 <ul>
1121 <li><a href="general/whythefail.stp">general/whythefail.stp</a> - Why did the function fail?<br>
1122 keywords: <a href="keyword-index.html#SPECULATION">SPECULATION</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
1123 <p>The whythefail.stp script prints a statement-execution trace for a given function, but only for those runs of the function that ended up with a (configurable) post-return condition.</p><p><i><a href="general/whythefail.txt">sample usage in general/whythefail.txt</i></font></p>
1124 </li></ul>
1125 <h3><a name="STAPGAMES"><a href="#STAPGAMES">&para;</a> STAPGAMES</a></h3>
1126 <ul>
1127 <li><a href="stapgames/2048.stp">stapgames/2048.stp</a> - 2048<br>
1128 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
1129 <p>The modern classic 2048 sliding-tiles game, using local keyboard and ansi animation.</p><p><font size="-2"><pre># stap -p4 2048.stp</pre></font></p>
1130 </li><li><a href="stapgames/block.stp">stapgames/block.stp</a> - block breaker game<br>
1131 keywords: <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
1132 <p>A block game where you progressively break the ceiling blocks until clearing the level</p><p><font size="-2"><pre># stap -p4 -Itapset/ block.stp</pre></font></p>
1133 </li><li><a href="stapgames/eater.stp">stapgames/eater.stp</a> - eater game<br>
1134 keywords: <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
1135 <p>walk through a maze, eat stuff</p><p><font size="-2"><pre># stap -p4 -Itapset/ eater.stp</pre></font></p>
1136 </li><li><a href="stapgames/lifegame.stp">stapgames/lifegame.stp</a> - life game<br>
1137 keywords: <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
1138 <p>watch as your creation morphes into different forms</p><p><font size="-2"><pre># stap -p4 -Itapset/ lifegame.stp</pre></font></p>
1139 </li><li><a href="stapgames/pingpong.stp">stapgames/pingpong.stp</a> - pingpong game<br>
1140 keywords: <a href="keyword-index.html#STAPGAMES">STAPGAMES</a> <br>
1141 <p>A simulated ball bounces around the terminal reflecting at the edges</p><p><font size="-2"><pre># stap -p4 -Itapset/ pingpong.stp</pre></font></p>
1142 </li></ul>
1143 <h3><a name="STATISTICS"><a href="#STATISTICS">&para;</a> STATISTICS</a></h3>
1144 <ul>
1145 <li><a href="general/alias_suffixes.stp">general/alias_suffixes.stp</a> - Count I/O Syscalls using Alias Suffixes<br>
1146 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1147 <p>alias_suffixes.stp is a demonstration of how alias suffixes in the systemtap language might be used. The script tracks the wall clock time for each invocation of the system calls open, close, read, and write. When the script exists it prints out the minimum, average, and maximum times in microseconds for each system call, followed by a count of times that each syscall was invoked and a histogram showing the distributions of times.</p><p><font size="-2"><pre># stap alias_suffixes.stp -T 1</pre></font></p>
1148 </li><li><a href="general/eventcount.stp">general/eventcount.stp</a> - Interactive Count Specified Events<br>
1149 keywords: <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
1150 <p>The script periodically prints a count of specified events and their related tid&#39;s over the course of execution. Numerous configuration options exist to control filtering / reporting, some of which can be modified at runtime. See the script source for more information.</p><p><i><a href="general/eventcount.txt">sample usage in general/eventcount.txt</i></font></p>
1151 </li><li><a href="general/func_time_stats.stp">general/func_time_stats.stp</a> - Function Time Statistics<br>
1152 keywords: <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1153 <p>The func_time_stats.stp script tracks the wall clock time for each invocation of the function probe listed as the first command line argument. When the script exits it prints out the minimum, average, and maximum times in microseconds followed by a count of times that the function was called and a histogram showing the distributions of times.</p><p><i><a href="general/func_time_stats.txt">sample usage in general/func_time_stats.txt</i></font></p>
1154 </li><li><a href="general/sizeof.stp">general/sizeof.stp</a> - Print the Size of a C Type<br>
1155 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1156 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name.</p><p><i><a href="general/sizeof.txt">sample usage in general/sizeof.txt</i></font></p>
1157 </li><li><a href="general/sizeof_interactive.stp">general/sizeof_interactive.stp</a> - Interactive Print the Size of a C Type<br>
1158 keywords: <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <br>
1159 <p>This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name. Types and corresponding locations are provided to the script at runtime via keyboard input. The format of the input is identical to that of sizeof.stp (see script source for more information). Types and locations can be repeatedly given until the process is terminated. </p><p><i><a href="general/sizeof_interactive.txt">sample usage in general/sizeof_interactive.txt</i></font></p>
1160 </li><li><a href="memory/vm.tracepoints.stp">memory/vm.tracepoints.stp</a> - Collect Slab Allocation Statistics<br>
1161 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1162 <p>The script will probe all memory slab/slub allocations and collects information about the size of the object (bytes requested) and user-space process in execution. When run over a period of time, it helps to correlate kernel-space memory consumption owing to user-space processes.</p><p><i><a href="memory/vm.tracepoints.txt">sample usage in memory/vm.tracepoints.txt</i></font></p>
1163 </li><li><a href="network/net_xmit_json.stp">network/net_xmit_json.stp</a> - Tracks time between packet queue and transmit.<br>
1164 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#JSON">JSON</a> <br>
1165 <p>This script tracks time between packet queue and transmit. The information is provided to userspace via procfs in JSON format.</p><p><font size="-2"><pre># stap net_xmit_json.stp -T 1</pre></font></p>
1166 </li><li><a href="network/nfsd-recent.stp">network/nfsd-recent.stp</a> - Keep track of NFS server statistics<br>
1167 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1168 <p>This script tracks all nfsd server operations by client_ip address, and periodically lists those clients that have made recent requests. It&#39;s a way of finding out which nfs clients might be considered still connected.</p><p><font size="-2"><pre># stap nfsd-recent.stp -T 1</pre></font></p>
1169 </li><li><a href="network/nfsdtop.stp">network/nfsdtop.stp</a> - Keep track of NFS server statistics<br>
1170 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1171 <p>The nfsdtop.stp script gathers and displays NFS lookups,</p><p><font size="-2"><pre># stap nfsdtop.stp -T 1</pre></font></p>
1172 </li><li><a href="network/tcpipstat.stp">network/tcpipstat.stp</a> - Display Network Statistics for Individual TCP Sockets<br>
1173 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <br>
1174 <p>The tcpipstat script collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets.</p><p><i><a href="network/tcpipstat.txt">sample usage in network/tcpipstat.txt</i></font></p>
1175 </li></ul>
1176 <h3><a name="SWAP"><a href="#SWAP">&para;</a> SWAP</a></h3>
1177 <ul>
1178 <li><a href="memory/swapmonitor.stp">memory/swapmonitor.stp</a> - Summarize swap operations<br>
1179 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#SWAP">SWAP</a> <br>
1180 <p>The swapmonitor.stp script is an example to monitor &quot;swap in/out&quot; in RHEL. This stap monitor the call of &quot;swap_readpage&quot; and &quot;swap_writepage&quot;, and then printf the timeframe, func, execname, pid and the count with 10 seconds interval.</p><p><font size="-2"><pre># stap swapmonitor.stp -T 5</pre></font></p>
1181 </li></ul>
1182 <h3><a name="SYSCALL"><a href="#SYSCALL">&para;</a> SYSCALL</a></h3>
1183 <ul>
1184 <li><a href="general/socket-events.stp">general/socket-events.stp</a> - Trace Socket Activity of a Process<br>
1185 keywords: <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1186 <p>Prints the life cycle of all sockets associated with a process. This includes bytes and timing. The timing information that is tracked includes event completion relative to the start of said event and the end of the previous event. Currently tracks read, write, recv, send, connect and close.</p><p><font size="-2"><pre># stap socket-events.stp</pre></font></p>
1187 </li><li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
1188 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#FILE">FILE</a> <br>
1189 <p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the &quot;access&quot; keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the &quot;iotime&quot; keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p><p><font size="-2"><pre># stap iotime.stp -T 1</pre></font></p>
1190 </li><li><a href="process/errsnoop.stp">process/errsnoop.stp</a> - Tabulate System Call Errors<br>
1191 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1192 <p>Prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).</p><p><font size="-2"><pre># stap errsnoop.stp 1 10 -T 1</pre></font></p>
1193 </li><li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
1194 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
1195 <p>The script watches the futex syscall on the system. On exit the futex&#39;s address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><i><a href="process/futexes.txt">sample usage in process/futexes.txt</i></font></p>
1196 </li><li><a href="process/futexes2.stp">process/futexes2.stp</a> - System-Wide Shared Futex Contention<br>
1197 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br>
1198 <p>The script watches just shared futex syscalls on the system. On exit the futex&#39;s key, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p><p><font size="-2"><pre># stap futexes2.stp -T 1</pre></font></p>
1199 </li><li><a href="process/procmod_watcher.stp">process/procmod_watcher.stp</a> - Monitor process creation/termination and module [un]loading<br>
1200 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1201 <p>The procmod_watcher.stp script monitors calls to fork(), exec(), exit(), init_module(), and delete_module(). Event-specific details are also printed out (e.g. for exec(), the file being exec&#39;ed). This script does not require debuginfo.</p><p><font size="-2"><pre># stap procmod_watcher.stp -T 1</pre></font></p>
1202 </li><li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in Nanosleep Syscalls<br>
1203 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#NANOSLEEP">NANOSLEEP</a> <br>
1204 <p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in parentheses, the &quot;nanosleep:&quot; key, and the duration of the sleep in microseconds.</p><p><font size="-2"><pre># stap sleeptime.stp -T 1</pre></font></p>
1205 </li><li><a href="process/strace.stp">process/strace.stp</a> - Trace system calls<br>
1206 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1207 <p>The script loosely emulates strace, when applied to individual processes or hierarchies (via -c/-x), or the entire system (without -c/-x). A few output configuration parameters may be set with -G.</p><p><i><a href="process/strace.txt">sample usage in process/strace.txt</i></font></p>
1208 </li><li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
1209 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1210 <p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each PID ordered from greatest to least number of syscalls.</p><p><i><a href="process/syscalls_by_pid.txt">sample usage in process/syscalls_by_pid.txt</i></font></p>
1211 </li><li><a href="process/syscalls_by_proc.stp">process/syscalls_by_proc.stp</a> - System-Wide Count of Syscalls by Executable<br>
1212 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1213 <p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each executable ordered from greatest to least number of syscalls.</p><p><i><a href="process/syscalls_by_proc.txt">sample usage in process/syscalls_by_proc.txt</i></font></p>
1214 </li><li><a href="process/syscalltimes">process/syscalltimes</a> - System-Wide Syscall Statistics with Filtering<br>
1215 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1216 <p>Combination shell/systemtap script to measure system call counts and times. Can be filtered by process IDs, process names and users.</p><p><i><a href="process/syscalltimes">sample usage in process/syscalltimes</i></font></p>
1217 </li><li><a href="process/thread-business.stp">process/thread-business.stp</a> - monitor syscall history<br>
1218 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1219 <p>Prints a periodic tabular report about the counts of syscall activity of all threads on the system, along with a textual recent-syscall-history for each</p><p><i><a href="process/thread-business.txt">sample usage in process/thread-business.txt</i></font></p>
1220 </li><li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
1221 keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
1222 <p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in parentheses, the &quot;wait4:&quot; key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is &quot;-1&quot;.</p><p><font size="-2"><pre># stap wait4time.stp -T 1</pre></font></p>
1223 </li><li><a href="profiling/container_check.stp">profiling/container_check.stp</a> - Monitor capabilities and syscalls used by a process and it children<br>
1224 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#CONTAINER">CONTAINER</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1225 <p>The container_check.stp script monitors the use of linux capablities and optionally forbidden syscalls by a process and its children. On exit the script prints out lists showing the capabilies used by each executable, which syscall used specific capabilites for each executable, a list of forbidden syscalls used, and details on any syscalls that failed during monitoring. This script is designed to help diagnose issues caused by restricted capabilies and syscalls when running an application in a container. If the script warns about skipped probes, the number of active kretprobes may need to be increased with &quot;-DKRETACTIVE=100&quot; option on the command line</p><p><font size="-2"><pre># stap container_check.stp -c &quot;ping -c 1 sourceware.org || true&quot;</pre></font></p>
1226 </li><li><a href="profiling/syscallerrorsbypid.stp">profiling/syscallerrorsbypid.stp</a> - Provide a per-process syscall error tally on the system<br>
1227 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1228 <p>The syscallerrorsbypid.stp script tallies syscall errors for each running process. This information can be useful to whether there are excessive errors for various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallerrorsbypid.stp -T 1</pre></font></p>
1229 </li><li><a href="profiling/syscalllatency.stp">profiling/syscalllatency.stp</a> - Provide a per-process accumulation of syscall latency on the system<br>
1230 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1231 <p>The syscalllatency.stp script accumulates syscall latency for each running process. This information can be useful to whether excessive time is being spent in particular syscalls on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscalllatency.stp -T 1</pre></font></p>
1232 </li><li><a href="profiling/syscallsbypid.stp">profiling/syscallsbypid.stp</a> - Provide a per-process syscall tally on the system<br>
1233 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1234 <p>The syscallsbypid.stp script tallies each syscall for each running process. This information can be useful to determine the activity of various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallsbypid.stp -T 1</pre></font></p>
1235 </li><li><a href="profiling/syscallsrw.stp">profiling/syscallsrw.stp</a> - Provide a tally of read and write syscalls run on the system <br>
1236 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1237 <p>The syscallsrw.stp script tallies the read and write syscalls. This is a demo script for stapbpf prometheus-exporter scripts.</p></p>
1238 </li><li><a href="profiling/ucalls.stp">profiling/ucalls.stp</a> - Profile method invocations in Java, Perl, Php, Python, Ruby, and Tcl scripts<br>
1239 keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br>
1240 <p>The ucalls.stp script is modeled after the BCC ucalls script (https://github.com/iovisor/bcc/blob/master/tools/lib/ucalls.py) by Sasha Goldshtein. The ucalls.stp script monitors the process indicated by the -x or -c option. When the scripts exits it prints out information about the number of times that each method is invoked for code written in Java, Perl, Php, Python, Ruby, and Tcl. Include the word &quot;syscalls&quot; on the command line to count syscalls invoked by the process. If you want latency information, include &quot;latency&quot; on the command line. Note that the latency option does not work for recursive functions</p><p><font size="-2"><pre># stap ucalls.stp syscalls latency -c &quot;python -c &#39;print(\&quot;hello world\&quot;)&#39; \
1241 || true&quot;</pre></font></p>
1242 </li></ul>
1243 <h3><a name="TCP"><a href="#TCP">&para;</a> TCP</a></h3>
1244 <ul>
1245 <li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br>
1246 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1247 <p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p><p><font size="-2"><pre># stap sk_stream_wait_memory.stp -T 1</pre></font></p>
1248 </li><li><a href="network/tcp_connections.stp">network/tcp_connections.stp</a> - Track Creation of Incoming TCP Connections<br>
1249 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1250 <p>The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.</p><p><font size="-2"><pre># stap tcp_connections.stp -T 1</pre></font></p>
1251 </li><li><a href="network/tcp_init_cwnd.stp">network/tcp_init_cwnd.stp</a> - Increase Initial TCP Congestion Window to 10<br>
1252 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1253 <p>Run the tcp_init_cwnd.stp script in the background to override a kernel&#39;s default tcp cwnd value to 10, which has been found to improve latency for web server type workloads. The script prints a count of cwnd value changes when it is stopped.</p><p><font size="-2"><pre># stap -g tcp_init_cwnd.stp -T 1</pre></font></p>
1254 </li><li><a href="network/tcp_retransmission.stp">network/tcp_retransmission.stp</a> - print tcp retransmission packet<br>
1255 keywords: <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#RETRANSMISSION">RETRANSMISSION</a> <br>
1256 <p>The tcp_retransmission.stp prints out a line for each tcp retransmission packet</p><p><font size="-2"><pre># stap tcp_retransmission.stp -T 1</pre></font></p>
1257 </li></ul>
1258 <h3><a name="THREAD"><a href="#THREAD">&para;</a> THREAD</a></h3>
1259 <ul>
1260 <li><a href="general/eventcount.stp">general/eventcount.stp</a> - Interactive Count Specified Events<br>
1261 keywords: <a href="keyword-index.html#INTERACTIVE">INTERACTIVE</a> <a href="keyword-index.html#STATISTICS">STATISTICS</a> <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
1262 <p>The script periodically prints a count of specified events and their related tid&#39;s over the course of execution. Numerous configuration options exist to control filtering / reporting, some of which can be modified at runtime. See the script source for more information.</p><p><i><a href="general/eventcount.txt">sample usage in general/eventcount.txt</i></font></p>
1263 </li><li><a href="process/threadstacks.stp">process/threadstacks.stp</a> - Override default new-pthread stack sizes<br>
1264 keywords: <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1265 <p>Overrides default NPTL pthread_create stack size for all new threads created by target processes. Reports one line per process when the related glibc variable __default_stacksize is updated. Moot for glibc versions that support $LIBC_PTHREAD_DEFAULT_STACKSIZE_NP.</p><p><font size="-2"><pre># stap -g threadstacks.stp -Gsize=65536 -T 1 -d `which stap`</pre></font></p>
1266 </li></ul>
1267 <h3><a name="TIME"><a href="#TIME">&para;</a> TIME</a></h3>
1268 <ul>
1269 <li><a href="general/stopwatches.stp">general/stopwatches.stp</a> - See the amount of wall clock time a process spends in various states<br>
1270 keywords: <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1271 <p>The stopwatch.stp script illustrates how to use multiple stopwatches record how much wallclock time a process spends in kernel- and user-space. On exit the script prints out the time in seconds, milliseconds, microseconds, and nanoseconds. Note that this output of this script is not directly comparable to the time command because time records the time that the process is actually active in kernel- and user-space.</p><p><font size="-2"><pre># stap stopwatches.stp -T 1</pre></font></p>
1272 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
1273 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
1274 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
1275 </li><li><a href="process/sched-latency.stp">process/sched-latency.stp</a> - track wakeup-to-dispatch latency stats<br>
1276 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1277 <p>This script periodically reports a histogram of the latency between a task (thread) being woken up and it actually being dispatched to a CPU: the amount of time it&#39;s spent in the runnable queue.</p><p><i><a href="process/sched-latency.txt">sample usage in process/sched-latency.txt</i></font></p>
1278 </li><li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States Using Tracepoints<br>
1279 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1280 <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID and its children.</p><p><i><a href="process/schedtimes.txt">sample usage in process/schedtimes.txt</i></font></p>
1281 </li></ul>
1282 <h3><a name="TRACE"><a href="#TRACE">&para;</a> TRACE</a></h3>
1283 <ul>
1284 <li><a href="apps/gmalloc_watch.stp">apps/gmalloc_watch.stp</a> - Tracing glib2 memory allocations<br>
1285 keywords: <a href="keyword-index.html#TRACE">TRACE</a> <br>
1286 <p>The gmalloc_watch.stp script from Colin Walters&#39; blog (https://blog.verbum.org/2011/03/19/analyzing-memory-use-with-systemtap/) traces the allocation of glib2 memory using the markers in glib2.</p><p><font size="-2"><pre># stap gmalloc_watch.stp -T 1</pre></font></p>
1287 </li><li><a href="apps/libguestfs_log.stp">apps/libguestfs_log.stp</a> - Trace libguestfs startup<br>
1288 keywords: <a href="keyword-index.html#APPLICATION">APPLICATION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#BPF">BPF</a> <br>
1289 <p>The libguestfs_log.stp script prints a log of when various libgueststartup steps are encountered. The first column is microseconds since the script started. The second column is the time elapsed in microseconds between the previous and current events and the third column is the event name.</p><p><font size="-2"><pre># stap libguestfs_log.stp -T 1</pre></font></p>
1290 </li><li><a href="apps/php-trace.stp">apps/php-trace.stp</a> - Tracing of PHP code execution<br>
1291 keywords: <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#DYNINST">DYNINST</a> <br>
1292 <p>Trace of executing PHP code using the enabled markers.</p><p><font size="-2"><pre># stap php-trace.stp -c &#39;php -f hello.php&#39;</pre></font></p>
1293 </li><li><a href="apps/stap_time.stp">apps/stap_time.stp</a> - Provide elapsed times for Passes of SystemTap script compilation<br>
1294 keywords: <a href="keyword-index.html#APPLICATION">APPLICATION</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
1295 <p>SystemTap has multiple passes to convert the text of a SystemTap script into instrumentation that actually collect data on the system. The stap_time.stp script uses the markers in SystemTap to note the amount of time that each of the passes requires. When SystemTap completes pass 4 (compiling the instrumentation into a kernel module) the script print out the script name followed by the amount of time in milliseconds required for Pass 0 (command line option parsing), Pass 1 (script parsing), Pass 2 (elaboration), Pass 3 (code generation), and Pass 4 (module compilation). The resulting data can be analyzed to determine if there are issues with the amount of time that systemtap takes to generate instrumentation.</p><p><font size="-2"><pre># stap stap_time.stp -T 1</pre></font></p>
1296 </li><li><a href="general/callgraph.stp">general/callgraph.stp</a> - Callgraph Tracing<br>
1297 keywords: <a href="keyword-index.html#SIMPLE">SIMPLE</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
1298 <p>Print a timed per-thread microsecond-timed nested callgraph. The first parameter names the function probe points to trace.</p><p><i><a href="general/callgraph.txt">sample usage in general/callgraph.txt</i></font></p>
1299 </li><li><a href="general/para-callgraph-verbose.stp">general/para-callgraph-verbose.stp</a> - Callgraph Tracing with Verbose Arguments<br>
1300 keywords: <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
1301 <p>Print a timed per-thread microsecond-timed callgraph, complete with pretty-printed function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.</p><p><font size="-2"><pre># stap para-callgraph-verbose.stp &#39;kernel.function(&quot;*@fs/proc*.c&quot;)&#39; \
1302 &#39;kernel.function(&quot;vfs_read&quot;)&#39; -c &quot;cat /proc/sys/vm/* || true&quot;</pre></font></p>
1303 </li><li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Callgraph Tracing with Arguments<br>
1304 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#CALLGRAPH">CALLGRAPH</a> <br>
1305 <p>Print a timed per-thread microsecond-timed callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.</p><p><i><a href="general/para-callgraph.txt">sample usage in general/para-callgraph.txt</i></font></p>
1306 </li><li><a href="general/whythefail.stp">general/whythefail.stp</a> - Why did the function fail?<br>
1307 keywords: <a href="keyword-index.html#SPECULATION">SPECULATION</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#FUNCTION">FUNCTION</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#_BEST">_BEST</a> <br>
1308 <p>The whythefail.stp script prints a statement-execution trace for a given function, but only for those runs of the function that ended up with a (configurable) post-return condition.</p><p><i><a href="general/whythefail.txt">sample usage in general/whythefail.txt</i></font></p>
1309 </li><li><a href="network/nfsd-trace.stp">network/nfsd-trace.stp</a> - Trace NFSD requests with file names.<br>
1310 keywords: <a href="keyword-index.html#NFS">NFS</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
1311 <p>This script traces all nfsd server operations by client_ip address, operation, and complete file name (if possible).</p><p><i><a href="network/nfsd-trace.txt">sample usage in network/nfsd-trace.txt</i></font></p>
1312 </li><li><a href="network/tcp_trace.stp">network/tcp_trace.stp</a> - TCP Connection Tracing Utility<br>
1313 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <br>
1314 <p>This scripts traces a given TCP connection based on the filter parameters given by the user. The indexing is done by the 4 tuples local address, remote address, local port, remote port.</p><p><i><a href="network/tcp_trace.txt">sample usage in network/tcp_trace.txt</i></font></p>
1315 </li><li><a href="network/who_sent_it.stp">network/who_sent_it.stp</a> - Trace threads sending network traffic to given host and/or port<br>
1316 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1317 <p>This script traces outgoing network packets using the netfilter probes (not requiring debuginfo), printing the source thread name/id and destination host:port. It may be filtered with the_dport and the_daddr globals, e.g., to watch only for DNS traffic (port 53), and/or only to the localhost (127.0.0.1).</p><p><i><a href="network/who_sent_it.txt">sample usage in network/who_sent_it.txt</i></font></p>
1318 </li></ul>
1319 <h3><a name="TRACEPOINT"><a href="#TRACEPOINT">&para;</a> TRACEPOINT</a></h3>
1320 <ul>
1321 <li><a href="network/dropwatch.stp">network/dropwatch.stp</a> - Watch Where Socket Buffers Are Freed in the Kernel<br>
1322 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br>
1323 <p>Every five seconds the dropwatch.stp script lists the number of socket buffers freed at locations in the kernel.</p><p><font size="-2"><pre># stap -d kernel dropwatch.stp -T 1</pre></font></p>
1324 </li><li><a href="process/cycle_thief.stp">process/cycle_thief.stp</a> - Track IRQ's and Other Processes Stealing Cycles from a Task<br>
1325 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
1326 <p>The cycle_thief.stp script instruments the scheduler and IRQ handler to determine which processes and interrupts are competing with the specified task for the cpu cycles. This script uses the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific task. The script output the number of times the task migrates between processors, histograms showing the length of time on and off processor, lists of processes running while the task is off the processor, and the interrupts that occurred while the task was running.</p><p><i><a href="process/cycle_thief.txt">sample usage in process/cycle_thief.txt</i></font></p>
1327 </li><li><a href="process/procmod_watcher.stp">process/procmod_watcher.stp</a> - Monitor process creation/termination and module [un]loading<br>
1328 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1329 <p>The procmod_watcher.stp script monitors calls to fork(), exec(), exit(), init_module(), and delete_module(). Event-specific details are also printed out (e.g. for exec(), the file being exec&#39;ed). This script does not require debuginfo.</p><p><font size="-2"><pre># stap procmod_watcher.stp -T 1</pre></font></p>
1330 </li><li><a href="process/sched-latency.stp">process/sched-latency.stp</a> - track wakeup-to-dispatch latency stats<br>
1331 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1332 <p>This script periodically reports a histogram of the latency between a task (thread) being woken up and it actually being dispatched to a CPU: the amount of time it&#39;s spent in the runnable queue.</p><p><i><a href="process/sched-latency.txt">sample usage in process/sched-latency.txt</i></font></p>
1333 </li><li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States Using Tracepoints<br>
1334 keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1335 <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the &#39;-c&#39; or &#39;-x&#39; options to focus on a specific PID and its children.</p><p><i><a href="process/schedtimes.txt">sample usage in process/schedtimes.txt</i></font></p>
1336 </li><li><a href="profiling/syscallerrorsbypid.stp">profiling/syscallerrorsbypid.stp</a> - Provide a per-process syscall error tally on the system<br>
1337 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1338 <p>The syscallerrorsbypid.stp script tallies syscall errors for each running process. This information can be useful to whether there are excessive errors for various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallerrorsbypid.stp -T 1</pre></font></p>
1339 </li><li><a href="profiling/syscalllatency.stp">profiling/syscalllatency.stp</a> - Provide a per-process accumulation of syscall latency on the system<br>
1340 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1341 <p>The syscalllatency.stp script accumulates syscall latency for each running process. This information can be useful to whether excessive time is being spent in particular syscalls on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall error counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscalllatency.stp -T 1</pre></font></p>
1342 </li><li><a href="profiling/syscallsbypid.stp">profiling/syscallsbypid.stp</a> - Provide a per-process syscall tally on the system<br>
1343 keywords: <a href="keyword-index.html#PROMETHEUS">PROMETHEUS</a> <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
1344 <p>The syscallsbypid.stp script tallies each syscall for each running process. This information can be useful to determine the activity of various processes on the system. The script makes the information available via procfs in Prometheus readable format. When a process exits its data will be eliminated from the prometheus output. To avoid exceeding the storage limitations of SystemTap older entries maybe overwritten by newer entries. This can lead to some active process syscall counts disappearing and/or later reappearing with a lower value. Also note that the script does not properly name syscalls for 32-bit applications running on 64-bit machines.</p><p><font size="-2"><pre># stap syscallsbypid.stp -T 1</pre></font></p>
1345 </li></ul>
1346 <h3><a name="TRAFFIC"><a href="#TRAFFIC">&para;</a> TRAFFIC</a></h3>
1347 <ul>
1348 <li><a href="network/netdev.stp">network/netdev.stp</a> - Trace Activity on Network Devices<br>
1349 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1350 <p>The netdev.stp script traces configuration and transmit/receive activity on network devices.</p><p><font size="-2"><pre># stap netdev.stp -T 1</pre></font></p>
1351 </li><li><a href="network/netfilter_summary.stp">network/netfilter_summary.stp</a> - System-Wide Count of Network Packets by IPs<br>
1352 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1353 <p>The script watches all IPv4 network traffic on the system. On exit the script prints a list showing the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair. The list is ordered from greatest to least number of packets seen among the source/destination pairs.</p><p><i><a href="network/netfilter_summary.txt">sample usage in network/netfilter_summary.txt</i></font></p>
1354 </li><li><a href="network/netfilter_summary_json.stp">network/netfilter_summary_json.stp</a> - System-Wide Count of Network Packets by IPs<br>
1355 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#JSON">JSON</a> <br>
1356 <p>The script watches all IPv4 network traffic on the system. The data is output in JSON format and includes the number of packets sent along source IP address / destination IP address pair encountered, and the total number of bytes sent among the pair.</p><p><font size="-2"><pre># stap netfilter_summary_json.stp -T 1</pre></font></p>
1357 </li><li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
1358 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1359 <p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p><p><i><a href="network/nettop.txt">sample usage in network/nettop.txt</i></font></p>
1360 </li><li><a href="network/packet_contents.stp">network/packet_contents.stp</a> - Network packet contents<br>
1361 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1362 <p>The packet_contents.stp script displays the length of each network packet and its contents in both hexadecimal and ASCII. Systemtap strings are MAXSTRINGLEN in length by default which may not be enough for larger packets. In order to print larger packets, this limit can be increased by passing in the &quot;-DMAXSTRINGLEN=65536&quot; command line option.</p><p><i><a href="network/packet_contents.txt">sample usage in network/packet_contents.txt</i></font></p>
1363 </li><li><a href="network/stp_dump.stp">network/stp_dump.stp</a> - Dump of STP packets<br>
1364 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1365 <p>The stp_dump.stp prints out the packet contents. Each block contains the STP protocol ID, version ID, flags, root and bridge MAC addresses, and various times.</p><p><i><a href="network/stp_dump.txt">sample usage in network/stp_dump.txt</i></font></p>
1366 </li><li><a href="network/tcpdumplike.stp">network/tcpdumplike.stp</a> - Dump of Received UDP/TCP Packets<br>
1367 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br>
1368 <p>The tcpdumplike.stp prints out a line for each TCP &amp; UDP packet received. Each line includes the source and destination IP addresses, the source and destination ports, and flags.</p><p><font size="-2"><pre># stap tcpdumplike.stp -T 1</pre></font></p>
1369 </li><li><a href="network/who_sent_it.stp">network/who_sent_it.stp</a> - Trace threads sending network traffic to given host and/or port<br>
1370 keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACE">TRACE</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#SIMPLE">SIMPLE</a> <br>
1371 <p>This script traces outgoing network packets using the netfilter probes (not requiring debuginfo), printing the source thread name/id and destination host:port. It may be filtered with the_dport and the_daddr globals, e.g., to watch only for DNS traffic (port 53), and/or only to the localhost (127.0.0.1).</p><p><i><a href="network/who_sent_it.txt">sample usage in network/who_sent_it.txt</i></font></p>
1372 </li></ul>
1373 <h3><a name="TTY"><a href="#TTY">&para;</a> TTY</a></h3>
1374 <ul>
1375 <li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor TTY Typing<br>
1376 keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#TTY">TTY</a> <a href="keyword-index.html#MONITORING">MONITORING</a> <a href="keyword-index.html#GURU">GURU</a> <br>
1377 <p>The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis.</p><p><i><a href="io/ttyspy.txt">sample usage in io/ttyspy.txt</i></font></p>
1378 </li></ul>
1379 <h3><a name="VIRTUALIZATION"><a href="#VIRTUALIZATION">&para;</a> VIRTUALIZATION</a></h3>
1380 <ul>
1381 <li><a href="virtualization/kvm_service_time.stp">virtualization/kvm_service_time.stp</a> - Time Statistics on KVM Exit Reasons<br>
1382 keywords: <a href="keyword-index.html#_BEST">_BEST</a> <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#KVM">KVM</a> <br>
1383 <p>The kvm_service_time.stp script tracks the statistics about the amount of time that the processor left the guest virtual machine for each exit reason (for example fixing up a page table or handling an IO operation). When the script exits it prints out the number of times each exit reason was encountered, the total duration of time it left the guest VM, the minimum time, the average time, and the maximum time in microseconds for that exit reason. On Linux 2.6.38 and newer kernel the script can automatically determine whether it is running on Intel or AMD processors. For older kernels with a kernel.trace(&quot;kvm_exit&quot;) tracepoint that does not have the $isa parameter you can explicitly state the kvm type with a &quot;-G kvm=intel&quot; or &quot;-G kvm=amd&quot; on the command line.</p><p><i><a href="virtualization/kvm_service_time.txt">sample usage in virtualization/kvm_service_time.txt</i></font></p>
1384 </li><li><a href="virtualization/qemu_count.stp">virtualization/qemu_count.stp</a> - Tally the Number of User-Space QEMU Events<br>
1385 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <br>
1386 <p>The qemu_count.stp script tallies the number of times each of the user-space qemu probepoints is encountered. When the script exits, it prints a list of the number of times each user-space qemu probepoint is encountered.</p><p><font size="-2"><pre># stap qemu_count.stp -T 1</pre></font></p>
1387 </li><li><a href="virtualization/qemu_io.stp">virtualization/qemu_io.stp</a> - Tally the Number of User-Space QEMU IO on Each IO Port<br>
1388 keywords: <a href="keyword-index.html#VIRTUALIZATION">VIRTUALIZATION</a> <a href="keyword-index.html#QEMU">QEMU</a> <a href="keyword-index.html#KVM">KVM</a> <a href="keyword-index.html#IO">IO</a> <br>
1389 <p>The qemu_io.stp script tallies the number of times each of the IO port on the guest virtual machines is touched by a input or output operation. When the script exits, it prints a count of the number of times each IO port read and written.</p><p><font size="-2"><pre># stap qemu_io.stp -T 1</pre></font></p>
1390 </li></ul>
1391 <h3><a name="WATCHDOG"><a href="#WATCHDOG">&para;</a> WATCHDOG</a></h3>
1392 <ul>
1393 <li><a href="general/watchdog.stp">general/watchdog.stp</a> - Watchdog Timer for Arbitrary Events<br>
1394 keywords: <a href="keyword-index.html#WATCHDOG">WATCHDOG</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
1395 <p>The watchdog.stp script provides a watchdog timer mechanism for arbitrary events. The script takes three arguments: the events to start watchdog timer, the event to stop the watchdog timer, and the time in millseconds for the watchdog. If the watchdog timer is exceed, the script will trigger a stack backtrace of the user-process that timed out using pstack. This script can be used to diagnose what the userspace application is doing when a slower than expected operation occurs.</p><p><font size="-2"><pre># stap watchdog.stp &#39;syscall.nanosleep&#39; &#39;syscall.nanosleep.return&#39; 1000 \
1396 -T 1</pre></font></p>
1397 </li></ul>
1398 <h3><a name="WATCHPOINT"><a href="#WATCHPOINT">&para;</a> WATCHPOINT</a></h3>
1399 <ul>
1400 <li><a href="memory/hw_watch_addr.stp">memory/hw_watch_addr.stp</a> - Watch a Kernel Address Using Breakpoint Hardware<br>
1401 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#WATCHPOINT">WATCHPOINT</a> <br>
1402 <p>The script will watch accesses to a single kernel address and prints a traceback each time the address is accessed. This script needs to be run as root to allow access to the breakpoint hardware.</p><p><font size="-2"><pre># stap --all-modules hw_watch_addr.stp 0x`grep &quot;vm_dirty_ratio&quot; \
1403 /proc/kallsyms | awk &#39;{print $1}&#39;` -T 5</pre></font></p>
1404 </li><li><a href="memory/hw_watch_sym.stp">memory/hw_watch_sym.stp</a> - Watch a Kernel Symbol Using Breakpoint Hardware<br>
1405 keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#WATCHPOINT">WATCHPOINT</a> <br>
1406 <p>The script will watch accesses to the starting address of a single kernel symbol and prints a traceback each time the symbol is accessed. This script needs to be run as root to allow access to the breakpoint hardware.</p><p><font size="-2"><pre># stap --all-modules hw_watch_sym.stp vm_dirty_ratio -T 5</pre></font></p>
1407 </li></ul>
1408 </td>
1409 </tr>
1410 </table>
1411 </div>
1412 </div>
1413
1414 <table cellspacing="2" cellpadding="2" border="0" width="100%">
1415 <tr>
1416 <td align="center" class="footer"><a href=
1417 "http://sourceware.org/systemtap">SystemTap</a></td>
1418 </tr>
1419 </table>
1420 </body>
1421 </html>