summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/network/tcp_connections.stp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-02-02 11:18:01 -0500
committerWilliam Cohen <wcohen@redhat.com>2009-02-02 11:18:01 -0500
commit492d227f2caa558c4fdcd4e7aae65cf32b4549cc (patch)
treec319888b1b69eb1cc396b97d66d7fbaf9e530747 /testsuite/systemtap.examples/network/tcp_connections.stp
parentca1d53c1c0eab03b2bf9422d645e09be7518ea4e (diff)
downloadsystemtap-steved-492d227f2caa558c4fdcd4e7aae65cf32b4549cc.tar.gz
systemtap-steved-492d227f2caa558c4fdcd4e7aae65cf32b4549cc.tar.xz
systemtap-steved-492d227f2caa558c4fdcd4e7aae65cf32b4549cc.zip
Revise tcp_connections.stp example and place in sysemtap.examples directory.
Diffstat (limited to 'testsuite/systemtap.examples/network/tcp_connections.stp')
-rw-r--r--testsuite/systemtap.examples/network/tcp_connections.stp14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/network/tcp_connections.stp b/testsuite/systemtap.examples/network/tcp_connections.stp
new file mode 100644
index 00000000..bd2db76a
--- /dev/null
+++ b/testsuite/systemtap.examples/network/tcp_connections.stp
@@ -0,0 +1,14 @@
+#! /usr/bin/env stap
+
+probe begin {
+ printf("%6s %16s %6s %6s %16s\n",
+ "UID", "CMD", "PID", "PORT", "IP_SOURCE")
+}
+
+probe kernel.function("tcp_accept").return?,
+ kernel.function("inet_csk_accept").return? {
+ sock = $return
+ if (sock != 0)
+ printf("%6d %16s %6d %6d %16s\n", uid(), execname(), pid(),
+ inet_get_local_port(sock), inet_get_ip_source(sock))
+}