[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/12] linux-user/strace: Improve gettimeofday()
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 04/12] linux-user/strace: Improve gettimeofday() and settimeofday() output |
Date: |
Thu, 28 Jun 2018 00:46:44 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Tested-By: Guido Günther <address@hidden>
---
linux-user/strace.c | 13 +++++++++++++
linux-user/strace.list | 4 ++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index b43a21f48b..955fe80ef2 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1499,6 +1499,19 @@ print_futimesat(const struct syscallname *name,
}
#endif
+#if defined(TARGET_NR_gettimeofday) || defined(TARGET_NR_settimeofday)
+static void
+print_timeofday(const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_timeval(arg0, 0);
+ print_timezone(arg1, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
#ifdef TARGET_NR_link
static void
print_link(const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index afe4db07f3..9b477b7730 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -384,7 +384,7 @@
{ TARGET_NR_gettid, "gettid" , "%s()", NULL, NULL },
#endif
#ifdef TARGET_NR_gettimeofday
-{ TARGET_NR_gettimeofday, "gettimeofday" , NULL, NULL, NULL },
+{ TARGET_NR_gettimeofday, "gettimeofday" , NULL, print_timeofday, NULL },
#endif
#ifdef TARGET_NR_getuid
{ TARGET_NR_getuid, "getuid" , "%s()", NULL, NULL },
@@ -1345,7 +1345,7 @@
{ TARGET_NR_set_tid_address, "set_tid_address" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_settimeofday
-{ TARGET_NR_settimeofday, "settimeofday" , NULL, NULL, NULL },
+{ TARGET_NR_settimeofday, "settimeofday" , NULL, print_timeofday, NULL },
#endif
#ifdef TARGET_NR_setuid
{ TARGET_NR_setuid, "setuid" , NULL, NULL, NULL },
--
2.18.0
- [Qemu-devel] [PATCH v2 00/12] linux-user: strace improvements, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 01/12] linux-user/syscall: Verify recvfrom(addr) is user-writable, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 02/12] linux-user/strace: Improve capget()/capset() output, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 04/12] linux-user/strace: Improve gettimeofday() and settimeofday() output,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v2 05/12] linux-user/strace: Dump AF_NETLINK sockaddr content, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 06/12] linux-user/strace: Improve recvmsg() output, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 09/12] linux-user/strace: Let print_sockaddr() have a 'last' argument, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [RFC PATCH v2 10/12] linux-user/strace: Add print_sockaddr_ptr() to handle plain/pointer addrlen, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 12/12] linux-user/strace: Improve recvfrom() output, Philippe Mathieu-Daudé, 2018/06/27
- [Qemu-devel] [PATCH v2 11/12] linux-user/strace: Improve getsockname() output, Philippe Mathieu-Daudé, 2018/06/27