From: Paul Chaignon Date: Fri, 14 Jun 2019 17:34:57 +0000 (+0200) Subject: Use debug_msg macro where possible X-Git-Tag: v5.2~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8176d19c1fbc4f7664935afbf257116d2e2eab7b;p=strace Use debug_msg macro where possible * linux/alpha/get_scno.c (arch_get_scno): Use debug_msg instead of open-coding it. * linux/mips/get_scno.c: Likewise. * linux/sh/get_scno.c: Likewise. Signed-off-by: Paul Chaignon Signed-off-by: Dmitry V. Levin --- diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c index 2d5c6d6a..2b5e54f6 100644 --- a/linux/alpha/get_scno.c +++ b/linux/alpha/get_scno.c @@ -22,8 +22,7 @@ arch_get_scno(struct tcb *tcp) */ if (!scno_in_range(scno)) { if (alpha_a3 == 0 || alpha_a3 == -1UL) { - if (debug_flag) - error_msg("stray syscall exit: r0 = %lu", scno); + debug_msg("stray syscall exit: r0 = %lu", scno); return 0; } } diff --git a/linux/mips/get_scno.c b/linux/mips/get_scno.c index f06fae46..8c9de92f 100644 --- a/linux/mips/get_scno.c +++ b/linux/mips/get_scno.c @@ -13,9 +13,7 @@ arch_get_scno(struct tcb *tcp) if (!scno_in_range(tcp->scno)) { if (mips_REG_A3 == 0 || mips_REG_A3 == (uint64_t) -1) { - if (debug_flag) - error_msg("stray syscall exit: v0 = %ld", - tcp->scno); + debug_msg("stray syscall exit: v0 = %ld", tcp->scno); return 0; } } diff --git a/linux/sh/get_scno.c b/linux/sh/get_scno.c index b23824d5..2f979ae5 100644 --- a/linux/sh/get_scno.c +++ b/linux/sh/get_scno.c @@ -22,10 +22,9 @@ arch_get_scno(struct tcb *tcp) glibc to issue bogus negative syscall numbers. So for our purposes, make strace print what it *should* have been */ kernel_ulong_t correct_scno = (scno & 0xff); - if (debug_flag) - error_msg("Detected glibc bug: bogus system call" - " number = %ld, correcting to %ld", - scno, correct_scno); + debug_msg("Detected glibc bug: bogus system call number = %ld," + " correcting to %ld", + scno, correct_scno); scno = correct_scno; }