summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/memory
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples/memory')
-rw-r--r--testsuite/systemtap.examples/memory/overcommit.meta6
-rw-r--r--testsuite/systemtap.examples/memory/overcommit.stp6
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/memory/overcommit.meta b/testsuite/systemtap.examples/memory/overcommit.meta
new file mode 100644
index 00000000..72fb1579
--- /dev/null
+++ b/testsuite/systemtap.examples/memory/overcommit.meta
@@ -0,0 +1,6 @@
+title: Log failed process memory allocation due to overcommit limits
+name: overcommit.stp
+keywords: memory process
+description: The overcommit.stp script prints a line each time the kernel refuses a memory allocation request from a process because of /proc/sys/vm/overcommit* limits.
+test_check: stap -p4 overcommit.stp
+test_installcheck: stap overcommit.stp -c "sleep 0.2"
diff --git a/testsuite/systemtap.examples/memory/overcommit.stp b/testsuite/systemtap.examples/memory/overcommit.stp
new file mode 100644
index 00000000..a0800107
--- /dev/null
+++ b/testsuite/systemtap.examples/memory/overcommit.stp
@@ -0,0 +1,6 @@
+probe kernel.function("__vm_enough_memory").return {
+ if ($return != 0) {
+ printf("overcommit blocked malloc, process %s (%d), %d pages\n",
+ execname(), pid(), $pages)
+ }
+}