提交 aca06275 编写于 作者: B bitcoffee

net, bpf: Add a writeable_tracepoint to inet_stream_connect

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I71USM

--------------------------------------------------

A trace point is added to the connection process. Theebpf program
can be mounted to modify the return value of the function. This is
mandatory for delaying the establishment of an ebpf link. After
the connection is complete, a message is returned immediately and
no unnecessary operation is performed.
Signed-off-by: Nbitcoffee <liuxin350@huawei.com>
上级 d8fcd2f3
......@@ -203,6 +203,20 @@ TRACE_EVENT(inet_sock_set_state,
show_tcp_state_name(__entry->newstate))
);
#undef NET_DECLARE_TRACE
#ifdef DECLARE_TRACE_WRITABLE
#define NET_DECLARE_TRACE(call, proto, args, size) \
DECLARE_TRACE_WRITABLE(call, PARAMS(proto), PARAMS(args), size)
#else
#define NET_DECLARE_TRACE(call, proto, args, size) \
DECLARE_TRACE(call, PARAMS(proto), PARAMS(args))
#endif
NET_DECLARE_TRACE(connect_ret,
TP_PROTO(int *err),
TP_ARGS(err),
sizeof(int));
#endif /* _TRACE_SOCK_H */
/* This part must be outside protection */
......
......@@ -729,6 +729,7 @@ int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
lock_sock(sock->sk);
err = __inet_stream_connect(sock, uaddr, addr_len, flags, 0);
release_sock(sock->sk);
trace_connect_ret(&err);
return err;
}
EXPORT_SYMBOL(inet_stream_connect);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册