dtrace sched:::preempt should fire only when there is preemption

The probe fire on any thread switch before.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	Panzura
This commit is contained in:
Andriy Gapon 2017-03-25 19:08:51 +00:00
parent a7b4c009e1
commit 20c69e76b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315960

View File

@ -430,7 +430,11 @@ mi_switch(int flags, struct thread *newtd)
PCPU_SET(switchticks, ticks);
CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)",
td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name);
SDT_PROBE0(sched, , , preempt);
#ifdef KDTRACE_HOOKS
if ((flags & SW_PREEMPT) != 0 || ((flags & SW_INVOL) != 0 &&
(flags & SW_TYPE_MASK) == SWT_NEEDRESCHED))
SDT_PROBE0(sched, , , preempt);
#endif
sched_switch(td, newtd, flags);
CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)",
td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name);