diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2023-08-14 08:33:25 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2023-08-14 08:33:25 +0000 |
commit | bc945012e7a3c0775849f263dade77ee02523ca0 (patch) | |
tree | 5c5fa04115616bad9cd6b25b84d0345853d76e98 /sys/kern/kern_fork.c | |
parent | 207363407d756ac533534dc590951be46f8a20e9 (diff) |
Extend scheduler tracepoints to follow CPU jumping.
- Add two new tracpoints sched:fork & sched:steal
- Include selected CPU number in sched:wakeup
- Add sched:unsleep corresponding to sched:sleep which matches add/removal
of threads on the sleep queue
ok claudio@
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 97c9c4b7c5c..8d1f245935a 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.248 2023/07/02 11:16:03 deraadt Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.249 2023/08/14 08:33:24 mpi Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -56,6 +56,7 @@ #include <sys/ptrace.h> #include <sys/atomic.h> #include <sys/unistd.h> +#include <sys/tracepoint.h> #include <sys/syscallargs.h> @@ -316,6 +317,8 @@ fork_thread_start(struct proc *p, struct proc *parent, int flags) SCHED_LOCK(s); ci = sched_choosecpu_fork(parent, flags); + TRACEPOINT(sched, fork, p->p_tid + THREAD_PID_OFFSET, + p->p_p->ps_pid, CPU_INFO_UNIT(ci)); setrunqueue(ci, p, p->p_usrpri); SCHED_UNLOCK(s); } |