]> granicus.if.org Git - strace/commitdiff
Remove UNDEFINED_SCNO
authorElvira Khabirova <lineprinter0@gmail.com>
Sun, 12 Jun 2016 16:11:43 +0000 (19:11 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 14 Jun 2016 16:26:20 +0000 (16:26 +0000)
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
syscall.c

diff --git a/defs.h b/defs.h
index f7a85cad5f20f0a1b42966cd35de017b22242e19..724d4f3c47fd3fb06dfa78a3a137d431fbfef232 100644 (file)
--- 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)
 
index e422d87ecf99e46d2d06be3665417060cf8ce588..01e4b31d577c869c4522a30ce681620337cc46de 100644 (file)
--- 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));
                /*
                 * " <unavailable>" 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);
        }