diff options
author | William Cohen <wcohen@redhat.com> | 2009-07-10 10:34:13 -0400 |
---|---|---|
committer | William Cohen <wcohen@redhat.com> | 2009-07-10 10:34:13 -0400 |
commit | c728b7da8be430367aa33f9fbacda93d4add9ea2 (patch) | |
tree | 5d76f646d43b78ee5b15e4c09483da127ecfcdc0 /testsuite/systemtap.examples/memory | |
parent | 880fc23fa180ae9c9557e7ff945f5f1e750aef15 (diff) | |
download | systemtap-steved-c728b7da8be430367aa33f9fbacda93d4add9ea2.tar.gz systemtap-steved-c728b7da8be430367aa33f9fbacda93d4add9ea2.tar.xz systemtap-steved-c728b7da8be430367aa33f9fbacda93d4add9ea2.zip |
Add numa_faults.stp example.
Diffstat (limited to 'testsuite/systemtap.examples/memory')
-rw-r--r-- | testsuite/systemtap.examples/memory/numa_faults.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/memory/numa_faults.stp | 38 |
2 files changed, 51 insertions, 0 deletions
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") +} |