diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index ac2219f90d5..319a3b8f241 100644 --- a/net/socket.c +++ b/net/socket.c @@ -98,6 +98,7 @@ #include <net/sock.h> #include <linux/netfilter.h> +#include <trace/socket.h> #include <linux/if_tun.h> #include <linux/ipv6_route.h> @@ -164,6 +165,11 @@ static const struct net_proto_family __rcu *net_families[NPROTO] __read_mostly; static DEFINE_PER_CPU(int, sockets_in_use); +DEFINE_TRACE(socket_sendmsg); +DEFINE_TRACE(socket_recvmsg); +DEFINE_TRACE(socket_create); +DEFINE_TRACE(socket_call); + /* * Support routines. * Move socket addresses back and forth across the kernel/user @@ -578,6 +584,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) ret = __sock_sendmsg(&iocb, sock, msg, size); if (-EIOCBQUEUED == ret) ret = wait_on_sync_kiocb(&iocb); + trace_socket_sendmsg(sock, msg, size, ret); return ret; } EXPORT_SYMBOL(sock_sendmsg); @@ -714,6 +721,7 @@ int sock_recvmsg(struct socket *sock, struct msghdr *msg, ret = __sock_recvmsg(&iocb, sock, msg, size, flags); if (-EIOCBQUEUED == ret) ret = wait_on_sync_kiocb(&iocb); + trace_socket_recvmsg(sock, msg, size, flags, ret); return ret; } EXPORT_SYMBOL(sock_recvmsg); @@ -1314,6 +1322,7 @@ SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) if (retval < 0) goto out_release; + trace_socket_create(sock, retval); out: /* It may be already another descriptor 8) Not kernel problem. */ return retval; @@ -2249,6 +2258,8 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) a0 = a[0]; a1 = a[1]; + trace_socket_call(call, a0); + switch (call) { case SYS_SOCKET: err = sys_socket(a0, a1, a[2]); |