- Define KTR points for KTR_SCHED.

This commit is contained in:
Jeff Roberson 2004-12-26 00:14:21 +00:00
parent 49407925c5
commit 85da7a569b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=139315
3 changed files with 22 additions and 0 deletions

View File

@ -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);

View File

@ -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"));

View File

@ -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);