60 lines
2.0 KiB
Diff
60 lines
2.0 KiB
Diff
|
|
From dbc66bb16f86716b2d5b7e01e8f37cc20d99fd91 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?=E5=88=98=E5=A9=A720201110?=
|
||
|
|
<liujing_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Wed, 13 Nov 2024 20:23:03 +0800
|
||
|
|
Subject: [PATCH] linux-user: Add strace for clock_nanosleep()
|
||
|
|
|
||
|
|
Signed-off-by: Helge Deller <deller@gmx.de>
|
||
|
|
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
|
||
|
|
Message-Id: <20220918194555.83535-10-deller@gmx.de>
|
||
|
|
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
|
||
|
|
Signed-off-by: Liu Jing <liujing_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
linux-user/strace.c | 15 +++++++++++++++
|
||
|
|
linux-user/strace.list | 3 ++-
|
||
|
|
2 files changed, 17 insertions(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/linux-user/strace.c b/linux-user/strace.c
|
||
|
|
index 37d66d0dff..05d6b4524a 100644
|
||
|
|
--- a/linux-user/strace.c
|
||
|
|
+++ b/linux-user/strace.c
|
||
|
|
@@ -3491,6 +3491,21 @@ print_unshare(void *cpu_env, const struct syscallname *name,
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
+#ifdef TARGET_NR_clock_nanosleep
|
||
|
|
+static void
|
||
|
|
+print_clock_nanosleep(CPUArchState *cpu_env, 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_enums(clockids, arg0, 0);
|
||
|
|
+ print_raw_param("%d", arg1, 0);
|
||
|
|
+ print_timespec(arg2, 0);
|
||
|
|
+ print_timespec(arg3, 1);
|
||
|
|
+ print_syscall_epilogue(name);
|
||
|
|
+}
|
||
|
|
+#endif
|
||
|
|
+
|
||
|
|
#ifdef TARGET_NR_utime
|
||
|
|
static void
|
||
|
|
print_utime(void *cpu_env, const struct syscallname *name,
|
||
|
|
diff --git a/linux-user/strace.list b/linux-user/strace.list
|
||
|
|
index 544869f1ab..dc37dcf689 100644
|
||
|
|
--- a/linux-user/strace.list
|
||
|
|
+++ b/linux-user/strace.list
|
||
|
|
@@ -91,7 +91,8 @@
|
||
|
|
print_syscall_ret_clock_gettime },
|
||
|
|
#endif
|
||
|
|
#ifdef TARGET_NR_clock_nanosleep
|
||
|
|
-{ TARGET_NR_clock_nanosleep, "clock_nanosleep" , NULL, NULL, NULL },
|
||
|
|
+{ TARGET_NR_clock_nanosleep, "clock_nanosleep" , NULL, print_clock_nanosleep,
|
||
|
|
+ NULL },
|
||
|
|
#endif
|
||
|
|
#ifdef TARGET_NR_clock_settime
|
||
|
|
{ TARGET_NR_clock_settime, "clock_settime" , NULL, print_clock_settime, NULL },
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|