Add THREAD_PID_OFFSET to tracepoint arguments that pass a TID to userland.
authormpi <mpi@openbsd.org>
Thu, 9 Sep 2021 18:41:39 +0000 (18:41 +0000)
committermpi <mpi@openbsd.org>
Thu, 9 Sep 2021 18:41:39 +0000 (18:41 +0000)
commit9fde647a9e9455485604c5bf303940f9dfe358a4
treec210b141df5fa3934fbe76717531537a1bd4c937
parent4666bcdec8985ab906c32a0152fe20c2b5a9a7eb
Add THREAD_PID_OFFSET to tracepoint arguments that pass a TID to userland.

Bring these values in sync with the `tid' builtin which already include
the offset.  This is necessary to build script comparing them, like:

tracepoint:sched:enqueue
{
@ts[arg0] = nsecs;
}

tracepoint:sched:on__cpu
/@ts[tid]/
{
latency = nsecs - @ts[tid];
}

Discussed with and ok bluhm@
sys/kern/kern_sched.c
sys/kern/kern_synch.c
sys/kern/sched_bsd.c