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/sched_bsd.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/sched_bsd.c')
-rw-r--r-- | sys/kern/sched_bsd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index 7ffdc2ed2a6..ae38ac60a34 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sched_bsd.c,v 1.80 2023/08/11 22:02:50 cheloha Exp $ */ +/* $OpenBSD: sched_bsd.c,v 1.81 2023/08/14 08:33:24 mpi Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -462,6 +462,7 @@ setrunnable(struct proc *p) atomic_setbits_int(&p->p_siglist, sigmask(pr->ps_xsig)); prio = p->p_usrpri; unsleep(p); + setrunqueue(NULL, p, prio); break; case SSLEEP: prio = p->p_slppri; @@ -470,9 +471,11 @@ setrunnable(struct proc *p) /* if not yet asleep, don't add to runqueue */ if (ISSET(p->p_flag, P_WSLEEP)) return; + setrunqueue(NULL, p, prio); + TRACEPOINT(sched, wakeup, p->p_tid + THREAD_PID_OFFSET, + p->p_p->ps_pid, CPU_INFO_UNIT(p->p_cpu)); break; } - setrunqueue(NULL, p, prio); if (p->p_slptime > 1) { uint32_t newcpu; |