FreeBSD/sys/i386/i386/perfmon.c
/*
 * Unfortunately, the performance-monitoring registers are laid out
 * differently in the P5 and P6.  We keep everything in P6 format
 * internally (except for the event code), and convert to P5
 * format as needed on those CPUs.  The writectl function pointer
 * is set up to point to one of these functions by perfmon_init().
 */
Unfortunately, the performance-monitoring registers are laid out
differently in the P5 and P6.  We keep everything in P6 format
internally (except for the event code), and convert to P5
format as needed on those CPUs.  The writectl function pointer
is set up to point to one of these functions by perfmon_init().
Unfortunately the performance - monitoring registers are laid out differently in the P5 and P6 . We keep everything in P6 format internally ( except for the event code ) and convert to P5 format as needed on those CPUs . The writectl function pointer is set up to point to one of these functions by perfmon_init () .
int
writectl6(int pmc)
{
	if (pmc > 0 && !(ctl_shadow[pmc] & (PMCF_EN << 16))) {
		wrmsr(msr_ctl[pmc], 0);
	} else {
		wrmsr(msr_ctl[pmc], ctl_shadow[pmc]);
	}
	return 0;
}
int writectl6 ( int pmc ) { if ( pmc > 0 && ! ( ctl_shadow [ pmc ] & ( PMCF_EN << 16 ) ) ) { wrmsr ( msr_ctl [ pmc ] , 0 ) ; } else { wrmsr ( msr_ctl [ pmc ] , ctl_shadow [ pmc ] ) ; } return 0 ; }
Unfortunately, the performance-monitoring registers are laid out
 differently in the P5 and P6.
Unfortunately the performance - monitoring registers are laid out differently in the P5 and P6 .