Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
Vol. 3 18-145
DEBUGGING AND PERFORMANCE MONITORING
USR (user mode) flag (bit 16)Specifies that events are counted only when
the processor is operating at privilege levels 1, 2 or 3. This flag can be used in
conjunction with the OS flag.
OS (operating system mode) flag (bit 17) — Specifies that events are
counted only when the processor is operating at privilege level 0. This flag can be
used in conjunction with the USR flag.
E (edge detect) flag (bit 18) — Enables (when set) edge detection of events.
The processor counts the number of deasserted to asserted transitions of any
condition that can be expressed by the other fields. The mechanism is limited in
that it does not permit back-to-back assertions to be distinguished. This
mechanism allows software to measure not only the fraction of time spent in a
particular state, but also the average length of time spent in such a state (for
example, the time spent waiting for an interrupt to be serviced).
PC (pin control) flag (bit 19) — When set, the processor toggles the PMi pins
and increments the counter when performance-monitoring events occur; when
clear, the processor toggles the PMi pins when the counter overflows. The
toggling of a pin is defined as assertion of the pin for a single bus clock followed
by deassertion.
INT (APIC interrupt enable) flag (bit 20) — When set, the processor
generates an exception through its local APIC on counter overflow.
EN (Enable Counters) Flag (bit 22) — This flag is only present in the
PerfEvtSel0 MSR. When set, performance counting is enabled in both
performance-monitoring counters; when clear, both counters are disabled.
INV (invert) flag (bit 23) — Inverts the result of the counter-mask comparison
when set, so that both greater than and less than comparisons can be made.
Figure 18-58. PerfEvtSel0 and PerfEvtSel1 MSRs
31
INV—Invert counter mask
EN—Enable counters
*
INT—APIC interrupt enable
PC—Pin control
8
7
0
Event Select
E—Edge detect
OS—Operating system mode
USR—User Mode
* Only available in PerfEvtSel0.
Counter Mask
E
E
N
I
N
T
19 1618 15172021222324
Reserved
I
N
V
P
C
U
S
R
O
S
Unit Mask (UMASK)
(CMASK)