diff options
author | Dave Brolley <brolley@redhat.com> | 2009-07-10 11:17:03 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-07-10 11:17:03 -0400 |
commit | 5739030625d3f1697c264e3d8f04e932d1e0773d (patch) | |
tree | 0ed2d10376f2bf9bb009e31357d7913277d29bfc /testsuite | |
parent | bdf70a5d466fa9c1559a93ab71603981f1c0d753 (diff) | |
parent | 1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f (diff) | |
download | systemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.tar.gz systemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.tar.xz systemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/buildok/fortysix.stp | 3 | ||||
-rw-r--r-- | testsuite/lib/systemtap.exp | 11 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.html | 3 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.txt | 11 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.html | 11 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.txt | 24 | ||||
-rw-r--r-- | testsuite/systemtap.examples/memory/numa_faults.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/memory/numa_faults.stp | 38 |
8 files changed, 108 insertions, 6 deletions
diff --git a/testsuite/buildok/fortysix.stp b/testsuite/buildok/fortysix.stp new file mode 100755 index 00000000..013ca5bc --- /dev/null +++ b/testsuite/buildok/fortysix.stp @@ -0,0 +1,3 @@ +#! stap -p4 +// PR 3498 + wildcarded modules +probe module("*scsi*").function("*").call { } diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index e04fe837..76fd57bd 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -53,7 +53,7 @@ proc print_systemtap_version {} { proc setup_systemtap_environment {} { - global srcdir env + global srcdir env server_pid net_path # need an absolute SRCDIR for the top-level src/ tree # XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR} @@ -68,6 +68,8 @@ proc setup_systemtap_environment {} { set env(SYSTEMTAP_DIR) [exec pwd]/.systemtap-[exec whoami] # Find or start a systemtap server, if requested. + set net_path "" + set server_pid 0 if {[use_server_p]} then { if {! [setup_server]} then { return 0 @@ -151,6 +153,7 @@ proc shutdown_server {} { if { $server_pid != 0 } then { print "Stopping the systemtap server with PID==$server_pid" exec stap-stop-server $server_pid + set server_pid 0 } # Remove the temporary stap script @@ -198,11 +201,9 @@ get_system_info proc systemtap_init {args} {} proc systemtap_version {} {} -proc systemtap_exit {} { +proc cleanup {} { # Stop the stap server, if we started it. - if {[use_server_p]} then { - shutdown_server - } + shutdown_server } diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 5435829f..e186b615 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -94,6 +94,9 @@ keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br> <li><a href="memory/kmalloc-top">memory/kmalloc-top</a> - Show Paths to Kernel Malloc (kmalloc) Invocations<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <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 be filtered to print only only the first stack traces (-t) stack traces with more a minimum counts (-m), or exclude certain stack traces (-e).</p></li> +<li><a href="memory/numa_faults.stp">memory/numa_faults.stp</a> - Summarize Process Misses across NUMA Nodes<br> +keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#NUMA">NUMA</a> <br> +<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 providea 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></li> <li><a href="memory/pfaults.stp">memory/pfaults.stp</a> - Generate Log of Major and Minor Page Faults<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <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 occuring.</p></li> diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index 53270b01..35decb82 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -175,6 +175,17 @@ keywords: memory counts (-m), or exclude certain stack traces (-e). +memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes +keywords: memory numa + + 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 providea 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. + + memory/pfaults.stp - Generate Log of Major and Minor Page Faults keywords: memory diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index f3db1429..4de28426 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -39,7 +39,7 @@ </ul> <h2>Examples by Keyword</h2> -<p><tt><a href="#BACKTRACE">BACKTRACE</a> <a href="#BUFFER">BUFFER</a> <a href="#CALLGRAPH">CALLGRAPH</a> <a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#FORMAT">FORMAT</a> <a href="#FREE">FREE</a> <a href="#FUNCTIONS">FUNCTIONS</a> <a href="#FUTEX">FUTEX</a> <a href="#GRAPH">GRAPH</a> <a href="#INTERRUPT">INTERRUPT</a> <a href="#IO">IO</a> <a href="#LOCKING">LOCKING</a> <a href="#MEMORY">MEMORY</a> <a href="#MONITOR">MONITOR</a> <a href="#NETWORK">NETWORK</a> <a href="#PER-PROCESS">PER-PROCESS</a> <a href="#PROCESS">PROCESS</a> <a href="#PROFILING">PROFILING</a> <a href="#READ">READ</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SIMPLE">SIMPLE</a> <a href="#SLEEP">SLEEP</a> <a href="#SOCKET">SOCKET</a> <a href="#SYSCALL">SYSCALL</a> <a href="#TCP">TCP</a> <a href="#TIME">TIME</a> <a href="#TRACE">TRACE</a> <a href="#TRACEPOINT">TRACEPOINT</a> <a href="#TRAFFIC">TRAFFIC</a> <a href="#TTY">TTY</a> <a href="#USE">USE</a> <a href="#WAIT4">WAIT4</a> <a href="#WRITE">WRITE</a> </tt></p> +<p><tt><a href="#BACKTRACE">BACKTRACE</a> <a href="#BUFFER">BUFFER</a> <a href="#CALLGRAPH">CALLGRAPH</a> <a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#FORMAT">FORMAT</a> <a href="#FREE">FREE</a> <a href="#FUNCTIONS">FUNCTIONS</a> <a href="#FUTEX">FUTEX</a> <a href="#GRAPH">GRAPH</a> <a href="#INTERRUPT">INTERRUPT</a> <a href="#IO">IO</a> <a href="#LOCKING">LOCKING</a> <a href="#MEMORY">MEMORY</a> <a href="#MONITOR">MONITOR</a> <a href="#NETWORK">NETWORK</a> <a href="#NUMA">NUMA</a> <a href="#PER-PROCESS">PER-PROCESS</a> <a href="#PROCESS">PROCESS</a> <a href="#PROFILING">PROFILING</a> <a href="#READ">READ</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SIMPLE">SIMPLE</a> <a href="#SLEEP">SLEEP</a> <a href="#SOCKET">SOCKET</a> <a href="#SYSCALL">SYSCALL</a> <a href="#TCP">TCP</a> <a href="#TIME">TIME</a> <a href="#TRACE">TRACE</a> <a href="#TRACEPOINT">TRACEPOINT</a> <a href="#TRAFFIC">TRAFFIC</a> <a href="#TTY">TTY</a> <a href="#USE">USE</a> <a href="#WAIT4">WAIT4</a> <a href="#WRITE">WRITE</a> </tt></p> <h3><a name="BACKTRACE">BACKTRACE</a></h3> <ul> <li><a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt (IPI)<br> @@ -168,6 +168,9 @@ keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-inde <li><a href="memory/kmalloc-top">memory/kmalloc-top</a> - Show Paths to Kernel Malloc (kmalloc) Invocations<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <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 be filtered to print only only the first stack traces (-t) stack traces with more a minimum counts (-m), or exclude certain stack traces (-e).</p></li> +<li><a href="memory/numa_faults.stp">memory/numa_faults.stp</a> - Summarize Process Misses across NUMA Nodes<br> +keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#NUMA">NUMA</a> <br> +<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 providea 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></li> <li><a href="memory/pfaults.stp">memory/pfaults.stp</a> - Generate Log of Major and Minor Page Faults<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <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 occuring.</p></li> @@ -202,6 +205,12 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <br> <p>The tcpdumplike.stp prints out a line for each TCP packet received. Each line includes the source and destination IP addresses, the source and destination ports, and flags.</p></li> </ul> +<h3><a name="NUMA">NUMA</a></h3> +<ul> +<li><a href="memory/numa_faults.stp">memory/numa_faults.stp</a> - Summarize Process Misses across NUMA Nodes<br> +keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <a href="keyword-index.html#NUMA">NUMA</a> <br> +<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 providea 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></li> +</ul> <h3><a name="PER-PROCESS">PER-PROCESS</a></h3> <ul> <li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor tty typing.<br> diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index d3d66fe2..bbee341f 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -299,6 +299,17 @@ keywords: memory counts (-m), or exclude certain stack traces (-e). +memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes +keywords: memory numa + + 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 providea 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. + + memory/pfaults.stp - Generate Log of Major and Minor Page Faults keywords: memory @@ -386,6 +397,19 @@ keywords: network traffic source and destination ports, and flags. += NUMA = + +memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes +keywords: memory numa + + 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 providea 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. + + = PER-PROCESS = io/ttyspy.stp - Monitor tty typing. diff --git a/testsuite/systemtap.examples/memory/numa_faults.meta b/testsuite/systemtap.examples/memory/numa_faults.meta new file mode 100644 index 00000000..34034bef --- /dev/null +++ b/testsuite/systemtap.examples/memory/numa_faults.meta @@ -0,0 +1,13 @@ +title: Summarize Process Misses across NUMA Nodes +name: numa_faults.stp +version: 1.0 +author: IBM +keywords: memory numa +subsystem: memory +status: production +exit: user-controlled +output: list +scope: system-wide +description: 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 providea 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. +test_check: stap -p4 numa_faults.stp +test_installcheck: stap numa_faults.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/memory/numa_faults.stp b/testsuite/systemtap.examples/memory/numa_faults.stp new file mode 100755 index 00000000..34a0ace7 --- /dev/null +++ b/testsuite/systemtap.examples/memory/numa_faults.stp @@ -0,0 +1,38 @@ +#! /usr/bin/env stap + +global execnames, page_faults, node_faults, nodes + +probe vm.pagefault { + p = pid(); n=addr_to_node(address) + execnames[p] = execname() + page_faults[p, write_access ? 1 : 0] <<< 1 + node_faults[p, n] <<< 1 + nodes[n] <<< 1 +} + +function print_pf () { + printf ("\n") + printf ("%-16s %-6s %10s %10s %-20s\n", + "Execname", "PID", "RD Faults", "WR Faults", "Node:Faults") + print ("======================= ========== ========== =============\n") + foreach (pid in execnames) { + printf ("%-16s %6d %10d %10d ", execnames[pid], pid, + @count(page_faults[pid,0]), @count(page_faults[pid,1])) + foreach ([node+] in nodes) { + if ([pid, node] in node_faults) + printf ("%d:%d ", node, @count(node_faults[pid, node])) + } + printf ("\n") + } + printf("\n") +} + +probe begin { + printf("Starting pagefault counters \n") +} + +probe end { + printf("Printing counters: \n") + print_pf () + printf("Done\n") +} |