summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2017-10-23 09:20:27 -0700
committerDavid S. Miller <davem@davemloft.net>2017-10-24 01:21:25 +0100
commite8fce23946b7e7eadf25ad78d8207c22903dfe27 (patch)
tree16bd01b92a17441fc0e9cdcabc5501a49d689dd2 /net/ipv4/tcp.c
parente1a4aa50f47303ebb3ca0cfd01687884551ce03d (diff)
tcp: add tracepoint trace_tcp_set_state()
This patch adds tracepoint trace_tcp_set_state. Besides usual fields (s/d ports, IP addresses), old and new state of the socket is also printed with TP_printk, with __print_symbolic(). Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8b1fa4dd4538..be07e9b6dbdd 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -282,6 +282,8 @@
#include <asm/ioctls.h>
#include <net/busy_poll.h>
+#include <trace/events/tcp.h>
+
int sysctl_tcp_min_tso_segs __read_mostly = 2;
int sysctl_tcp_autocorking __read_mostly = 1;
@@ -2040,6 +2042,8 @@ void tcp_set_state(struct sock *sk, int state)
{
int oldstate = sk->sk_state;
+ trace_tcp_set_state(sk, oldstate, state);
+
switch (state) {
case TCP_ESTABLISHED:
if (oldstate != TCP_ESTABLISHED)