archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <>
	Yafang Shao <>
Subject: [PATCH net-next] tcp: clean up STATE_TRACE
Date: Wed, 14 Nov 2018 22:26:17 +0800	[thread overview]
Message-ID: <> (raw)

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 <>
 include/net/tcp.h | 12 ------------
 net/ipv4/tcp.c    |  4 ----
 2 files changed, 16 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4743836..9d51a20 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1328,20 +1328,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);
-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"
 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)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 9e6bc4d..ca2b08c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2241,10 +2241,6 @@ void tcp_set_state(struct sock *sk, int state)
 	 * socket sitting in hash tables.
 	inet_sk_state_store(sk, state);
-	SOCK_DEBUG(sk, "TCP sk=%p, State %s -> %s\n", sk, statename[oldstate], statename[state]);

             reply	other threads:[~2018-11-14 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 14:26 Yafang Shao [this message]
2018-11-14 15:44 ` Eric Dumazet
2018-11-17  4:28 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH net-next] tcp: clean up STATE_TRACE' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox