aboutsummaryrefslogtreecommitdiff
path: root/linux-user/strace.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2016-06-11 02:19:46 +0200
committerRiku Voipio <riku.voipio@linaro.org>2016-06-26 13:17:21 +0300
commit8997d1bd180ac268fe4bacfa5f0a38ed75809498 (patch)
tree77f8cabd5512b38aed82e784691d3f549c30b696 /linux-user/strace.c
parentfb3aabf3844cd3d6f2f49cc89288634ce1e48bd5 (diff)
downloadqemu-8997d1bd180ac268fe4bacfa5f0a38ed75809498.zip
qemu-8997d1bd180ac268fe4bacfa5f0a38ed75809498.tar.gz
qemu-8997d1bd180ac268fe4bacfa5f0a38ed75809498.tar.bz2
linux-user: add socket() strace
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/strace.c')
-rw-r--r--linux-user/strace.c23
1 files changed, 23 insertions, 0 deletions
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) \