src/sys/kern/kern_pmc.c
/*
 * A note on the CPU numbering scheme used by the hwpmc(4) driver.
 *
 * CPUs are denoted using numbers in the range 0..[pmc_cpu_max()-1].
 * CPUs could be numbered "sparsely" in this range; the predicate
 * `pmc_cpu_is_present()' is used to test whether a given CPU is
 * physically present.
 *
 * Further, a CPU that is physically present may be administratively
 * disabled or otherwise unavailable for use by hwpmc(4).  The
 * `pmc_cpu_is_active()' predicate tests for CPU usability.  An
 * "active" CPU participates in thread scheduling and can field
 * interrupts raised by PMC hardware.
 *
 * On systems with hyperthreaded CPUs, multiple logical CPUs may share
 * PMC hardware resources.  For such processors one logical CPU is
 * denoted as the primary owner of the in-CPU PMC resources. The
 * pmc_cpu_is_primary() predicate is used to distinguish this primary
 * CPU from the others.
 */
A note on the CPU numbering scheme used by the hwpmc(4) driver.
CPUs are denoted using numbers in the range 0..[pmc_cpu_max()-1].
CPUs could be numbered "sparsely" in this range; the predicate
`pmc_cpu_is_present()' is used to test whether a given CPU is
physically present.

Further, a CPU that is physically present may be administratively
disabled or otherwise unavailable for use by hwpmc(4).  The
`pmc_cpu_is_active()' predicate tests for CPU usability.  An
"active" CPU participates in thread scheduling and can field
interrupts raised by PMC hardware.

On systems with hyperthreaded CPUs, multiple logical CPUs may share
PMC hardware resources.  For such processors one logical CPU is
denoted as the primary owner of the in-CPU PMC resources. The
pmc_cpu_is_primary() predicate is used to distinguish this primary
CPU from the others.
A note on the CPU numbering scheme used by the hwpmc ( 4 ) driver . CPUs are denoted using numbers in the range 0 .. [ pmc_cpu_max () - 1 ] . CPUs could be numbered " sparsely " in this range ; the predicate ` pmc_cpu_is_present () ' is used to test whether a given CPU is physically present . Further a CPU that is physically present may be administratively disabled or otherwise unavailable for use by hwpmc ( 4 ) . The ` pmc_cpu_is_active () ' predicate tests for CPU usability . An " active " CPU participates in thread scheduling and can field interrupts raised by PMC hardware . On systems with hyperthreaded CPUs multiple logical CPUs may share PMC hardware resources . For such processors one logical CPU is denoted as the primary owner of the in - CPU PMC resources . The pmc_cpu_is_primary () predicate is used to distinguish this primary CPU from the others .
int
pmc_cpu_is_active(int cpu)
{
#ifdef	SMP
	return (pmc_cpu_is_present(cpu) &&
	    !CPU_ISSET(cpu, &hlt_cpus_mask));
#else
	return (1);
#endif
}
int pmc_cpu_is_active ( int cpu ) { #ifdef SMP return ( pmc_cpu_is_present ( cpu ) && ! CPU_ISSET ( cpu , & hlt_cpus_mask ) ) ; #else return ( 1 ) ; #endif }
A note on the CPU numbering scheme used by the hwpmc(4) driver.
A note on the CPU numbering scheme used by the hwpmc ( 4 ) driver .