提交 d992e267 编写于 作者: Z zhang-mingyi66

net, bpf: Add a writeable_tracepoint to inet_stream_connect

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

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

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: Nzhang-mingyi66 <zhangmingyi5@huawei.com>
上级 3624fa5a
......@@ -332,6 +332,21 @@ DEFINE_EVENT(sock_msg_length, sock_recv_length,
TP_ARGS(sk, ret, flags)
);
#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 */
......
......@@ -728,6 +728,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.
先完成此消息的编辑!
想要评论请 注册