]>
Commit | Line | Data |
---|---|---|
210ff7bf | 1 | SYSTEMTAP EXAMPLES INDEX |
09a98ae0 | 2 | (see also keyword-index.txt) |
210ff7bf | 3 | |
0e0b566a WC |
4 | general/ansi_colors.stp - Color Table for ansi_set_color2() and ansi_set_color3() |
5 | keywords: format | |
6 | ||
7 | The script prints a table showing the available color combinations | |
8 | for the ansi_set_color2() and ans_set_color3() functions in the | |
9 | ansi.stp tapset. | |
10 | ||
11 | ||
12 | general/ansi_colors2.stp - Show Attribues in Table for ansi_set_color3() | |
13 | keywords: format | |
14 | ||
15 | The script prints a table showing the available attributes (bold, | |
16 | underline, and inverse) with color combinations for the | |
17 | ans_set_color3() function in the ansi.stp tapset. | |
18 | ||
19 | ||
ac505f97 JS |
20 | general/badname.stp - Bad Filename Filter |
21 | keywords: filesystem hack | |
22 | ||
23 | The badname.stp script shows how one could prevent the creation of | |
6287a9e6 | 24 | files with undesirable names using guru mode. |
ac505f97 JS |
25 | |
26 | ||
210ff7bf | 27 | general/graphs.stp - Graphing Disk and CPU Utilization |
09a98ae0 | 28 | keywords: disk cpu use graph |
210ff7bf FCE |
29 | |
30 | The script tracks the disk and CPU utilization. The resulting output | |
31 | of the script can be piped into gnuplot to generate a graph of disk | |
32 | and CPU USE. | |
33 | ||
34 | ||
35 | general/helloworld.stp - SystemTap "Hello World" Program | |
09a98ae0 | 36 | keywords: simple |
210ff7bf FCE |
37 | |
38 | A basic "Hello World" program implemented in SystemTap script. It | |
39 | prints out "hello world" message and then immediately exits. | |
40 | ||
41 | ||
aa15b9f0 | 42 | general/para-callgraph.stp - Callgraph tracing with arguments |
09a98ae0 | 43 | keywords: trace callgraph |
aa15b9f0 FCE |
44 | |
45 | Print a timed per-thread callgraph, complete with function parameters | |
46 | and return values. The first parameter names the function probe | |
47 | points to trace. The optional second parameter names the probe | |
48 | points for trigger functions, which acts to enable tracing for only | |
49 | those functions that occur while the current thread is nested within | |
50 | the trigger. | |
210ff7bf FCE |
51 | |
52 | ||
6b95efe9 JS |
53 | interrupt/interrupts-by-dev.stp - Record interrupts on a per-device basis. |
54 | keywords: interrupt | |
55 | ||
56 | The interrupts-by-dev.stp script profiles interrupts received by each | |
57 | device per 100 ms. | |
58 | ||
59 | ||
1cc8a4c7 WC |
60 | interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI) |
61 | keywords: interrupt backtrace | |
62 | ||
63 | The Linux kernel function smp_call_function causes expensive | |
64 | inter-processor interrupts (IPIs). The scf.stp script tallies the | |
65 | processes and backtraces causing the interprocessor interrupts to | |
66 | identify the cause of the expensive IPI. On exit the script prints | |
67 | the tallies in descending frequency. | |
68 | ||
69 | ||
210ff7bf | 70 | io/disktop.stp - Summarize Disk Read/Write Traffic |
09a98ae0 | 71 | keywords: disk |
210ff7bf FCE |
72 | |
73 | Get the status of reading/writing disk every 5 seconds, output top | |
74 | ten entries during that period. | |
75 | ||
76 | ||
77 | io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call | |
09a98ae0 | 78 | keywords: io backtrace |
210ff7bf FCE |
79 | |
80 | When a reschedule occurs during an AIO io_submit call, accumulate the | |
81 | traceback in a histogram. When the script exits prints out a sorted | |
82 | list from most common to least common backtrace. | |
83 | ||
84 | ||
67f8611b WC |
85 | io/ioblktime.stp - Average Time Block IO Requests Spend in Queue |
86 | keywords: io | |
87 | ||
88 | The ioblktime.stp script tracks the amount of time that each block IO | |
cc20d853 | 89 | requests spend waiting for completion. The script computes the |
f3c4da44 MW |
90 | average waiting time for block IO per device and prints list every 10 |
91 | seconds. In some cases there can be too many outstanding block IO | |
92 | operations and the script may exceed the default number of | |
67f8611b WC |
93 | MAXMAPENTRIES allowed. In this case the allowed number can be |
94 | increased with "-DMAXMAPENTRIES=10000" option on the stap command | |
95 | line. | |
96 | ||
97 | ||
a4f3198f WC |
98 | io/iodevstats.stp - List Executables Reading and Writing the Most Data by Device |
99 | keywords: io profiling | |
100 | ||
101 | The iodevstats.stp script measures the amount of data successfully | |
102 | read and written by all the executables for each io device on the | |
103 | system. The output is sorted from greatest sum of bytes read and | |
104 | written to a device by an executable to the least. The output | |
105 | contains device major/minor number, the count of operations (reads | |
106 | and writes), the totals and averages for the number of bytes read and | |
107 | written. | |
108 | ||
109 | ||
54ff5e0c FCE |
110 | io/iostat-scsi.stp - iostat for SCSI Devices |
111 | keywords: io profiling scsi | |
112 | ||
113 | The iostat-scsi.stp script provides a breakdown of the number of blks | |
ad7e33d7 | 114 | read and written on the machine's various SCSI devices. The script |
54ff5e0c FCE |
115 | takes one argument which is the number of seconds between reports. |
116 | ||
117 | ||
3e4444ed WC |
118 | io/iostats.stp - List Executables Reading and Writing the Most Data |
119 | keywords: io profiling | |
120 | ||
121 | The iostat.stp script measures the amount of data successfully read | |
122 | and written by all the executables on the system. The output is | |
123 | sorted from most greatest sum of bytes read and written by an | |
124 | executable to the least. The output contains the count of operations | |
125 | (opens, reads, and writes), the totals and averages for the number of | |
126 | bytes read and written. | |
127 | ||
128 | ||
210ff7bf | 129 | io/iotime.stp - Trace Time Spent in Read and Write for Files |
09a98ae0 | 130 | keywords: syscall read write time io |
210ff7bf FCE |
131 | |
132 | The script watches each open, close, read, and write syscalls on the | |
133 | system. For each file the scripts observes opened it accumulates the | |
f3c4da44 | 134 | amount of wall clock time spent in read and write operations and the |
210ff7bf FCE |
135 | number of bytes read and written. When a file is closed the script |
136 | prints out a pair of lines for the file. Both lines begin with a | |
137 | timestamp in microseconds, the PID number, and the executable name in | |
ad7e33d7 | 138 | parentheses. The first line with the "access" keyword lists the file |
210ff7bf FCE |
139 | name, the attempted number of bytes for the read and write |
140 | operations. The second line with the "iotime" keyword list the file | |
141 | name and the number of microseconds accumulated in the read and write | |
142 | syscalls. | |
143 | ||
144 | ||
145 | io/iotop.stp - Periodically Print I/O Activity by Process Name | |
09a98ae0 | 146 | keywords: io |
210ff7bf FCE |
147 | |
148 | Every five seconds print out the top ten executables generating I/O | |
149 | traffic during that interval sorted in descending order. | |
150 | ||
151 | ||
1beb5089 FCE |
152 | io/mbrwatch.stp - Monitor read/write of MBR (boot sector) area of block devices |
153 | keywords: io monitoring | |
154 | ||
155 | The mbrwatch.stp script reports any attempted reads/writes of the | |
156 | first few sectors of a raw block device. | |
157 | ||
158 | ||
111dd9ac WC |
159 | io/nfs_func_users.stp - Tally the Number of NFS Functions Used by Each Process |
160 | keywords: io profiling | |
161 | ||
162 | The nfs_func_users.stp script counts the uses of NFS functions in the | |
163 | kernel on a per process bases. The output is sorted from the process | |
164 | with the greatest number of NFS functions called to the least. The | |
165 | output contains the executable name, the process number, and the | |
166 | total number of NFS functions called by the process. | |
167 | ||
168 | ||
210ff7bf | 169 | io/traceio.stp - Track Cumulative I/O Activity by Process Name |
09a98ae0 | 170 | keywords: io |
210ff7bf FCE |
171 | |
172 | Every second print out the top ten executables sorted in descending | |
173 | order based on cumulative I/O traffic observed. | |
174 | ||
175 | ||
176 | io/traceio2.stp - Watch I/O Activity on a Particular Device | |
09a98ae0 | 177 | keywords: io |
210ff7bf FCE |
178 | |
179 | Print out the executable name and process number as reads and writes | |
180 | to the specified device occur. | |
181 | ||
182 | ||
b7f6cfc5 FCE |
183 | io/ttyspy.stp - Monitor tty typing. |
184 | keywords: io tty per-process monitor | |
185 | ||
186 | The ttyspy.stp script uses tty_audit hooks to monitor recent typing | |
187 | activity on the system, printing a scrolling record of recent | |
188 | keystrokes, on a per-tty basis. | |
189 | ||
190 | ||
cf5023fb WC |
191 | locks/bkl.stp - Tracing Contention on Big Kernel Lock (BKL) |
192 | keywords: locking | |
193 | ||
194 | The bkl.stp script can help determine whether the Big Kernel Lock | |
195 | (BKL) is causing serialization on a multiprocessor system due to | |
196 | excessive contention of the BKL. The bkl.stp script takes one | |
197 | argument which is the number of processes waiting for the Big Kernel | |
198 | Lock (BKL). When the number of processes waiting for the BKL is | |
199 | reached or exceeded, the script will print a time stamp, the number | |
200 | of processes waiting for the BKL, the holder of the BKL, and the | |
201 | amount of time the BKL was held. | |
202 | ||
203 | ||
204 | locks/bkl_stats.stp - Per Process Statistics on Big Kernel Lock (BKL) Use | |
205 | keywords: locking | |
206 | ||
207 | The bkl_stats.stp script can indicate which processes have excessive | |
208 | waits for the Big Kernel Lock (BKL) and which processes are taking | |
209 | the BKL for long periods of time. The bkl_stats.stp script prints | |
210 | lists of all the processes that require the BKL. Every five seconds | |
211 | two tables are printed out. The first table lists the processes that | |
212 | waited for the BKL followed by the number of times that the process | |
213 | waited, the minimum time of the wait, the average and the maximum | |
214 | time waited. The second table lists has similar information for the | |
f3c4da44 | 215 | time spent in holding the lock for each of the processes. |
cf5023fb WC |
216 | |
217 | ||
22f971e8 WC |
218 | memory/kmalloc-top - Show Paths to Kernel Malloc (kmalloc) Invocations |
219 | keywords: memory | |
220 | ||
221 | The kmalloc-top perl program runs a small systemtap script to collect | |
222 | stack traces for each call to the kmalloc function and counts the | |
223 | time that each stack trace is observed. When kmalloc-top exits it | |
f3c4da44 MW |
224 | prints out sorted list. The output can be filtered to print only the |
225 | first N stack traces (-t), stack traces with a minimum counts (-m), | |
226 | or exclude certain stack traces (-e). | |
22f971e8 WC |
227 | |
228 | ||
0dc23d1d WC |
229 | memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages |
230 | keywords: memory | |
231 | ||
232 | The mmanonpage.stp script uses the virtual memory tracepoints | |
233 | available in some kernels to track the number of faults, user space | |
234 | frees, page ins, copy on writes and unmaps for anonymous pages. When | |
235 | the script is terminated the counts are printed for each process that | |
236 | allocated pages while the script was running. This script displays | |
237 | the anonymous page statistics for each process that ran while the | |
f3c4da44 | 238 | script is active. It's useful in debugging leaks in the anonymous |
0dc23d1d WC |
239 | regions of a process. |
240 | ||
241 | ||
242 | memory/mmfilepage.stp - Track Virtual Memory System Actions on File Backed Pages | |
243 | keywords: memory | |
244 | ||
245 | The mmfilepage.stp script uses the virtual memory tracepoints | |
246 | available in some kernels to track the number of faults, copy on | |
247 | writes mapping, and unmapping operations for file backed pages. When | |
248 | the script is terminated the counts are printed for each process that | |
249 | allocated pages while the script was running. The mmfilepage.stp | |
250 | script is useful in debugging leaks in the mapped file regions of a | |
251 | process. | |
252 | ||
253 | ||
254 | memory/mmreclaim.stp - Track Virtual Memory System Page Reclamation | |
255 | keywords: memory | |
256 | ||
257 | The mmreclaim.stp script uses the virtual memory tracepoints | |
ad7e33d7 | 258 | available in some kernels to track page reclaim activity that |
f3c4da44 | 259 | occurred while the script was running. It's useful in debugging |
ad7e33d7 | 260 | performance problems that occur due to page reclamation. |
0dc23d1d WC |
261 | |
262 | ||
263 | memory/mmwriteback.stp - Track Virtual Memory System Writing to Disk | |
264 | keywords: memory | |
265 | ||
266 | The mmwriteback.stp script uses the virtual memory tracepoints | |
267 | available in some kernels to report all of the file writebacks that | |
268 | occur form kupdate, pdflush and kjournald while the script is | |
f3c4da44 MW |
269 | running. It's useful in determining where writes are coming from on |
270 | a supposedly idle system that is experiencing unexpected IO. | |
0dc23d1d WC |
271 | |
272 | ||
c728b7da WC |
273 | memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes |
274 | keywords: memory numa | |
275 | ||
276 | The numa_faults.stp script tracks the read and write pages faults for | |
277 | each process. When the script exits it prints out the total read and | |
ad7e33d7 | 278 | write pages faults for each process. The script also provide a break |
c728b7da WC |
279 | down of page faults per node for each process. This script is useful |
280 | for determining whether the program has good locality (page faults | |
281 | limited to a single node) on a NUMA computer. | |
282 | ||
283 | ||
1ff1a65d FCE |
284 | memory/overcommit.stp - Log failed process memory allocation due to overcommit limits |
285 | keywords: memory process | |
286 | ||
287 | The overcommit.stp script prints a line each time the kernel refuses | |
288 | a memory allocation request from a process because of | |
289 | /proc/sys/vm/overcommit* limits. | |
290 | ||
291 | ||
413996e0 WC |
292 | memory/pfaults.stp - Generate Log of Major and Minor Page Faults |
293 | keywords: memory | |
294 | ||
295 | The pfaults.stp script generates a simple log for each major and | |
296 | minor page fault that occurs on the system. Each line contains a | |
297 | timestamp (in microseconds) when the page fault servicing was | |
298 | completed, the pid of the process, the address of the page fault, the | |
299 | type of access (read or write), the type of fault (major or minor), | |
300 | and the elapsed time for page fault. This log can be examined to | |
ad7e33d7 | 301 | determine where the page faults are occurring. |
413996e0 WC |
302 | |
303 | ||
42c55668 MW |
304 | memory/vm.tracepoints.stp - Collect slab allocation statistics |
305 | keywords: memory slab allocator | |
306 | ||
307 | The script will probe all memory slab/slub allocations and collects | |
308 | information about the size of the object (bytes requested) and | |
309 | user-space process in execution. When run over a period of time, it | |
310 | helps to correlate kernel-space memory consumption owing to | |
311 | user-space processes. | |
312 | ||
313 | ||
8b88e771 FCE |
314 | network/autofs4.stp - Watch autofs4 operations |
315 | keywords: network autofs nfs | |
316 | ||
317 | Trace key autofs4 operations such as mounting or unmounting remote | |
318 | filesystems. | |
319 | ||
320 | ||
0e4901b0 WC |
321 | network/dropwatch.stp - Watch Where Socket Buffers are Freed in the Kernel |
322 | keywords: network tracepoint buffer free | |
323 | ||
324 | Every five seconds the dropwatch.stp script lists the number of | |
325 | socket buffers freed at locations in the kernel. | |
326 | ||
327 | ||
53e5699f JS |
328 | network/netdev.stp - Trace Activity on Network Devices |
329 | keywords: network device traffic | |
330 | ||
331 | The netdev.stp script traces configuration and transmit/receive | |
332 | activity on network devices. | |
333 | ||
334 | ||
210ff7bf | 335 | network/nettop.stp - Periodic Listing of Processes Using Network Interfaces |
09a98ae0 | 336 | keywords: network traffic per-process |
210ff7bf FCE |
337 | |
338 | Every five seconds the nettop.stp script prints out a list of | |
339 | processed (PID and command) with the number of packets sent/received | |
340 | and the amount of data sent/received by the process during that | |
341 | interval. | |
342 | ||
343 | ||
905728a0 WC |
344 | network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space |
345 | keywords: network tcp buffer memory | |
346 | ||
347 | The sk_stream-wait_memory.stp prints a time stamp, executable, and | |
348 | pid each time a process blocks due to the send buffer being full. A | |
349 | similar entry is printed each time a process continues because there | |
350 | is room in the buffer. | |
351 | ||
352 | ||
210ff7bf | 353 | network/socket-trace.stp - Trace Functions called in Network Socket Code |
09a98ae0 | 354 | keywords: network socket |
210ff7bf | 355 | |
f3c4da44 MW |
356 | The script instruments each of the functions in the Linux kernel's |
357 | net/socket.c file. The script prints out trace data. The first | |
358 | element of a line is time delta in microseconds from the previous | |
359 | entry. This is followed by the command name and the PID. The "->" and | |
360 | "<-" indicates function entry and function exit, respectively. The | |
361 | last element of the line is the function name. | |
210ff7bf FCE |
362 | |
363 | ||
492d227f WC |
364 | network/tcp_connections.stp - Track Creation of Incoming TCP Connections |
365 | keywords: network tcp socket | |
366 | ||
367 | The tcp_connections.stp script prints information for each new | |
368 | incoming TCP connection accepted by the computer. The information | |
369 | includes the UID, the command accepting the connection, the PID of | |
370 | the command, the port the connection is on, and the IP address of the | |
371 | originator of the request. | |
372 | ||
373 | ||
2e251678 DW |
374 | network/tcp_trace.stp - Tcp connection tracing utility. |
375 | keywords: network trace | |
376 | ||
377 | This scripts traces a given tcp connection based on the filter | |
378 | parameters given by the user. The indexing is done by the 4 tuples | |
379 | local address, remote address, local port, remote port. | |
380 | ||
381 | ||
7a51212c WC |
382 | network/tcpdumplike.stp - Dump of Received TCP Packets |
383 | keywords: network traffic | |
384 | ||
385 | The tcpdumplike.stp prints out a line for each TCP packet received. | |
386 | Each line includes the source and destination IP addresses, the | |
387 | source and destination ports, and flags. | |
388 | ||
389 | ||
4bb6522c WC |
390 | network/tcpipstat.stp - Display network statistics for individual TCP sockets. |
391 | keywords: network statistics | |
392 | ||
f3c4da44 | 393 | tcpipstat collects and displays network statistics related to |
4bb6522c | 394 | individual TCP sockets or groups of sockets. The statistics that are |
f3c4da44 | 395 | collected are simular to that of the command netstat -s, only sorted |
4bb6522c WC |
396 | and grouped by individual sockets. |
397 | ||
398 | ||
deb63545 WC |
399 | process/chng_cpu.stp - Monitor Changes in Processor Executing a Task |
400 | keywords: scheduler | |
401 | ||
402 | The chng_cpu.stp script takes an argument which is the executable | |
403 | name of the task it should monitor. Each time a task with that | |
404 | executable name is found running on a different processor, the script | |
405 | prints out the thread id (tid), the executable name, the processor | |
406 | now running the task, the thread state, and a backtrace showing the | |
407 | kernel functions that triggered the running of the task on the | |
408 | processor. | |
409 | ||
410 | ||
cc20d853 ET |
411 | process/errsnoop.stp - tabulate system call errors |
412 | keywords: process syscall | |
413 | ||
414 | The script prints a periodic tabular report about failing system | |
415 | calls, by process and by syscall failure. The first optional | |
416 | argument specifies the reporting interval (in seconds, default 5); | |
417 | the second optional argument gives a screen height (number of lines | |
418 | in the report, default 20). | |
419 | ||
420 | ||
e6b653c8 WC |
421 | process/forktracker.stp - Trace Creation of Processes |
422 | keywords: process scheduler | |
423 | ||
424 | The forktracker.stp script prints out a time-stamped entry showing | |
f3c4da44 | 425 | each fork and exec operation on the machine. This can be useful to |
e6b653c8 WC |
426 | determine what process is creating a flurry of short-lived processes. |
427 | ||
428 | ||
210ff7bf | 429 | process/futexes.stp - System-Wide Futex Contention |
09a98ae0 | 430 | keywords: syscall locking futex |
210ff7bf FCE |
431 | |
432 | The script watches the futex syscall on the system. On exit the | |
433 | futexes address, the number of contentions, and the average time for | |
434 | each contention on the futex are printed from lowest pid number to | |
435 | highest. | |
436 | ||
437 | ||
deb63545 WC |
438 | process/migrate.stp - Track the Migration of Specific Executables |
439 | keywords: scheduler | |
440 | ||
441 | The migrate.stp script takes an argument which is the executable name | |
442 | of the task it should monitor. Each time a task with that executable | |
443 | name migrates between processors an entry is printed with the process | |
444 | id (pid), the executable name, the processor off loading the task, | |
445 | and the process taking the task. Note that the task may or may not be | |
446 | executing at the time of the migration. | |
447 | ||
448 | ||
210ff7bf | 449 | process/pf2.stp - Profile kernel functions |
09a98ae0 | 450 | keywords: profiling |
210ff7bf FCE |
451 | |
452 | The pf2.stp script sets up time-based sampling. Every five seconds it | |
453 | prints out a sorted list with the top ten kernel functions with | |
454 | samples. | |
455 | ||
456 | ||
5b8642a2 FCE |
457 | process/plimit.stp - print resource limits |
458 | keywords: process | |
459 | ||
460 | The script prints a variety of resource limits for a given pid, like | |
461 | /proc/$$/limits on recent kernels. | |
462 | ||
463 | ||
34029cd3 WC |
464 | process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints |
465 | keywords: process scheduler time tracepoint | |
466 | ||
467 | The schedtimes.stp script instruments the scheduler to track the | |
f3c4da44 MW |
468 | amount of time that each process spends in running, sleeping, |
469 | queuing, and waiting for io. On exit the script prints out the | |
470 | accumulated time for each state of processes observed. Optionally, | |
471 | this script can be used with the '-c' or '-x' options to focus on a | |
472 | specific PID. | |
34029cd3 WC |
473 | |
474 | ||
210ff7bf | 475 | process/sig_by_pid.stp - Signal Counts by Process ID |
09a98ae0 | 476 | keywords: signals |
210ff7bf FCE |
477 | |
478 | Print signal counts by process ID in descending order. | |
479 | ||
480 | ||
481 | process/sig_by_proc.stp - Signal Counts by Process Name | |
09a98ae0 | 482 | keywords: signals |
210ff7bf FCE |
483 | |
484 | Print signal counts by process name in descending order. | |
485 | ||
486 | ||
487 | process/sigkill.stp - Track SIGKILL Signals | |
09a98ae0 | 488 | keywords: signals |
210ff7bf FCE |
489 | |
490 | The script traces any SIGKILL signals. When that SIGKILL signal is | |
491 | sent to a process, the script prints out the signal name, the | |
f3c4da44 MW |
492 | destination executable and process ID, the executable name and user |
493 | ID that sents the signal. | |
210ff7bf FCE |
494 | |
495 | ||
3a748561 | 496 | process/sigmon.stp - Track a particular signal to a specific process |
09a98ae0 | 497 | keywords: signals |
210ff7bf FCE |
498 | |
499 | The script watches for a particular signal sent to a specific | |
500 | process. When that signal is sent to the specified process, the | |
501 | script prints out the PID and executable of the process sending the | |
502 | signal, the PID and executable name of the process receiving the | |
503 | signal, and the signal number and name. | |
504 | ||
505 | ||
506 | process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations | |
09a98ae0 | 507 | keywords: io scheduler backtrace |
cae71dd3 | 508 | |
f3c4da44 | 509 | The script monitors the time that threads spend in waiting for IO |
cae71dd3 FCE |
510 | operations (in "D" state) in the wait_for_completion function. If a |
511 | thread spends over 10ms, its name and backtrace is printed, and later | |
512 | so is the total delay. | |
210ff7bf FCE |
513 | |
514 | ||
515 | process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls | |
09a98ae0 | 516 | keywords: syscall sleep |
210ff7bf FCE |
517 | |
518 | The script watches each nanosleep syscall on the system. At the end | |
519 | of each nanosleep syscall the script prints out a line with a | |
520 | timestamp in microseconds, the pid, the executable name in | |
ad7e33d7 | 521 | parentheses, the "nanosleep:" key, and the duration of the sleep in |
210ff7bf FCE |
522 | microseconds. |
523 | ||
524 | ||
525 | process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID | |
09a98ae0 | 526 | keywords: syscall |
210ff7bf FCE |
527 | |
528 | The script watches all syscall on the system. On exit the script | |
529 | prints a list showing the number of systemcalls executed by each PID | |
530 | ordered from greatest to least number of syscalls. | |
531 | ||
532 | ||
533 | process/syscalls_by_proc.stp - System-Wide Count of Syscalls by Executable | |
09a98ae0 | 534 | keywords: syscall |
210ff7bf FCE |
535 | |
536 | The script watches all syscall on the system. On exit the script | |
537 | prints a list showing the number of systemcalls executed by each | |
ad7e33d7 | 538 | executable ordered from greatest to least number of syscalls. |
210ff7bf FCE |
539 | |
540 | ||
541 | process/wait4time.stp - Trace Time Spent in wait4 Syscalls | |
09a98ae0 | 542 | keywords: syscall wait4 |
210ff7bf FCE |
543 | |
544 | The script watches each wait4 syscall on the system. At the end of | |
545 | each wait4 syscall the script prints out a line with a timestamp in | |
ad7e33d7 | 546 | microseconds, the pid, the executable name in parentheses, the |
210ff7bf FCE |
547 | "wait4:" key, the duration of the wait and the PID that the wait4 was |
548 | waiting for. If the waited for PID is not specified , it is "-1". | |
549 | ||
550 | ||
f503d3c0 FCE |
551 | profiling/fntimes.stp - Show functions taking longer than usual |
552 | keywords: profiling | |
553 | ||
554 | The fntimes.stp script monitors the execution time history of a given | |
555 | function family (assumed non-recursive). Each time (beyond a warmup | |
556 | interval) is then compared to the historical maximum. If it exceeds | |
557 | a certain threshold (250%), a message is printed. | |
558 | ||
559 | ||
210ff7bf | 560 | profiling/functioncallcount.stp - Count Times Functions Called |
09a98ae0 | 561 | keywords: profiling functions |
210ff7bf FCE |
562 | |
563 | The functioncallcount.stp script takes one argument, a list of | |
564 | functions to probe. The script will run and count the number of times | |
565 | that each of the functions on the list is called. On exit the script | |
566 | will print a sorted list from most frequently to least frequently | |
567 | called function. | |
568 | ||
569 | ||
0449af03 JS |
570 | profiling/sched_switch.stp - Display the task switches happening in the scheduler |
571 | keywords: profiling functions | |
572 | ||
573 | The sched_switch.stp script takes two arguments, first argument can | |
574 | be "pid" or "name" to indicate what is being passed as second | |
575 | argument. The script will trace the process based on pid/name and | |
576 | print the scheduler switches happening with the process. If no | |
577 | arguments are passed, it displays all the scheduler switches. This | |
578 | can be used to understand which tasks schedule out the current | |
579 | process being traced, and when it gets scheduled in again. | |
580 | ||
581 | ||
210ff7bf | 582 | profiling/thread-times.stp - Profile kernel functions |
09a98ae0 | 583 | keywords: profiling |
210ff7bf FCE |
584 | |
585 | The thread-times.stp script sets up time-based sampling. Every five | |
586 | seconds it prints out a sorted list with the top twenty processes | |
587 | with samples broken down into percentage total time spent in | |
588 | user-space and kernel-space. | |
589 | ||
590 | ||
ff90b297 WC |
591 | profiling/timeout.stp - Show Processes Doing Polling Operations |
592 | keywords: profiling | |
593 | ||
594 | The timeout.stp script is based on a blog entry | |
595 | (http://udrepper.livejournal.com/19041.html) mentioning a need for a | |
596 | tool to help developers find applications that are polling. The | |
597 | timeout.stp script monitors systemcall used for polling and records | |
598 | the systemcalls that timed out rather than returned because some | |
599 | action occurred. The script updates the screen once a second with the | |
600 | top twenty processes. | |
601 | ||
602 | ||
1bf72dfe WC |
603 | profiling/topsys.stp - Show Processes Doing Polling Operations |
604 | keywords: profiling | |
605 | ||
606 | The topsys.stp script lists out the top twenty systemcalls for the | |
607 | previous 5 seconds. The output is sorted from most frequent to least | |
608 | frequent. | |
609 | ||
610 |