Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 14:45:40 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r316842 - stable/11/sys/kern
Message-ID:  <201704141445.v3EEjeN4074857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Apr 14 14:45:39 2017
New Revision: 316842
URL: https://svnweb.freebsd.org/changeset/base/316842

Log:
  MFC r315960: dtrace sched:::preempt should fire only when there is preemption

Modified:
  stable/11/sys/kern/kern_synch.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_synch.c
==============================================================================
--- stable/11/sys/kern/kern_synch.c	Fri Apr 14 14:44:06 2017	(r316841)
+++ stable/11/sys/kern/kern_synch.c	Fri Apr 14 14:45:39 2017	(r316842)
@@ -430,7 +430,11 @@ mi_switch(int flags, struct thread *newt
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704141445.v3EEjeN4074857>