From 110da33afff6551122c90af35b2c697377e13bb5 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Tue, 30 Aug 2016 00:01:45 +0300 Subject: [PATCH] futex: avoid printing val when it is not used by the futex command This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET command. * futex.c (SYS_FUNC(futex)): Remove common printing of val argument. Add printing of val argument for all futex commands except FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. --- futex.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/futex.c b/futex.c index 1418c89b..9410b2a6 100644 --- a/futex.c +++ b/futex.c @@ -59,32 +59,40 @@ SYS_FUNC(futex) printaddr(uaddr); tprints(", "); printxval(futexops, op, "FUTEX_???"); - tprintf(", %u", val); switch (cmd) { case FUTEX_WAIT: + tprintf(", %u", val); + tprints(", "); + print_timespec(tcp, timeout); + break; case FUTEX_LOCK_PI: tprints(", "); print_timespec(tcp, timeout); break; case FUTEX_WAIT_BITSET: + tprintf(", %u", val); tprints(", "); print_timespec(tcp, timeout); tprintf(", %#x", val3); break; case FUTEX_WAKE_BITSET: + tprintf(", %u", val); tprintf(", %#x", val3); break; case FUTEX_REQUEUE: + tprintf(", %u", val); tprintf(", %u, ", val2); printaddr(uaddr2); break; case FUTEX_CMP_REQUEUE: case FUTEX_CMP_REQUEUE_PI: + tprintf(", %u", val); tprintf(", %u, ", val2); printaddr(uaddr2); tprintf(", %u", val3); break; case FUTEX_WAKE_OP: + tprintf(", %u", val); tprintf(", %u, ", val2); printaddr(uaddr2); tprints(", {"); @@ -96,6 +104,7 @@ SYS_FUNC(futex) tprintf(", %u}", val3 & 0xfff); break; case FUTEX_WAIT_REQUEUE_PI: + tprintf(", %u", val); tprints(", "); print_timespec(tcp, timeout); tprints(", "); @@ -103,10 +112,13 @@ SYS_FUNC(futex) break; case FUTEX_FD: case FUTEX_WAKE: + tprintf(", %u", val); + break; case FUTEX_UNLOCK_PI: case FUTEX_TRYLOCK_PI: break; default: + tprintf(", %u", val); tprintf(", %#lx", timeout); tprints(", "); printaddr(uaddr2);