]> granicus.if.org Git - strace/commitdiff
syscall_entering_trace: set TCB_FILTERED along with TCB_HIDE_LOG
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 20 Nov 2018 04:56:30 +0000 (04:56 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 20 Nov 2018 04:56:30 +0000 (04:56 +0000)
This allows to remove some of hide_log() checks that became redundant.

* syscall.c (syscall_entering_trace): Set TCB_FILTERED along with
TCB_HIDE_LOG, remove now redundant hide_log(tcp) check.
(syscall_exiting_decode): Replace "filtered(tcp) || hide_log(tcp)"
with "filtered(tcp)".

syscall.c

index a038fa78c6e82792f8f0d523ecb93ed0a1bdf252..04b9939728b19c1c95fc05e802ac01ba9eaff41b 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -675,6 +675,9 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
                                 */
                                tcp->flags &= ~TCB_HIDE_LOG;
                                break;
+                       default:
+                               tcp->flags |= TCB_FILTERED;
+                               return 0;
                }
        }
 
@@ -685,10 +688,6 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
 
        tcp->flags &= ~TCB_FILTERED;
 
-       if (hide_log(tcp)) {
-               return 0;
-       }
-
        if (inject(tcp))
                tamper_with_syscall_entering(tcp, sig);
 
@@ -732,13 +731,13 @@ int
 syscall_exiting_decode(struct tcb *tcp, struct timespec *pts)
 {
        /* Measure the exit time as early as possible to avoid errors. */
-       if ((Tflag || cflag) && !(filtered(tcp) || hide_log(tcp)))
+       if ((Tflag || cflag) && !filtered(tcp))
                clock_gettime(CLOCK_MONOTONIC, pts);
 
        if (tcp->s_ent->sys_flags & MEMORY_MAPPING_CHANGE)
                mmap_notify_report(tcp);
 
-       if (filtered(tcp) || hide_log(tcp))
+       if (filtered(tcp))
                return 0;
 
 #if SUPPORTED_PERSONALITIES > 1