From bc945012e7a3c0775849f263dade77ee02523ca0 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Mon, 14 Aug 2023 08:33:25 +0000 Subject: 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@ --- sys/kern/sched_bsd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/kern/sched_bsd.c') 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; -- cgit v1.2.3