diff options
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index b6968bf..bd28c1d 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -340,7 +340,24 @@ mi_switch(int flags, struct thread *newtd) (void *)td, td->td_sched, (long)p->p_pid, p->p_comm); if ((flags & SW_VOL) && (td->td_proc->p_flag & P_SA)) newtd = thread_switchout(td, flags, newtd); +#if (KTR_COMPILE & KTR_SCHED) != 0 + if (td == PCPU_GET(idlethread)) + CTR3(KTR_SCHED, "mi_switch: %p(%s) prio %d idle", + td, td->td_proc->p_comm, td->td_priority); + else if (newtd != NULL) + CTR5(KTR_SCHED, + "mi_switch: %p(%s) prio %d preempted by %p(%s)", + td, td->td_proc->p_comm, td->td_priority, newtd, + newtd->td_proc->p_comm); + else + CTR6(KTR_SCHED, + "mi_switch: %p(%s) prio %d inhibit %d wmesg %s lock %s", + td, td->td_proc->p_comm, td->td_priority, + td->td_inhibitors, td->td_wmesg, td->td_lockname); +#endif sched_switch(td, newtd, flags); + CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d", + td, td->td_proc->p_comm, td->td_priority); CTR4(KTR_PROC, "mi_switch: new thread %p (kse %p, pid %ld, %s)", (void *)td, td->td_sched, (long)p->p_pid, p->p_comm); |