Index | Thread | Search

From:
Christian Ludwig <christian_ludwig@genua.de>
Subject:
dt: Trace tracing program
To:
<tech@openbsd.org>
Date:
Fri, 2 Feb 2024 16:24:49 +0100

Download raw body.

Thread
For the sake of visibility, also trace the tracing program itself.
If you really wanted to hide it, add a filter to your probes, like:

| BEGIN {
|   @tracer = pid;
| }
|
| profile:hz:100 / pid != @tracer /
| {
|   @[kstack] = count();
| }
---
 sys/dev/dt/dt_dev.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c
index 12c5390cdbb..71e90a71d2b 100644
--- a/sys/dev/dt/dt_dev.c
+++ b/sys/dev/dt/dt_dev.c
@@ -702,10 +702,6 @@ dt_pcb_filter(struct dt_pcb *dp)
 	unsigned int var = 0;
 	int match = 1;
 
-	/* Filter out tracing program. */
-	if (dp->dp_sc->ds_pid == p->p_p->ps_pid)
-		return 1;
-
 	switch (dtf->dtf_variable) {
 	case DT_FV_PID:
 		var = p->p_p->ps_pid;
-- 
2.34.1