Skip to content

Commit

Permalink
tcptracer: add example
Browse files Browse the repository at this point in the history
  • Loading branch information
iaguis committed Mar 27, 2017
1 parent 443e011 commit 2231f88
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tools/tcptracer_example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Demonstrations of tcptracer, the Linux eBPF/bcc version.


This tool traces the kernel function performing TCP connections (eg, via a
connect() or accept() syscalls) and closing them (explicitly or if the process
dies). Some example output (IP addresses are fake):

```
# ./tcptracer
T PID COMM IP SADDR DADDR SPORT DPORT
CN 2389 telnet 4 192.168.1.2 192.168.1.1 53404 23
CN 23323 curl 6 ::1 ::1 36226 80
CL 2389 telnet 4 192.168.1.2 192.168.1.1 53404 23
AC 23278 nc 6 ::1 ::1 80 36226
CL 23323 curl 6 ::1 ::1 36226 80
CL 23278 nc 6 ::1 ::1 80 36226
AC 15195 nc 4 10.202.210.1 10.202.109.12 8080 43904
CL 15195 nc 4 10.202.210.1 10.202.109.12 8080 43904
```

This output shows three conections, one outgoing from a "telnet" process, one
outgoing from "curl" to a local netcat, and one incoming received by the "nc"
process. The output details show the kind of event (CN for connection, CL for
close and AC for accept), PID, IP version, source address, destination address,
source port and destination port.

0 comments on commit 2231f88

Please sign in to comment.