Process mode PMC bug

0 views
Skip to first unread message

Fabien THOMAS

unread,
Oct 13, 2009, 12:18:58 PM10/13/09
to PMCTools Discuss

Joseph Koshy

unread,
Oct 13, 2009, 9:46:26 PM10/13/09
to pmctools...@googlegroups.com

hwpmc(4)'s idea of thread state is going out of sync with that of the
kernel. This is very likely related to bugs [20] and [21].

Koshy

Fabien Thomas

unread,
Oct 14, 2009, 2:38:47 AM10/14/09
to pmctools...@googlegroups.com
>
>
> hwpmc(4)'s idea of thread state is going out of sync with that of the
> kernel. This is very likely related to bugs [20] and [21].
>


yes, my current trace in sched_ule show two "switch in" in the
following code:
attached the ktr output (sorry for the bitmap :))

i will try to spend more time on this.
regards,
fabien

if (td != newtd) {
#ifdef HWPMC_HOOKS
CTR1(KTR_SPARE2, "ULE SWO %p", td);
if (PMC_PROC_IS_USING_PMCS(td->td_proc))
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
#endif
lock_profile_release_lock(&TDQ_LOCKPTR(tdq)-
>lock_object);
TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd;

#ifdef KDTRACE_HOOKS
/*
* 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, mtx);
/*
* We may return from cpu_switch on a different cpu.
However,
* we always return with td_lock pointing to the
current cpu's
* run queue lock.
*/
cpuid = PCPU_GET(cpuid);
tdq = TDQ_CPU(cpuid);
lock_profile_obtain_lock_success(
&TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__,
__LINE__);
#ifdef HWPMC_HOOKS
CTR1(KTR_SPARE2, "ULE SWI %p", td);
if (PMC_PROC_IS_USING_PMCS(td->td_proc))
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN);
#endif
} else
thread_unblock_switch(td, mtx);

ktr sched.png
Reply all
Reply to author
Forward
0 new messages