diff options
author | Song Liu <songliubraving@fb.com> | 2017-10-30 17:41:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-02 21:12:45 -0400 |
commit | cf34ce3da1e41579296364509266c7dac573822a (patch) | |
tree | 621b3473cdd11c8a66a8c0c4819cad3974c32896 /net/ipv4/tcp_output.c | |
parent | 47d3d7ac656a1ffb9d0f0d3c845663ed6fd7e78d (diff) |
tcp: add tracepoint trace_tcp_retransmit_synack()
This tracepoint can be used to trace synack retransmits. It maintains
pointer to struct request_sock.
We cannot simply reuse trace_tcp_retransmit_skb() here, because the
sk here is the LISTEN socket. The IP addresses and ports should be
extracted from struct request_sock.
Note that, like many other tracepoints, this patch uses IS_ENABLED
in TP_fast_assign macro, which triggers sparse warning like:
./include/trace/events/tcp.h:274:1: error: directive in argument list
./include/trace/events/tcp.h:281:1: error: directive in argument list
However, there is no good solution to avoid these warnings. To the
best of our knowledge, these warnings are harmless.
Signed-off-by: Song Liu <songliubraving@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a85e8a282d17..06a0c89ffe40 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -3782,6 +3782,7 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req) | |||
3782 | __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); | 3782 | __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); |
3783 | if (unlikely(tcp_passive_fastopen(sk))) | 3783 | if (unlikely(tcp_passive_fastopen(sk))) |
3784 | tcp_sk(sk)->total_retrans++; | 3784 | tcp_sk(sk)->total_retrans++; |
3785 | trace_tcp_retransmit_synack(sk, req); | ||
3785 | } | 3786 | } |
3786 | return res; | 3787 | return res; |
3787 | } | 3788 | } |