summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/network
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-06-19 10:58:03 -0500
committerDavid Smith <dsmith@redhat.com>2009-06-19 10:58:03 -0500
commit76d9a838820b78ab93f9faeb1dcf20f2ec509fc3 (patch)
tree93bdad0ee02177e9af895772d3ad6ebccc156138 /testsuite/systemtap.examples/network
parentac4f1eca71edee2feb2cbdad1a044549f30da023 (diff)
parent0c98234c86877cfea3df762dc8627b3f05c38e75 (diff)
downloadsystemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.tar.gz
systemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.tar.xz
systemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.zip
Merge commit 'origin/master' into pr7043
Diffstat (limited to 'testsuite/systemtap.examples/network')
-rw-r--r--testsuite/systemtap.examples/network/sk_stream_wait_memory.meta13
-rwxr-xr-xtestsuite/systemtap.examples/network/sk_stream_wait_memory.stp25
2 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta b/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta
new file mode 100644
index 00000000..bc798f72
--- /dev/null
+++ b/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta
@@ -0,0 +1,13 @@
+title: Track Start and Stop of Processes Due to Network Buffer Space
+name: sk_stream_wait_memory.stp
+version: 1.0
+author: Fabio Olive Leite at Red Hat
+keywords: network tcp buffer memory
+subsystem: kernel
+status: production
+exit: user-controlled
+output: trace
+scope: system-wide
+description: The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.
+test_check: stap -p4 sk_stream_wait_memory.stp
+test_installcheck: stap sk_stream_wait_memory.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp b/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp
new file mode 100755
index 00000000..159d77a6
--- /dev/null
+++ b/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp
@@ -0,0 +1,25 @@
+# Simple probe to detect when a process is waiting for more socket send
+# buffer memory. Usually means the process is doing writes larger than the
+# socker send buffer size or there is a slow receiver at the other side.
+# Increasing the socket's send buffer size might help decrease application
+# latencies, but it might also make it worse, so buyer beware.
+#
+# Tipical output: timestamp in microseconds: procname(pid) event
+#
+# 1218230114875167: python(17631) blocked on full send buffer
+# 1218230114876196: python(17631) recovered from full send buffer
+# 1218230114876271: python(17631) blocked on full send buffer
+# 1218230114876479: python(17631) recovered from full send buffer
+
+probe kernel.function("sk_stream_wait_memory")
+{
+ printf("%u: %s(%d) blocked on full send buffer\n",
+ gettimeofday_us(), execname(), pid())
+}
+
+probe kernel.function("sk_stream_wait_memory").return
+{
+ printf("%u: %s(%d) recovered from full send buffer\n",
+ gettimeofday_us(), execname(), pid())
+}
+