tcp: clean up STATE_TRACE
authorYafang Shao <laoar.shao@gmail.com>
Wed, 14 Nov 2018 14:26:17 +0000 (22:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Nov 2018 04:28:00 +0000 (20:28 -0800)
Currently we can use bpf or tcp tracepoint to conveniently trace the tcp
state transition at the run time.
So we don't need to do this stuff at the compile time anymore.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp.c

index b84b694..63e37dd 100644 (file)
@@ -1323,20 +1323,8 @@ static inline bool tcp_checksum_complete(struct sk_buff *skb)
 
 bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb);
 int tcp_filter(struct sock *sk, struct sk_buff *skb);
-
-#undef STATE_TRACE
-
-#ifdef STATE_TRACE
-static const char *statename[]={
-       "Unused","Established","Syn Sent","Syn Recv",
-       "Fin Wait 1","Fin Wait 2","Time Wait", "Close",
-       "Close Wait","Last ACK","Listen","Closing"
-};
-#endif
 void tcp_set_state(struct sock *sk, int state);
-
 void tcp_done(struct sock *sk);
-
 int tcp_abort(struct sock *sk, int err);
 
 static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
index 9e6bc4d..ca2b08c 100644 (file)
@@ -2241,10 +2241,6 @@ void tcp_set_state(struct sock *sk, int state)
         * socket sitting in hash tables.
         */
        inet_sk_state_store(sk, state);
-
-#ifdef STATE_TRACE
-       SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n", sk, statename[oldstate], statename[state]);
-#endif
 }
 EXPORT_SYMBOL_GPL(tcp_set_state);