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

Table Of Contents
18-92 Vol. 3
DEBUGGING AND PERFORMANCE MONITORING
Figure 18-35 shows the layout of an ESCR MSR. The functions of the flags and fields
are:
USR flag, bit 2 — When set, events are counted when the processor is operating
at a current privilege level (CPL) of 1, 2, or 3. These privilege levels are generally
used by application code and unprotected operating system code.
OS flag, bit 3 — When set, events are counted when the processor is operating
at CPL of 0. This privilege level is generally reserved for protected operating
system code. (When both the OS and USR flags are set, events are counted at all
privilege levels.)
Tag enable, bit 4 — When set, enables tagging of μops to assist in at-retirement
event counting; when clear, disables tagging. See Section 18.18.7, “At-
Retirement Counting.
Tag value field, bits 5 through 8 — Selects a tag value to associate with a μop
to assist in at-retirement event counting.
Event mask field, bits 9 through 24 — Selects events to be counted from the
event class selected with the event select field.
Event select field, bits 25 through 30) — Selects a class of events to be
counted. The events within this class that are counted are selected with the event
mask field.
When setting up an ESCR, the event select field is used to select a specific class of
events to count, such as retired branches. The event mask field is then used to select
one or more of the specific events within the class to be counted. For example, when
counting retired branches, four different events can be counted: branch not taken
predicted, branch not taken mispredicted, branch taken predicted, and branch taken
mispredicted. The OS and USR flags allow counts to be enabled for events that occur
Figure 18-35. Event Selection Control Register (ESCR) for Pentium 4
and Intel Xeon Processors without Intel HT Technology Support
31 24 8 0123492530
63
32
Reserved
Event Mask
Event
Select
USR
OS
5
Tag Enable
Tag
Value
Reserved