FreeBSD/sys/dev/hwpmc/hwpmc_mod.c
/*
 * move execution over the specified cpu and bind it there.
 */
move execution over the specified cpu and bind it there.
move execution over the specified cpu and bind it there .
static void
pmc_select_cpu(int cpu)
{
	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
	    ("[pmc,%d] bad cpu number %d", __LINE__, cpu));
	KASSERT(pmc_cpu_is_active(cpu), ("[pmc,%d] selecting inactive "
	    "CPU %d", __LINE__, cpu));
	PMCDBG1(CPU,SEL,2, "select-cpu cpu=%d", cpu);
	thread_lock(curthread);
	sched_bind(curthread, cpu);
	thread_unlock(curthread);
	KASSERT(curthread->td_oncpu == cpu,
	    ("[pmc,%d] CPU not bound [cpu=%d, curr=%d]", __LINE__,
		cpu, curthread->td_oncpu));
	PMCDBG1(CPU,SEL,2, "select-cpu cpu=%d ok", cpu);
}
static void pmc_select_cpu ( int cpu ) { KASSERT ( cpu >= 0 && cpu < pmc_cpu_max ( ) , ( " " , __LINE__ , cpu ) ) ; KASSERT ( pmc_cpu_is_active ( cpu ) , ( " " " " , __LINE__ , cpu ) ) ; PMCDBG1 ( CPU , SEL , 2 , " " , cpu ) ; thread_lock ( curthread ) ; sched_bind ( curthread , cpu ) ; thread_unlock ( curthread ) ; KASSERT ( curthread -> td_oncpu == cpu , ( " " , __LINE__ , cpu , curthread -> td_oncpu ) ) ; PMCDBG1 ( CPU , SEL , 2 , " " , cpu ) ; }
move execution over the specified cpu and bind it there.
move execution over the specified cpu and bind it there .
/* Never move to an inactive CPU. */