diff options
author | Dave Brolley <brolley@redhat.com> | 2009-07-10 11:10:51 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-07-10 11:10:51 -0400 |
commit | 1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f (patch) | |
tree | a0c10b78ad3e7142a59ffd6f6e75b75abf90d88e /testsuite/systemtap.examples/memory/numa_faults.stp | |
parent | 7d54db1a2c0b3831b6fbc8282f1155426c4be540 (diff) | |
parent | c728b7da8be430367aa33f9fbacda93d4add9ea2 (diff) | |
download | systemtap-steved-1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f.tar.gz systemtap-steved-1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f.tar.xz systemtap-steved-1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples/memory/numa_faults.stp')
-rwxr-xr-x | testsuite/systemtap.examples/memory/numa_faults.stp | 38 |
1 files changed, 38 insertions, 0 deletions
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") +} |