summaryrefslogtreecommitdiff
path: root/sys/kern/sched_bsd.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2023-08-14 08:33:25 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2023-08-14 08:33:25 +0000
commitbc945012e7a3c0775849f263dade77ee02523ca0 (patch)
tree5c5fa04115616bad9cd6b25b84d0345853d76e98 /sys/kern/sched_bsd.c
parent207363407d756ac533534dc590951be46f8a20e9 (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.c7
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;