From: Dmitry V. Levin Date: Sun, 18 Dec 2016 17:12:27 +0000 (+0000) Subject: Lowercase SCNO_IN_RANGE and SCNO_IS_VALID X-Git-Tag: v4.16~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae39bba3476641ace9257064a783c0b0d98876df;p=strace Lowercase SCNO_IN_RANGE and SCNO_IS_VALID * defs.h (SCNO_IN_RANGE): Rename to scno_in_range. All callers updated. (SCNO_IS_VALID): Rename to scno_is_valid. All callers updated. --- diff --git a/count.c b/count.c index d9d4b774..4b333bf3 100644 --- a/count.c +++ b/count.c @@ -53,14 +53,13 @@ count_syscall(struct tcb *tcp, const struct timeval *syscall_exiting_tv) struct timeval wtv; struct timeval *tv = &wtv; struct call_counts *cc; - unsigned long scno = tcp->scno; - if (!SCNO_IN_RANGE(scno)) + if (!scno_in_range(tcp->scno)) return; if (!counts) counts = xcalloc(nsyscalls, sizeof(*counts)); - cc = &counts[scno]; + cc = &counts[tcp->scno]; cc->calls++; if (syserror(tcp)) diff --git a/defs.h b/defs.h index 8cd4f9f6..83f09f94 100644 --- a/defs.h +++ b/defs.h @@ -879,7 +879,7 @@ extern struct fault_opts *fault_vec[SUPPORTED_PERSONALITIES]; /* Checks that sysent[scno] is not out of range. */ static inline bool -SCNO_IN_RANGE(unsigned long scno) +scno_in_range(unsigned long scno) { return scno < nsyscalls; } @@ -890,9 +890,9 @@ SCNO_IN_RANGE(unsigned long scno) * and its sysent[scno].sys_flags has no TRACE_INDIRECT_SUBCALL flag set. */ static inline bool -SCNO_IS_VALID(unsigned long scno) +scno_is_valid(unsigned long scno) { - return SCNO_IN_RANGE(scno) + return scno_in_range(scno) && sysent[scno].sys_func && !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL); } diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c index fc099216..65b9a77d 100644 --- a/linux/alpha/get_scno.c +++ b/linux/alpha/get_scno.c @@ -13,7 +13,7 @@ arch_get_scno(struct tcb *tcp) * Do some sanity checks to figure out if it's * really a syscall entry */ - if (!SCNO_IN_RANGE(scno)) { + if (!scno_in_range(scno)) { if (alpha_a3 == 0 || alpha_a3 == -1) { if (debug_flag) error_msg("stray syscall exit: r0 = %ld", scno); diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c index 23a167c8..4dced92a 100644 --- a/linux/arm/get_scno.c +++ b/linux/arm/get_scno.c @@ -72,7 +72,7 @@ arch_get_scno(struct tcb *tcp) * Do some sanity checks to figure out * whether it's really a syscall entry. */ - if (arm_regs.ARM_ip && !SCNO_IN_RANGE(scno)) { + if (arm_regs.ARM_ip && !scno_in_range(scno)) { if (debug_flag) error_msg("pid %d stray syscall exit:" " ARM_ip = %ld, scno = %ld", diff --git a/linux/mips/get_scno.c b/linux/mips/get_scno.c index f9b5e7d7..9364f817 100644 --- a/linux/mips/get_scno.c +++ b/linux/mips/get_scno.c @@ -4,7 +4,7 @@ arch_get_scno(struct tcb *tcp) { tcp->scno = mips_REG_V0; - if (!SCNO_IN_RANGE(tcp->scno)) { + 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", diff --git a/syscall.c b/syscall.c index d76c4a16..2b30f58c 100644 --- a/syscall.c +++ b/syscall.c @@ -407,7 +407,7 @@ decode_ipc_subcall(struct tcb *tcp) static void decode_mips_subcall(struct tcb *tcp) { - if (!SCNO_IS_VALID(tcp->u_arg[0])) + if (!scno_is_valid(tcp->u_arg[0])) return; tcp->scno = tcp->u_arg[0]; tcp->qual_flg = qual_flags(tcp->scno); @@ -553,7 +553,7 @@ struct fault_opts *fault_vec[SUPPORTED_PERSONALITIES]; static struct fault_opts * tcb_fault_opts(struct tcb *tcp) { - return (SCNO_IN_RANGE(tcp->scno) && tcp->fault_vec[current_personality]) + return (scno_in_range(tcp->scno) && tcp->fault_vec[current_personality]) ? &tcp->fault_vec[current_personality][tcp->scno] : NULL; } @@ -1213,7 +1213,7 @@ get_scno(struct tcb *tcp) if (rc != 1) return rc; - if (SCNO_IS_VALID(tcp->scno)) { + if (scno_is_valid(tcp->scno)) { tcp->s_ent = &sysent[tcp->scno]; tcp->qual_flg = qual_flags(tcp->scno); } else { @@ -1278,5 +1278,5 @@ syscall_name(long scno) if (current_personality == X32_PERSONALITY_NUMBER) scno &= ~__X32_SYSCALL_BIT; #endif - return SCNO_IS_VALID(scno) ? sysent[scno].sys_name: NULL; + return scno_is_valid(scno) ? sysent[scno].sys_name: NULL; }