diff options
author | Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com> | 2009-12-21 17:10:54 +0530 |
---|---|---|
committer | Prerna Saxena <prerna@linux.vnet.ibm.com> | 2009-12-21 17:10:54 +0530 |
commit | 0c487e433fd6343e49b1e9dbc6492f38cfe26143 (patch) | |
tree | be01ff965b202f6ef59e470934f6610d7b454087 | |
parent | 261135850dbd4a2efd7d4cbd3d0e3dcde46688ee (diff) | |
download | systemtap-steved-0c487e433fd6343e49b1e9dbc6492f38cfe26143.tar.gz systemtap-steved-0c487e433fd6343e49b1e9dbc6492f38cfe26143.tar.xz systemtap-steved-0c487e433fd6343e49b1e9dbc6492f38cfe26143.zip |
Tracepoint based tapset for memory subsystem.
-rw-r--r-- | testsuite/buildok/vm.tracepoints.stp | 31 | ||||
-rw-r--r-- | testsuite/systemtap.examples/memory/vm.tracepoints.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/memory/vm.tracepoints.stp | 18 |
3 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/buildok/vm.tracepoints.stp b/testsuite/buildok/vm.tracepoints.stp new file mode 100644 index 00000000..488ca0fc --- /dev/null +++ b/testsuite/buildok/vm.tracepoints.stp @@ -0,0 +1,31 @@ +#! stap -up4 + +probe vm.kfree { + println(name) + printf("%-15s %-15p %-15s %-15p \n", execname(), call_site, caller_function, ptr) +} + +probe vm.kmalloc { + println(name) + printf("%-15s %-15p %-15s %-15p %-15d %-15d %-15d %-15s \n", execname(), call_site, caller_function, ptr, bytes_req, bytes_alloc, gfp_flags, gfp_flag_name) +} + +probe vm.kmem_cache_alloc { + println(name) + printf("%-15s %-15p %-15s %-15p %-15d %-15d %-15d %-15s \n", execname(), call_site, caller_function, ptr, bytes_req, bytes_alloc, gfp_flags, gfp_flag_name) +} + +probe vm.kmalloc_node { + println(name) + printf("%-15s %-15p %-15s %-15p %-15d %-15d %-15d %-15s \n", execname(), call_site, caller_function, ptr, bytes_req, bytes_alloc, gfp_flags, gfp_flag_name) +} + +probe vm.kmem_cache_alloc_node { + println(name) + printf("%-15s %-15p %-15s %-15p %-15d %-15d %-15d %-15s \n", execname(), call_site, caller_function, ptr, bytes_req, bytes_alloc, gfp_flags, gfp_flag_name) +} + +probe vm.kmem_cache_free { + println(name) + printf("%-15s %-15p %-15s %-15p \n", execname(), call_site, caller_function, ptr) +} 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") +} |