public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/4] Tweak self-armouring
@ 2024-10-04  4:43 eugene.loh
  2024-10-04  4:43 ` [PATCH 2/4] test: Increase timeout due to long shutdown eugene.loh
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: eugene.loh @ 2024-10-04  4:43 UTC (permalink / raw)
  To: dtrace, dtrace-devel

From: Eugene Loh <eugene.loh@oracle.com>

Commit ea592d60 ("proc: improve armouring against self-grabs") has no
tests, but it breaks test/unittest/usdt/tst.multitrace.sh.  The patch
makes the following change in libdtrace/dt_proc.c dt_proc_control():

        if ((Psystem_daemon(dpr->dpr_pid, dtp->dt_useruid,
                    dtp->dt_sysslice) > 0) ||
    -       ((tracer_pid != 0) &&
    -        (tracer_pid != getpid())) ||
    +       (tracer_pid == getpid()) ||
    -       (dpr->dpr_pid == getpid()))
    +       (tgid == getpid()))
                noninvasive = 2;

We change a
        (tracer_pid != getpid())
into a
        (tracer_pid == getpid())

Changing that == back into a != makes tst.multitrace.sh work again.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
 libdtrace/dt_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdtrace/dt_proc.c b/libdtrace/dt_proc.c
index a052abbac..7c3eb2a24 100644
--- a/libdtrace/dt_proc.c
+++ b/libdtrace/dt_proc.c
@@ -954,7 +954,7 @@ dt_proc_control(void *arg)
 
 			if ((Psystem_daemon(dpr->dpr_pid, dtp->dt_useruid,
 				    dtp->dt_sysslice) > 0) ||
-			    (tracer_pid == getpid()) ||
+			    (tracer_pid != getpid()) ||
 			    (tgid == getpid()))
 				noninvasive = 2;
 		}
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-09-15 17:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04  4:43 [PATCH 1/4] Tweak self-armouring eugene.loh
2024-10-04  4:43 ` [PATCH 2/4] test: Increase timeout due to long shutdown eugene.loh
2024-10-25 21:05   ` Kris Van Hees
2024-10-04  4:43 ` [PATCH 3/4] test: Do not return 1 for err.*.x checks eugene.loh
2024-10-25 21:09   ` Kris Van Hees
2024-10-04  4:43 ` [PATCH 4/4] test: Do not depend on ext4 eugene.loh
2024-10-25 21:16   ` Kris Van Hees
2024-10-30 20:14     ` Eugene Loh
2024-11-27 16:51       ` Kris Van Hees
2025-09-14 11:18       ` Nick Alcock
2025-09-15 17:39         ` [DTrace-devel] " Kris Van Hees
2024-10-25 21:02 ` [PATCH 1/4] Tweak self-armouring Kris Van Hees
2024-11-29 13:57   ` [DTrace-devel] " Nick Alcock
2024-12-03 11:46     ` Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox