diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-21 17:53:06 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-21 17:53:06 +0100 |
commit | 2e6135317db22a3c8d58776f10d75414b9685225 (patch) | |
tree | 5ee08c296fddf8f681b065ac9b3b1383866da915 /testsuite/systemtap.examples/memory | |
parent | 75dfa5cb9b3584995f9e634a6e769b8a1576bc0d (diff) | |
parent | ea549ffc2915aa58861637472b12196222673fa2 (diff) | |
download | systemtap-steved-2e6135317db22a3c8d58776f10d75414b9685225.tar.gz systemtap-steved-2e6135317db22a3c8d58776f10d75414b9685225.tar.xz systemtap-steved-2e6135317db22a3c8d58776f10d75414b9685225.zip |
Merge remote branch 'origin/master'
Diffstat (limited to 'testsuite/systemtap.examples/memory')
-rw-r--r-- | testsuite/systemtap.examples/memory/vm.tracepoints.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/memory/vm.tracepoints.stp | 18 |
2 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/memory/vm.tracepoints.meta b/testsuite/systemtap.examples/memory/vm.tracepoints.meta new file mode 100644 index 00000000..9fdb73f6 --- /dev/null +++ b/testsuite/systemtap.examples/memory/vm.tracepoints.meta @@ -0,0 +1,13 @@ +title: Collect slab allocation statistics +name: vm.tracepoints.stp +version: 1.0 +author: Rajasekhar +keywords: memory slab allocator +subsystem: memory +status: production +exit: user-controlled +output: sorted-list +scope: system-wide +description: 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. +test_check: stap -p4 vm.tracepoints.stp +test_installcheck: stap vm.tracepoints.stp -c "sleep 10" diff --git a/testsuite/systemtap.examples/memory/vm.tracepoints.stp b/testsuite/systemtap.examples/memory/vm.tracepoints.stp new file mode 100644 index 00000000..07cee6f5 --- /dev/null +++ b/testsuite/systemtap.examples/memory/vm.tracepoints.stp @@ -0,0 +1,18 @@ +global slabs + +probe vm.kmem_cache_alloc { + slabs [execname(), bytes_req]<<<1 +} + +probe timer.ms(10000) +{ + dummy = ""; + foreach ([name, bytes] in slabs) { + if (dummy != name) + printf("\nProcess:%s\n", name); + printf("Slab_size:%d\tCount:%d\n", bytes, @count(slabs[name, bytes])); + dummy = name; + } + delete slabs + printf("\n-------------------------------------------------------\n\n") +} |