tcp: add tracepoint trace_tcp_destroy_sock
authorSong Liu <songliubraving@fb.com>
Mon, 23 Oct 2017 16:20:26 +0000 (09:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 00:21:25 +0000 (01:21 +0100)
This patch adds trace event trace_tcp_destroy_sock.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/tcp.h
net/ipv4/tcp_ipv4.c

index c83c71187719d20a738df151e130d3691661409a..1724c12c25cf026b7c69fb2455ca1463598185d0 100644 (file)
@@ -154,6 +154,13 @@ DEFINE_EVENT(tcp_event_sk, tcp_receive_reset,
        TP_ARGS(sk)
 );
 
+DEFINE_EVENT(tcp_event_sk, tcp_destroy_sock,
+
+       TP_PROTO(const struct sock *sk),
+
+       TP_ARGS(sk)
+);
+
 #endif /* _TRACE_TCP_H */
 
 /* This part must be outside protection */
index eb3f3b8e1e4b326337513eeefab7c15abf676187..23a8100af5ad399d4fa2568f4cac19192a008055 100644 (file)
@@ -1869,6 +1869,8 @@ void tcp_v4_destroy_sock(struct sock *sk)
 {
        struct tcp_sock *tp = tcp_sk(sk);
 
+       trace_tcp_destroy_sock(sk);
+
        tcp_clear_xmit_timers(sk);
 
        tcp_cleanup_congestion_control(sk);