summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/network
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-06-18 16:14:42 -0400
committerWilliam Cohen <wcohen@redhat.com>2009-06-18 16:14:42 -0400
commit905728a036bf9d5cf0c21d684ad53882489c82c8 (patch)
tree4413514fd356918109475cf28b8b8009def24823 /testsuite/systemtap.examples/network
parentd2309c6c3fb97cc0c8931b59e33fe18820b63c5d (diff)
downloadsystemtap-steved-905728a036bf9d5cf0c21d684ad53882489c82c8.tar.gz
systemtap-steved-905728a036bf9d5cf0c21d684ad53882489c82c8.tar.xz
systemtap-steved-905728a036bf9d5cf0c21d684ad53882489c82c8.zip
Check in sk_stream_wait_memory.stp example.
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())
+}
+