From b7844f8b4a0590fb0e37d2d7fea3043c23f49a23 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 21 Jul 2016 11:47:20 +0000 Subject: [PATCH] Do not print too many arguments of socketcall syscall * socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args" syscall arguments. * tests/socketcall.c (test_socketcall): Update expected output. * tests/socketcall.test: Likewise. --- socketcall.c | 5 ++--- tests/socketcall.c | 19 +++++-------------- tests/socketcall.test | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/socketcall.c b/socketcall.c index 3f188213..9f48a104 100644 --- a/socketcall.c +++ b/socketcall.c @@ -38,9 +38,8 @@ SYS_FUNC(socketcall) else tprintf("%d", call); - unsigned int i; - for (i = 1; i < MAX_ARGS; ++i) - tprintf(", %#lx", tcp->u_arg[i]); + tprints(", "); + printaddr(tcp->u_arg[1]); return RVAL_DECODED; } diff --git a/tests/socketcall.c b/tests/socketcall.c index ad1803be..5ccddc47 100644 --- a/tests/socketcall.c +++ b/tests/socketcall.c @@ -54,28 +54,19 @@ static void *efault; static void test_socketcall(const int i, const void *const addr) { - static const unsigned long a[] = { - (unsigned long) 0xface2fedbadc2ded, - (unsigned long) 0xface3fedbadc3ded, - (unsigned long) 0xface4fedbadc4ded, - (unsigned long) 0xface5fedbadc5ded - }; const unsigned long call = (unsigned long) 0xfacefeed00000000 | (unsigned int) i; - long rc = syscall(__NR_socketcall, call, addr, - a[0], a[1], a[2], a[3]); + long rc = syscall(__NR_socketcall, call, addr); if (i < sc_min || i > sc_max) { - printf("socketcall(%d, %p, %#lx, %#lx, %#lx, %#lx)" - " = %ld %s (%m)\n", (int) call, addr, - a[0], a[1], a[2], a[3], rc, errno2name()); + printf("socketcall(%d, %p) = %ld %s (%m)\n", + (int) call, addr, rc, errno2name()); } else if (addr == efault) { const char *const str = xlookup_uint(socketcalls, i); assert(str); - printf("socketcall(%s, %p, %#lx, %#lx, %#lx, %#lx)" - " = %ld %s (%m)\n", str, addr, a[0], a[1], a[2], a[3], - rc, errno2name()); + printf("socketcall(%s, %p) = %ld %s (%m)\n", + str, addr, rc, errno2name()); } } int diff --git a/tests/socketcall.test b/tests/socketcall.test index b12ac02e..959bc83d 100755 --- a/tests/socketcall.test +++ b/tests/socketcall.test @@ -3,4 +3,4 @@ # Check decoding of socketcall syscall. . "${srcdir=.}/init.sh" -run_strace_match_diff +run_strace_match_diff -a20 -- 2.40.0