From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBWep-000318-F0 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 20:20:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBWei-0007DC-4w for qemu-devel@nongnu.org; Fri, 10 Jun 2016 20:20:10 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBWeh-0007Co-R4 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 20:20:04 -0400 From: Laurent Vivier Date: Sat, 11 Jun 2016 02:19:46 +0200 Message-Id: <1465604388-24666-3-git-send-email-laurent@vivier.eu> In-Reply-To: <1465604388-24666-1-git-send-email-laurent@vivier.eu> References: <1465604388-24666-1-git-send-email-laurent@vivier.eu> Subject: [Qemu-devel] [PATCH v2 2/4] linux-user: add socket() strace List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org, Laurent Vivier Signed-off-by: Laurent Vivier --- 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 46391c8..5a9df46 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1221,6 +1221,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.5.5