diff mbox series

[10/13] linux-user: Add strace for clock_nanosleep()

Message ID 20220826141853.419564-11-deller@gmx.de (mailing list archive)
State New, archived
Headers show
Series linux-user: Add more syscalls, enhance tracing & logging enhancements | expand

Commit Message

Helge Deller Aug. 26, 2022, 2:18 p.m. UTC
Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/strace.c    | 15 +++++++++++++++
 linux-user/strace.list |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)

--
2.37.1
diff mbox series

Patch

diff --git a/linux-user/strace.c b/linux-user/strace.c
index d1afa0e12a..bac47748bc 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -3566,6 +3566,21 @@  print_unshare(CPUArchState *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(CPUArchState *cpu_env, const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 7a69152db7..0463415902 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 },