summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-05-22 21:25:39 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-05-22 21:25:39 +0000
commit68a92bc5daa488afbfa373c8e3a622c67786908f (patch)
tree0d6aeb9df8cee3c46493b0ba86366138e9ae144a /sys
parentf595f93b2e67707edf8622d4952f92e2189234d4 (diff)
In dt(4) add an offset of 100000 to the thread ID. This also happens
in other places where the TID is copied from kernel to userland. So in btrace(8) the filter and action tid variable has the same value as ps(1) output. OK anton@ mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/dt/dt_dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c
index 1e59e22431d..03f2658ecc9 100644
--- a/sys/dev/dt/dt_dev.c
+++ b/sys/dev/dt/dt_dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dt_dev.c,v 1.13 2021/04/23 07:21:02 bluhm Exp $ */
+/* $OpenBSD: dt_dev.c,v 1.14 2021/05/22 21:25:38 bluhm Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
@@ -565,7 +565,7 @@ dt_pcb_filter(struct dt_pcb *dp)
var = p->p_p->ps_pid;
break;
case DT_FV_TID:
- var = p->p_tid;
+ var = p->p_tid + THREAD_PID_OFFSET;
break;
case DT_FV_NONE:
break;
@@ -621,7 +621,7 @@ dt_pcb_ring_get(struct dt_pcb *dp, int profiling)
dtev->dtev_pbn = dp->dp_dtp->dtp_pbn;
dtev->dtev_cpu = cpu_number();
dtev->dtev_pid = p->p_p->ps_pid;
- dtev->dtev_tid = p->p_tid;
+ dtev->dtev_tid = p->p_tid + THREAD_PID_OFFSET;
nanotime(&dtev->dtev_tsp);
if (ISSET(dp->dp_evtflags, DTEVT_EXECNAME))