Debian Codegraph @

testsuite/systemtap.examples/network/tcp_connections.stp

raw
1 #! /usr/bin/env stap
2
3 probe begin {
4 printf("%6s %16s %6s %6s %16s\n",
5 "UID", "CMD", "PID", "PORT", "IP_SOURCE")
6 }
7
8 probe kernel.{function("tcp_accept"),function("inet_csk_accept")}.return? {
9 sock = $return
10 if (sock != 0)
11 printf("%6d %16s %6d %6d %16s\n", uid(), execname(), pid(),
12 inet_get_local_port(sock), inet_get_ip_source(sock))
13 }