Skip to content

Commit

Permalink
In dt(4) add an offset of 100000 to the thread ID. This also happens
Browse files Browse the repository at this point in the history
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@
  • Loading branch information
bluhm committed May 22, 2021
1 parent 973a685 commit 21e9226
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/dev/dt/dt_dev.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 21e9226

Please sign in to comment.