summaryrefslogtreecommitdiff
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2017-12-20 11:12:51 +0800
committerDavid S. Miller <davem@davemloft.net>2017-12-20 14:00:25 -0500
commit563e0bb0dc74b3ca888e24f8c08f0239fe4016b0 (patch)
treefcba71aa1af1eb252e0314782660e28986eb77f8 /include/net/inet_sock.h
parentd7b850a7dedf163fbfdb7aa20226d8aff2836338 (diff)
downloadlwn-563e0bb0dc74b3ca888e24f8c08f0239fe4016b0.tar.gz
lwn-563e0bb0dc74b3ca888e24f8c08f0239fe4016b0.zip
net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint
As sk_state is a common field for struct sock, so the state transition tracepoint should not be a TCP specific feature. Currently it traces all AF_INET state transition, so I rename this tracepoint to inet_sock_set_state tracepoint with some minor changes and move it into trace/events/sock.h. We dont need to create a file named trace/events/inet_sock.h for this one single tracepoint. Two helpers are introduced to trace sk_state transition - void inet_sk_state_store(struct sock *sk, int newstate); - void inet_sk_set_state(struct sock *sk, int state); As trace header should not be included in other header files, so they are defined in sock.c. The protocol such as SCTP maybe compiled as a ko, hence export inet_sk_set_state(). Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 39efb968b7a4..a3431a4ff9cc 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -290,6 +290,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
#endif
int inet_sk_rebuild_header(struct sock *sk);
+void inet_sk_set_state(struct sock *sk, int state);
+void inet_sk_state_store(struct sock *sk, int newstate);
static inline unsigned int __inet_ehashfn(const __be32 laddr,
const __u16 lport,