PERFORCE change 99658 for review

John Birrell jb at FreeBSD.org
Tue Jun 20 06:02:28 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=99658

Change 99658 by jb at jb_freebsd2 on 2006/06/20 06:02:19

	Choose a better place for the DTrace vtime hook. The new thread can
	be chosen all sorts of ways right up to the last moment.

Affected files ...

.. //depot/projects/dtrace/src/sys/kern/kern_synch.c#6 edit
.. //depot/projects/dtrace/src/sys/kern/sched_4bsd.c#6 edit
.. //depot/projects/dtrace/src/sys/kern/sched_ule.c#4 edit

Differences ...

==== //depot/projects/dtrace/src/sys/kern/kern_synch.c#6 (text+ko) ====

@@ -429,16 +429,6 @@
 		    td->td_inhibitors, td->td_wmesg, td->td_lockname);
 #endif
 
-#ifdef KDTRACE
-	/*
-	 * If DTrace has set the active vtime enum to anything
-	 * other than INACTIVE (0), then it should have set the
-	 * function to call.
-	 */
-	if (dtrace_vtime_active)
-		(*dtrace_vtime_switch_func)(newtd);
-#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);

==== //depot/projects/dtrace/src/sys/kern/sched_4bsd.c#6 (text+ko) ====

@@ -970,6 +970,17 @@
 		if (PMC_PROC_IS_USING_PMCS(td->td_proc))
 			PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
 #endif
+
+#ifdef KDTRACE
+		/*
+		 * If DTrace has set the active vtime enum to anything
+		 * other than INACTIVE (0), then it should have set the
+		 * function to call.
+		 */
+		if (dtrace_vtime_active)
+			(*dtrace_vtime_switch_func)(newtd);
+#endif
+
 		cpu_switch(td, newtd);
 #ifdef	HWPMC_HOOKS
 		if (PMC_PROC_IS_USING_PMCS(td->td_proc))

==== //depot/projects/dtrace/src/sys/kern/sched_ule.c#4 (text+ko) ====

@@ -1414,6 +1414,17 @@
 		if (PMC_PROC_IS_USING_PMCS(td->td_proc))
 			PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
 #endif
+
+#ifdef KDTRACE
+		/*
+		 * If DTrace has set the active vtime enum to anything
+		 * other than INACTIVE (0), then it should have set the
+		 * function to call.
+		 */
+		if (dtrace_vtime_active)
+			(*dtrace_vtime_switch_func)(newtd);
+#endif
+
 		cpu_switch(td, newtd);
 #ifdef	HWPMC_HOOKS
 		if (PMC_PROC_IS_USING_PMCS(td->td_proc))


More information about the p4-projects mailing list