From ed37c8d64b593ccf2767d59b0513c2f147fabb10 Mon Sep 17 00:00:00 2001 From: Elvira Khabirova Date: Sun, 12 Jun 2016 19:11:43 +0300 Subject: [PATCH] Remove UNDEFINED_SCNO Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID and since tcp->s_ent can only be set to &sysent[tcp->scno] (or to &unknown, but only when !SCNO_IS_VALID), there is no need to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno). * defs.h (UNDEFINED_SCNO): Remove. * syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting): Remove checks for UNDEFINED_SCNO. --- defs.h | 1 - syscall.c | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/defs.h b/defs.h index f7a85cad..724d4f3c 100644 --- a/defs.h +++ b/defs.h @@ -356,7 +356,6 @@ struct tcb { #define QUAL_READ 0x020 /* dump data read on this file descriptor */ #define QUAL_WRITE 0x040 /* dump data written to this file descriptor */ typedef uint8_t qualbits_t; -#define UNDEFINED_SCNO 0x100 /* Used only in tcp->qual_flg */ #define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE) diff --git a/syscall.c b/syscall.c index e422d87e..01e4b31d 100644 --- a/syscall.c +++ b/syscall.c @@ -770,10 +770,8 @@ trace_syscall_entering(struct tcb *tcp) printleader(tcp); if (scno_good != 1) tprints("????" /* anti-trigraph gap */ "("); - else if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("%s(", syscall_name(tcp->scno)); else - tprintf("%s(", tcp->s_ent->sys_name); + tprintf("%s(", syscall_name(tcp->scno)); /* * " " will be added later by the code which * detects ptrace errors. @@ -832,10 +830,7 @@ trace_syscall_entering(struct tcb *tcp) #endif printleader(tcp); - if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("%s(", syscall_name(tcp->scno)); - else - tprintf("%s(", tcp->s_ent->sys_name); + tprintf("%s(", syscall_name(tcp->scno)); if ((tcp->qual_flg & QUAL_RAW) && SEN_exit != tcp->s_ent->sen) res = printargs(tcp); else @@ -896,10 +891,7 @@ trace_syscall_exiting(struct tcb *tcp) if ((followfork < 2 && printing_tcp != tcp) || (tcp->flags & TCB_REPRINT)) { tcp->flags &= ~TCB_REPRINT; printleader(tcp); - if (tcp->qual_flg & UNDEFINED_SCNO) - tprintf("<... %s resumed> ", syscall_name(tcp->scno)); - else - tprintf("<... %s resumed> ", tcp->s_ent->sys_name); + tprintf("<... %s resumed> ", syscall_name(tcp->scno)); } printing_tcp = tcp; @@ -1291,7 +1283,7 @@ get_scno(struct tcb *tcp) .sys_name = "system call", }; tcp->s_ent = &unknown; - tcp->qual_flg = UNDEFINED_SCNO | QUAL_RAW | DEFAULT_QUAL_FLAGS; + tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS; if (debug_flag) error_msg("pid %d invalid syscall %ld", tcp->pid, tcp->scno); }