From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNnz-0000qe-M4 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNnx-0003QH-P4 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:42 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:36696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNnx-0003Q8-HS for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:41 -0400 Received: by mail-lf0-x22a.google.com with SMTP id q132so112560119lfe.3 for ; Fri, 24 Jun 2016 02:53:41 -0700 (PDT) From: riku.voipio@linaro.org Date: Fri, 24 Jun 2016 12:53:08 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PULL 13/24] linux-user: add socket() strace List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/strace.c | 23 +++++++++++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index c8df76f..95f4338 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1227,6 +1227,29 @@ print__llseek(const struct syscallname *name, } #endif +#if defined(TARGET_NR_socket) +static void +print_socket(const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + abi_ulong domain = arg0, type = arg1, protocol = arg2; + + print_syscall_prologue(name); + print_socket_domain(domain); + gemu_log(","); + print_socket_type(type); + gemu_log(","); + if (domain == AF_PACKET || + (domain == AF_INET && type == TARGET_SOCK_PACKET)) { + protocol = tswap16(protocol); + } + print_socket_protocol(domain, type, protocol); + print_syscall_epilogue(name); +} + +#endif + #if defined(TARGET_NR_socketcall) #define get_user_ualx(x, gaddr, idx) \ diff --git a/linux-user/strace.list b/linux-user/strace.list index b379497..7c54dc6 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1291,7 +1291,7 @@ { TARGET_NR_sigsuspend, "sigsuspend" , NULL, NULL, NULL }, #endif #ifdef TARGET_NR_socket -{ TARGET_NR_socket, "socket" , NULL, NULL, NULL }, +{ TARGET_NR_socket, "socket" , NULL, print_socket, NULL }, #endif #ifdef TARGET_NR_socketcall { TARGET_NR_socketcall, "socketcall" , NULL, print_socketcall, NULL }, -- 2.1.4