Commit 25b776ba authored by Dale Hamel's avatar Dale Hamel

Doc and output width fixes for tcp tools

parent 182923e6
......@@ -21,7 +21,7 @@
BEGIN
{
printf("Tracing tcp accepts. Hit Ctrl-C to end.\n");
printf("%-8s %-7s %-14s ", "TIME", "PID", "COMM");
printf("%-8s %-6s %-14s ", "TIME", "PID", "COMM");
printf("%-14s %-5s %-14s %-5s %s\n", "RADDR", "RPORT", "LADDR", "LPORT", "BL");
}
......
......@@ -7,10 +7,10 @@ addresses changed to protect the innocent):
# ./tcpaccept
Tracing tcp accepts. Hit Ctrl-C to end.
TIME PID COMM RADDR RPORT LADDR LPORT QLEN QMAX
05:25:38 1463622 redis-server 10.152.152.89 50672 10.134.113.155 6379 0 8192
05:25:38 3252023 thread.rb 10.152.229.144 46768 10.134.113.160 8000 0 8192
05:25:38 1463622 redis-server 10.148.179.172 54856 10.134.113.159 6379 0 8192
TIME PID COMM RADDR RPORT LADDR LPORT BL
00:34:19 3949061 nginx 10.228.22.228 44226 10.229.20.169 8080 0/128
00:34:19 3951399 ruby 127.0.0.1 52422 127.0.0.1 8000 0/128
00:34:19 3949062 nginx 10.228.23.128 35408 10.229.20.169 8080 0/128
This output shows three connections, an IPv4 connections to PID 1463622, a "redis-server"
......
......@@ -6,10 +6,10 @@ This tool traces the kernel function performing active TCP connections
output (IP addresses changed to protect the innocent):
# ./tcpconnect
TIME PID COMM SADDR SPORT DADDR DPORT
05:44:26 629487 agent 127.0.0.1 5001 127.0.0.1 34282
05:44:30 629922 curl 127.0.0.1 10255 127.0.0.1 45084
05:44:30 629955 redis-cli 127.0.0.1 6379 127.0.0.1 51136
TIME PID COMM SADDR SPORT DADDR DPORT
00:36:45 1798396 agent 127.0.0.1 5001 10.229.20.82 56114
00:36:45 1798396 curl 127.0.0.1 10255 10.229.20.82 56606
00:36:45 3949059 nginx 127.0.0.1 8000 127.0.0.1 37780
This output shows three connections, one from a "agent" process, one from
......
......@@ -5,8 +5,8 @@ tcpdrop prints details of TCP packets or segments that were dropped by the
kernel, including the kernel stack trace that led to the drop:
# ./tcpdrop.bt
TIME COMM PID SADDR:SPORT > DADDR:DPORT STATE (FLAGS)
06:29:07 redis-server 3252023 10.153.18.169:44926 > 10.134.113.159:6379 ESTABLISHED
TIME PID COMM SADDR:SPORT DADDR:DPORT STATE
00:39:21 0 swapper/2 10.231.244.31:3306 10.229.20.82:50552 ESTABLISHE
tcp_drop+0x1
tcp_v4_do_rcv+0x135
tcp_v4_rcv+0x9c7
......@@ -36,23 +36,9 @@ TIME COMM PID SADDR:SPORT > DADDR:DPORT S
x86_64_start_reservations+0x24
x86_64_start_kernel+0x74
secondary_startup_64+0xa5
06:30:24 swapper/4 0 10.152.132.206:38392 > 10.134.113.159:6379 ESTABLISHED
tcp_drop+0x1
tcp_v4_do_rcv+0x135
__release_sock+0x88
release_sock+0x30
inet_stream_connect+0x47
SYSC_connect+0x9e
sys_connect+0xe
do_syscall_64+0x73
entry_SYSCALL_64_after_hwframe+0x3d
[...]
The last two columns show the state of the TCP session.
These two examples show packets arriving for a session in the established state,
that were dropped by the kernel.
The last column shows the state of the TCP session.
This tool is useful for debugging high rates of drops, which can cause the
remote end to do timer-based retransmits, hurting performance.
......
......@@ -22,7 +22,7 @@
BEGIN
{
printf("Tracing tcp retransmits. Hit Ctrl-C to end.\n");
printf("%-8s %-8s %20s %20s %6s\n", "TIME", "PID", "LADDR:LPORT", "RADDR:RPORT", "STATE" )
printf("%-8s %-8s %20s %21s %6s\n", "TIME", "PID", "LADDR:LPORT", "RADDR:RPORT", "STATE" )
}
kprobe:tcp_retransmit_skb
......
......@@ -5,10 +5,10 @@ This tool traces the kernel TCP retransmit function to show details of these
retransmits. For example:
# ./tcpretrans.bt
TIME PID LADDR:LPORT RADDR:RPORT STATE
01:55:05 0 10.153.223.157:22 69.53.245.40:34619 ESTABLISHED
01:55:05 0 10.153.223.157:22 69.53.245.40:34619 ESTABLISHED
01:55:17 0 10.153.223.157:22 69.53.245.40:22957 ESTABLISHED
TIME PID LADDR:LPORT RADDR:RPORT STATE
00:43:54 0 10.229.20.82:46654 153.2.224.76:443 SYN_SENT
00:43:55 0 10.232.0.49:57678 10.229.20.99:24231 SYN_SENT
00:43:57 100 10.229.20.175:54224 10.201.76.122:443 ESTABLISHED
[...]
This output shows three TCP retransmits, the first two were for an IPv4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment