Date: Tue, 20 Jun 2006 06:02:27 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 99658 for review Message-ID: <200606200602.k5K62Rf7072967@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99658 Change 99658 by jb@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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606200602.k5K62Rf7072967>