qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/13] linux-user: Show timespec on strace for futex()


From: Richard Henderson
Subject: Re: [PATCH 11/13] linux-user: Show timespec on strace for futex()
Date: Sun, 28 Aug 2022 21:52:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 8/26/22 07:18, Helge Deller wrote:
Signed-off-by: Helge Deller <deller@gmx.de>
---
  linux-user/strace.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index bac47748bc..a90e719681 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -3713,11 +3713,19 @@ print_futex(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)
  {
+#ifdef FUTEX_CMD_MASK
+    abi_long op = arg1 & FUTEX_CMD_MASK;
+#else
+    abi_long op = arg1;
+#endif

FUTEX_CMD_MASK is defined in syscall_def.h, so never undefined.

+    if (op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET)
+        print_timespec(arg3, 0);
+    else
+        print_pointer(arg3, 0); /* struct timespec */

The else isn't quite correct -- the ops not listed, which actually use this parameter, treat it as uint32_t val2. Anyway, make this a switch, because I've implemented the other missing futex_ops, and several more treat use timespec.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]