-/* $OpenBSD: dt_prov_static.c,v 1.20 2023/07/06 19:46:53 kn Exp $ */
+/* $OpenBSD: dt_prov_static.c,v 1.21 2023/08/14 08:33:24 mpi Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
*/
DT_STATIC_PROBE2(sched, dequeue, "pid_t", "pid_t");
DT_STATIC_PROBE2(sched, enqueue, "pid_t", "pid_t");
+DT_STATIC_PROBE3(sched, fork, "pid_t", "pid_t", "int");
DT_STATIC_PROBE2(sched, off__cpu, "pid_t", "pid_t");
DT_STATIC_PROBE0(sched, on__cpu);
DT_STATIC_PROBE0(sched, remain__cpu);
DT_STATIC_PROBE0(sched, sleep);
-DT_STATIC_PROBE0(sched, wakeup);
+DT_STATIC_PROBE3(sched, steal, "pid_t", "pid_t", "int");
+DT_STATIC_PROBE2(sched, unsleep, "pid_t", "pid_t");
+DT_STATIC_PROBE3(sched, wakeup, "pid_t", "pid_t", "int");
/*
* Raw syscalls
/* Scheduler */
&_DT_STATIC_P(sched, dequeue),
&_DT_STATIC_P(sched, enqueue),
+ &_DT_STATIC_P(sched, fork),
&_DT_STATIC_P(sched, off__cpu),
&_DT_STATIC_P(sched, on__cpu),
&_DT_STATIC_P(sched, remain__cpu),
&_DT_STATIC_P(sched, sleep),
+ &_DT_STATIC_P(sched, steal),
+ &_DT_STATIC_P(sched, unsleep),
&_DT_STATIC_P(sched, wakeup),
/* Raw syscalls */
&_DT_STATIC_P(raw_syscalls, sys_enter),
-/* $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 $ */
/*
#include <sys/ptrace.h>
#include <sys/atomic.h>
#include <sys/unistd.h>
+#include <sys/tracepoint.h>
#include <sys/syscallargs.h>
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);
}
-/* $OpenBSD: kern_sched.c,v 1.85 2023/08/11 22:02:50 cheloha Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.86 2023/08/14 08:33:24 mpi Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
if (best == NULL)
return (NULL);
+ TRACEPOINT(sched, steal, best->p_tid + THREAD_PID_OFFSET,
+ best->p_p->ps_pid, CPU_INFO_UNIT(self));
+
remrunqueue(best);
best->p_cpu = self;
-/* $OpenBSD: kern_synch.c,v 1.196 2023/08/10 20:44:52 claudio Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.197 2023/08/14 08:33:24 mpi Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
if (p->p_wchan != NULL) {
TAILQ_REMOVE(&slpque[LOOKUP(p->p_wchan)], p, p_runq);
p->p_wchan = NULL;
- TRACEPOINT(sched, wakeup, p->p_tid + THREAD_PID_OFFSET,
+ TRACEPOINT(sched, unsleep, p->p_tid + THREAD_PID_OFFSET,
p->p_p->ps_pid);
}
}
-/* $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 $ */
/*-
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;
/* 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;