diff options
author | jeff <jeff@FreeBSD.org> | 2004-12-26 00:14:21 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2004-12-26 00:14:21 +0000 |
commit | c2b9649e7a5c5c98c9410fd042fa23535f1de417 (patch) | |
tree | cf06397cc391127e2bcab3538a083710f2a53658 /sys/kern | |
parent | 209356fff40b4a62f2be167c1f2d760fb67d1cba (diff) | |
download | FreeBSD-src-c2b9649e7a5c5c98c9410fd042fa23535f1de417.zip FreeBSD-src-c2b9649e7a5c5c98c9410fd042fa23535f1de417.tar.gz |
- Define KTR points for KTR_SCHED.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_clock.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_switch.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_synch.c | 17 |
3 files changed, 22 insertions, 0 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index ab2f129..4ac211d 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -418,6 +418,8 @@ statclock(frame) cp_time[CP_IDLE]++; } } + CTR4(KTR_SCHED, "statclock: %p(%s) prio %d stathz %d", + td, td->td_proc->p_comm, td->td_priority, (stathz)?stathz:hz); sched_clock(td); diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 3177f72..c59af8b 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -456,6 +456,9 @@ setrunqueue(struct thread *td, int flags) CTR3(KTR_RUNQ, "setrunqueue: td:%p kg:%p pid:%d", td, td->td_ksegrp, td->td_proc->p_pid); + CTR5(KTR_SCHED, "setrunqueue: %p(%s) prio %d by %p(%s)", + td, td->td_proc->p_comm, td->td_priority, curthread, + curthread->td_proc->p_comm); mtx_assert(&sched_lock, MA_OWNED); KASSERT((td->td_inhibitors == 0), ("setrunqueue: trying to run inhibitted thread")); 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); |