]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libpmc/pmc.3
This commit was generated by cvs2svn to compensate for changes in r177580,
[FreeBSD/FreeBSD.git] / lib / libpmc / pmc.3
1 .\" Copyright (c) 2003-2008 Joseph Koshy.  All rights reserved.
2 .\"
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
5 .\" are met:
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\"    notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\"    notice, this list of conditions and the following disclaimer in the
10 .\"    documentation and/or other materials provided with the distribution.
11 .\"
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed.  in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
22 .\" such damage.
23 .\"
24 .\" $FreeBSD$
25 .\"
26 .Dd March 14, 2008
27 .Os
28 .Dt PMC 3
29 .Sh NAME
30 .Nm pmc
31 .Nd library for accessing hardware performance monitoring counters
32 .Sh LIBRARY
33 .Lb libpmc
34 .Sh SYNOPSIS
35 .In pmc.h
36 .Sh DESCRIPTION
37 The
38 .Lb libpmc
39 provides a programming interface that allows applications to use
40 hardware performance counters to gather performance data about
41 specific processes or for the system as a whole.
42 The library is implemented using the lower-level facilities offered by
43 the
44 .Xr hwpmc 4
45 driver.
46 .Ss Key Concepts
47 Performance monitoring counters (PMCs) are represented by the library
48 using a software abstraction.
49 These
50 .Dq abstract
51 PMCs can have one two scopes:
52 .Bl -bullet
53 .It
54 System scope.
55 These PMCs measure events in a whole-system manner, i.e., independent
56 of the currently executing thread.
57 System scope PMCs are allocated on specific CPUs and do not
58 migrate between CPUs.
59 Non-privileged process are allowed to allocate system scope PMCs if the
60 .Xr hwpmc 4
61 sysctl tunable:
62 .Va security.bsd.unprivileged_syspmcs
63 is non-zero.
64 .It
65 Process scope.
66 These PMCs only measure hardware events when the processes they are
67 attached to are executing on a CPU.
68 In an SMP system, process scope PMCs migrate between CPUs along with
69 their target processes.
70 .El
71 .Pp
72 Orthogonal to PMC scope, PMCs may be allocated in one of two
73 operational modes:
74 .Bl -bullet
75 .It
76 Counting PMCs measure events according to their scope
77 (system or process).
78 The application needs to explicitly read these counters
79 to retrieve their value.
80 .It
81 Sampling PMCs cause the CPU to be periodically interrupted
82 and information about its state of execution to be collected.
83 Sampling PMCs are used to profile specific processes and kernel
84 threads or to profile the system as a whole.
85 .El
86 .Pp
87 The scope and operational mode for a software PMC are specified at
88 PMC allocation time.
89 An application is allowed to allocate multiple PMCs subject
90 to availability of hardware resources.
91 .Pp
92 The library uses human-readable strings to name the event being
93 measured by hardware.
94 The syntax used for specifying a hardware event along with additional
95 event specific qualifiers (if any) is described in detail in section
96 .Sx "EVENT SPECIFIERS"
97 below.
98 .Pp
99 PMCs are associated with the process that allocated them and
100 will be automatically reclaimed by the system when the process exits.
101 Additionally, process-scope PMCs have to be attached to one or more
102 target processes before they can perform measurements.
103 A process-scope PMC may be attached to those target processes
104 that its owner process would otherwise be permitted to debug.
105 An owner process may attach PMCs to itself allowing
106 it to measure its own behavior.
107 Additionally, on some machine architectures, such self-attached PMCs
108 may be read cheaply using specialized instructions supported by the
109 processor.
110 .Pp
111 Certain kinds of PMCs require that a log file be configured before
112 they may be started.
113 These include:
114 .Bl -bullet -compact
115 .It
116 System scope sampling PMCs.
117 .It
118 Process scope sampling PMCs.
119 .It
120 Process scope counting PMCs that have been configured to report PMC
121 readings on process context switches or process exits.
122 .El
123 Upto one log file may be configured per owner process.
124 Events logged to a log file may be subsequently analyzed using the
125 .Xr pmclog 3
126 family of functions.
127 .Ss Supported CPUs
128 The CPUs known to the PMC library are named by the
129 .Vt "enum pmc_cputype"
130 enumeration.
131 Supported CPUs include:
132 .Bl -tag -width PMC_CPU_INTEL_PIII -compact
133 .It PMC_CPU_AMD_K7
134 .Tn "AMD Athlon"
135 CPUs.
136 .It PMC_CPU_AMD_K8
137 .Tn "AMD Athlon64"
138 CPUs.
139 .It PMC_CPU_INTEL_P5
140 .Tn Intel
141 .Tn "Pentium"
142 CPUs.
143 .It PMC_CPU_INTEL_P6
144 .Tn Intel
145 .Tn "Pentium Pro"
146 CPUs.
147 .It PMC_CPU_INTEL_PII
148 .Tn "Intel Pentium II"
149 CPUs.
150 .It PMC_CPU_INTEL_PIII
151 .Tn "Intel Pentium III"
152 CPUs.
153 .It PMC_CPU_INTEL_PM
154 .Tn "Intel Pentium M"
155 CPUs.
156 .It PMC_CPU_INTEL_PIV
157 .Tn "Intel Pentium 4"
158 CPUs.
159 .El
160 .Ss Supported PMCs
161 PMC supported by this library are named by the
162 .Vt enum pmc_class
163 enumeration.
164 Supported PMC kinds include:
165 .Bl -tag -width PMC_CLASS_TSC -compact
166 .It PMC_CLASS_TSC
167 The timestamp counter on i386 and amd64 architecture CPUs.
168 .It PMC_CLASS_K7
169 Programmable hardware counters present in
170 .Tn "AMD Athlon"
171 CPUs.
172 .It PMC_CLASS_K8
173 Programmable hardware counters present in
174 .Tn "AMD Athlon64"
175 CPUs.
176 .It PMC_CLASS_P5
177 Programmable hardware counters present in
178 .Tn Intel
179 .Tn Pentium
180 CPUs.
181 .It PMC_CLASS_P6
182 Programmable hardware counters present in
183 .Tn Intel
184 .Tn "Pentium Pro" ,
185 .Tn "Pentium II" ,
186 .Tn "Pentium III" ,
187 .Tn "Celeron" ,
188 and
189 .Tn "Pentium M"
190 CPUs.
191 .It PMC_CLASS_P4
192 Programmable hardware counters present in
193 .Tn "Intel Pentium 4"
194 CPUs.
195 .El
196 .Ss PMC Capabilities
197 .Pp
198 Capabilities of performance monitoring hardware are denoted using
199 the
200 .Vt "enum pmc_caps"
201 enumeration.
202 Supported capabilities include:
203 .Bl -tag -width "PMC_CAP_INTERRUPT" -compact
204 .It PMC_CAP_EDGE
205 The ability to count negated to asserted transitions of the hardware
206 conditions being probed for.
207 .It PMC_CAP_INTERRUPT
208 The ability to interrupt the CPU.
209 .It PMC_CAP_INVERT
210 The ability to invert the sense of the hardware conditions being
211 measured.
212 .It PMC_CAP_READ
213 PMC hardware allows the CPU to read performance counters.
214 .It PMC_CAP_QUALIFIER
215 The hardware allows monitored to be further qualified in some
216 system dependent way.
217 .It PMC_CAP_SYSTEM
218 The ability to restrict counting of hardware events to when the CPU is
219 running privileged code.
220 .It PMC_CAP_THRESHOLD
221 The ability to ignore simultaneous hardware events below a
222 programmable threshold.
223 .It PMC_CAP_USER
224 The ability to restrict counting of hardware events to those when the
225 CPU is running unprivileged code.
226 .It PMC_CAP_WRITE
227 PMC hardware allows CPUs write to counters.
228 .El
229 .Ss Functional Grouping
230 This section contains a brief overview of the available functionality
231 in the PMC library.
232 Each function listed here is described further in its own manual page.
233 .Bl -tag -width indent
234 .It Administration
235 .Bl -tag -compact
236 .It Fn pmc_disable , Fn pmc_enable
237 Administratively disable (enable) specific performance monitoring
238 counter hardware.
239 Counters that are disabled will not be available to applications to
240 use.
241 .El
242 .It "Convenience Functions"
243 .Bl -tag -compact
244 .It Fn pmc_event_names_of_class
245 Returns a list of event names supported by a given PMC type.
246 .It Fn pmc_name_of_capability
247 Convert a
248 .Dv PMC_CAP_*
249 flag to a human-readable string.
250 .It Fn pmc_name_of_class
251 Convert a
252 .Dv PMC_CLASS_*
253 constant to a human-readable string.
254 .It Fn pmc_name_of_cputype
255 Return a human-readable name for a CPU type.
256 .It Fn pmc_name_of_disposition
257 Return a human-readable string describing a PMC's disposition.
258 .It Fn pmc_name_of_event
259 Convert a numeric event code to a human-readable string.
260 .It Fn pmc_name_of_mode
261 Convert a
262 .Dv PMC_MODE_*
263 constant to a human-readable name.
264 .It Fn pmc_name_of_state
265 Return a human-readable string describing a PMC's current state.
266 .El
267 .It "Library Initialization"
268 .Bl -tag -compact
269 .It Fn pmc_init
270 Initialize the library.
271 This function must be called before any other library function.
272 .El
273 .It "Log File Handling"
274 .Bl -tag -compact
275 .It Fn pmc_configure_logfile
276 Configure a log file for
277 .Xr hwpmc 4
278 to write logged events to.
279 .It Fn pmc_flush_logfile
280 Flush all pending log data in
281 .Xr hwpmc 4 Ns Ap s
282 buffers.
283 .It Fn pmc_writelog
284 Append arbitrary user data to the current log file.
285 .El
286 .It "PMC Management"
287 .Bl -tag -compact
288 .It Fn pmc_allocate , Fn pmc_release
289 Allocate (free) a PMC.
290 .It Fn pmc_attach , Fn pmc_detach
291 Attach (detach) a process scope PMC to a target.
292 .It Fn pmc_read , Fn pmc_write , Fn pmc_rw
293 Read (write) a value from (to) a PMC.
294 .It Fn pmc_start , Fn pmc_stop
295 Start (stop) a software PMC.
296 .It Fn pmc_set
297 Set the reload value for a sampling PMC.
298 .El
299 .It "Queries"
300 .Bl -tag -compact
301 .It Fn pmc_capabilities
302 Retrieve the capabilities for a given PMC.
303 .It Fn pmc_cpuinfo
304 Retrieve information about the CPUs and PMC hardware present in the
305 system.
306 .It Fn pmc_get_driver_stats
307 Retrieve statistics maintained by
308 .Xr hwpmc 4 .
309 .It Fn pmc_ncpu
310 Determine the number of CPUs in the system.
311 .It Fn pmc_npmc
312 Return the number of hardware PMCs present in a given CPU.
313 .It Fn pmc_pmcinfo
314 Return information about the state of a given CPU's PMCs.
315 .It Fn pmc_width
316 Determine the width of a hardware counter in bits.
317 .El
318 .It "x86 Architecture Specific API"
319 .Bl -tag -compact
320 .It Fn pmc_get_msr
321 Returns the processor model specific register number
322 associated with
323 .Fa pmc .
324 Applications may then use the x86
325 .Ic RDPMC
326 instruction to directly read the contents of the PMC.
327 .El
328 .El
329 .Ss Signal Handling Requirements
330 Applications using PMCs are required to handle the following signals:
331 .Bl -tag -width ".Dv SIGBUS"
332 .It Dv SIGBUS
333 When the
334 .Xr hwpmc 4
335 module is unloaded using
336 .Xr kldunload 8 ,
337 processes that have PMCs allocated to them will be sent a
338 .Dv SIGBUS
339 signal.
340 .It Dv SIGIO
341 The
342 .Xr hwpmc 4
343 driver will send a PMC owning process a
344 .Dv SIGIO
345 signal if:
346 .Bl -bullet
347 .It
348 If any process-mode PMC allocated by it loses all its
349 target processes.
350 .It
351 If the driver encounters an error when writing log data to a
352 configured log file.
353 This error may be retrieved by a subsequent call to
354 .Fn pmc_flush_logfile .
355 .El
356 .El
357 .Ss Typical Program Flow
358 .Bl -enum
359 .It
360 An application would first invoke function
361 .Fn pmc_init
362 to allow the library to initialize itself.
363 .It
364 Signal handling would then be set up.
365 .It
366 Next the application would allocate the PMCs it desires using function
367 .Fn pmc_allocate .
368 .It
369 Initial values for PMCs may be set using function
370 .Fn pmc_set .
371 .It
372 If a log file is necessary for the PMCs to work, it would
373 be configured using function
374 .Fn pmc_configure_logfile .
375 .It
376 Process scope PMCs would then be attached to their target processes
377 using function
378 .Fn pmc_attach .
379 .It
380 The PMCs would then be started using function
381 .Fn pmc_start .
382 .It
383 Once started, the values of counting PMCs may be read using function
384 .Fn pmc_start .
385 For PMCs that write events to the log file, this logged data would be
386 read and parsed using the
387 .Xr pmclog 3
388 family of functions.
389 .It
390 PMCs are stopped using function
391 .Fn pmc_stop ,
392 and process scope PMCs are detached from their targets using
393 function
394 .Fn pmc_detach .
395 .It
396 Before the process exits, its may release its PMCs using function
397 .Fn pmc_release .
398 Any configured log file may be closed using function
399 .Fn pmc_configure_logfile .
400 .El
401 .Sh EVENT SPECIFIERS
402 Event specifiers are strings comprising of an event name, followed by
403 optional parameters modifying the semantics of the hardware event
404 being probed.
405 Event names are PMC architecture dependent, but the PMC library defines
406 machine independent aliases for commonly used events.
407 .Ss Event Name Aliases
408 Event name aliases are CPU architecture independent names for commonly
409 used events.
410 The following aliases are known to this version of the
411 .Nm pmc
412 library:
413 .Bl -tag -width indent
414 .It Li branches
415 Measure the number of branches retired.
416 .It Li branch-mispredicts
417 Measure the number of retired branches that were mispredicted.
418 .It Li cycles
419 Measure processor cycles.
420 This event is implemented using the processor's Time Stamp Counter
421 register.
422 .It Li dc-misses
423 Measure the number of data cache misses.
424 .It Li ic-misses
425 Measure the number of instruction cache misses.
426 .It Li instructions
427 Measure the number of instructions retired.
428 .It Li interrupts
429 Measure the number of interrupts seen.
430 .It Li unhalted-cycles
431 Measure the number of cycles the processor is not in a halted
432 or sleep state.
433 .El
434 .Ss Time Stamp Counter (TSC)
435 The timestamp counter is a monotonically non-decreasing counter that
436 counts processor cycles.
437 .Pp
438 In the i386 architecture, this counter may
439 be selected by requesting an event with event specifier
440 .Dq Li tsc .
441 The
442 .Dq Li tsc
443 event does not support any further qualifiers.
444 It can only be allocated in system-wide counting mode,
445 and is a read-only counter.
446 Multiple processes are allowed to allocate the TSC.
447 Once allocated, it may be read using the
448 .Fn pmc_read
449 function, or by using the RDTSC instruction.
450 .Ss AMD (K7) PMCs
451 These PMCs are present in the
452 .Tn "AMD Athlon"
453 series of CPUs and are documented in:
454 .Rs
455 .%B "AMD Athlon Processor x86 Code Optimization Guide"
456 .%N "Publication No. 22007"
457 .%D "February 2002"
458 .%Q "Advanced Micro Devices, Inc."
459 .Re
460 .Pp
461 Event specifiers for AMD K7 PMCs can have the following optional
462 qualifiers:
463 .Bl -tag -width indent
464 .It Li count= Ns Ar value
465 Configure the counter to increment only if the number of configured
466 events measured in a cycle is greater than or equal to
467 .Ar value .
468 .It Li edge
469 Configure the counter to only count negated-to-asserted transitions
470 of the conditions expressed by the other qualifiers.
471 In other words, the counter will increment only once whenever a given
472 condition becomes true, irrespective of the number of clocks during
473 which the condition remains true.
474 .It Li inv
475 Invert the sense of comparision when the
476 .Dq Li count
477 qualifier is present, making the counter to increment when the
478 number of events per cycle is less than the value specified by
479 the
480 .Dq Li count
481 qualifier.
482 .It Li os
483 Configure the PMC to count events happening at privilege level 0.
484 .It Li unitmask= Ns Ar mask
485 This qualifier is used to further qualify a select few events,
486 .Dq Li k7-dc-refills-from-l2 ,
487 .Dq Li k7-dc-refills-from-system
488 and
489 .Dq Li k7-dc-writebacks .
490 Here
491 .Ar mask
492 is a string of the following characters optionally separated by
493 .Ql +
494 characters:
495 .Pp
496 .Bl -tag -width indent -compact
497 .It Li m
498 Count operations for lines in the
499 .Dq Modified
500 state.
501 .It Li o
502 Count operations for lines in the
503 .Dq Owner
504 state.
505 .It Li e
506 Count operations for lines in the
507 .Dq Exclusive
508 state.
509 .It Li s
510 Count operations for lines in the
511 .Dq Shared
512 state.
513 .It Li i
514 Count operations for lines in the
515 .Dq Invalid
516 state.
517 .El
518 .Pp
519 If no
520 .Dq Li unitmask
521 qualifier is specified, the default is to count events for caches
522 lines in any of the above states.
523 .It Li usr
524 Configure the PMC to count events occurring at privilege levels 1, 2
525 or 3.
526 .El
527 .Pp
528 If neither of the
529 .Dq Li os
530 or
531 .Dq Li usr
532 qualifiers were specified, the default is to enable both.
533 .Pp
534 The event specifiers supported on AMD K7 PMCs are:
535 .Bl -tag -width indent
536 .It Li k7-dc-accesses
537 Count data cache accesses.
538 .It Li k7-dc-misses
539 Count data cache misses.
540 .It Li k7-dc-refills-from-l2 Op Li ,unitmask= Ns Ar mask
541 Count data cache refills from L2 cache.
542 This event may be further qualified using the
543 .Dq Li unitmask
544 qualifier.
545 .It Li k7-dc-refills-from-system Op Li ,unitmask= Ns Ar mask
546 Count data cache refills from system memory.
547 This event may be further qualified using the
548 .Dq Li unitmask
549 qualifier.
550 .It Li k7-dc-writebacks Op Li ,unitmask= Ns Ar mask
551 Count data cache writebacks.
552 This event may be further qualified using the
553 .Dq Li unitmask
554 qualifier.
555 .It Li k7-l1-dtlb-miss-and-l2-dtlb-hits
556 Count L1 DTLB misses and L2 DTLB hits.
557 .It Li k7-l1-and-l2-dtlb-misses
558 Count L1 and L2 DTLB misses.
559 .It Li k7-misaligned-references
560 Count misaligned data references.
561 .It Li k7-ic-fetches
562 Count instruction cache fetches.
563 .It Li k7-ic-misses
564 Count instruction cache misses.
565 .It Li k7-l1-itlb-misses
566 Count L1 ITLB misses that are L2 ITLB hits.
567 .It Li k7-l1-l2-itlb-misses
568 Count L1 (and L2) ITLB misses.
569 .It Li k7-retired-instructions
570 Count all retired instructions.
571 .It Li k7-retired-ops
572 Count retired ops.
573 .It Li k7-retired-branches
574 Count all retired branches (conditional, unconditional, exceptions
575 and interrupts).
576 .It Li k7-retired-branches-mispredicted
577 Count all misprediced retired branches.
578 .It Li k7-retired-taken-branches
579 Count retired taken branches.
580 .It Li k7-retired-taken-branches-mispredicted
581 Count mispredicted taken branches that were retired.
582 .It Li k7-retired-far-control-transfers
583 Count retired far control transfers.
584 .It Li k7-retired-resync-branches
585 Count retired resync branches (non control transfer branches).
586 .It Li k7-interrupts-masked-cycles
587 Count the number of cycles when the processor's
588 .Va IF
589 flag was zero.
590 .It Li k7-interrupts-masked-while-pending-cycles
591 Count the number of cycles interrupts were masked while pending due
592 to the processor's
593 .Va IF
594 flag being zero.
595 .It Li k7-hardware-interrupts
596 Count the number of taken hardware interrupts.
597 .El
598 .Ss AMD (K8) PMCs
599 These PMCs are present in the
600 .Tn "AMD Athlon64"
601 and
602 .Tn "AMD Opteron"
603 series of CPUs.
604 They are documented in:
605 .Rs
606 .%B "BIOS and Kernel Developer's Guide for the AMD Athlon(tm) 64 and AMD Opteron Processors"
607 .%N "Publication No. 26094"
608 .%D "April 2004"
609 .%Q "Advanced Micro Devices, Inc."
610 .Re
611 .Pp
612 Event specifiers for AMD K8 PMCs can have the following optional
613 qualifiers:
614 .Bl -tag -width indent
615 .It Li count= Ns Ar value
616 Configure the counter to increment only if the number of configured
617 events measured in a cycle is greater than or equal to
618 .Ar value .
619 .It Li edge
620 Configure the counter to only count negated-to-asserted transitions
621 of the conditions expressed by the other fields.
622 In other words, the counter will increment only once whenever a given
623 condition becomes true, irrespective of the number of clocks during
624 which the condition remains true.
625 .It Li inv
626 Invert the sense of comparision when the
627 .Dq Li count
628 qualifier is present, making the counter to increment when the
629 number of events per cycle is less than the value specified by
630 the
631 .Dq Li count
632 qualifier.
633 .It Li mask= Ns Ar qualifier
634 Many event specifiers for AMD K8 PMCs need to be additionally
635 qualified using a mask qualifier.
636 These additional qualifiers are event-specific and are documented
637 along with their associated event specifiers below.
638 .It Li os
639 Configure the PMC to count events happening at privilege level 0.
640 .It Li usr
641 Configure the PMC to count events occurring at privilege levels 1, 2
642 or 3.
643 .El
644 .Pp
645 If neither of the
646 .Dq Li os
647 or
648 .Dq Li usr
649 qualifiers were specified, the default is to enable both.
650 .Pp
651 The event specifiers supported on AMD K8 PMCs are:
652 .Bl -tag -width indent
653 .It Li k8-bu-cpu-clk-unhalted
654 Count the number of clock cycles when the CPU is not in the HLT or
655 STPCLK states.
656 .It Li k8-bu-fill-request-l2-miss Op Li ,mask= Ns Ar qualifier
657 Count fill requests that missed in the L2 cache.
658 This event may be further qualified using
659 .Ar qualifier ,
660 which is a
661 .Ql +
662 separated set of the following keywords:
663 .Pp
664 .Bl -tag -width indent -compact
665 .It Li dc-fill
666 Count data cache fill requests.
667 .It Li ic-fill
668 Count instruction cache fill requests.
669 .It Li tlb-reload
670 Count TLB reloads.
671 .El
672 .Pp
673 The default is to count all types of requests.
674 .It Li k8-bu-internal-l2-request Op Li ,mask= Ns Ar qualifier
675 Count internally generated requests to the L2 cache.
676 This event may be further qualified using
677 .Ar qualifier ,
678 which is a
679 .Ql +
680 separated set of the following keywords:
681 .Pp
682 .Bl -tag -width indent -compact
683 .It Li cancelled
684 Count cancelled requests.
685 .It Li dc-fill
686 Count data cache fill requests.
687 .It Li ic-fill
688 Count instruction cache fill requests.
689 .It Li tag-snoop
690 Count tag snoop requests.
691 .It Li tlb-reload
692 Count TLB reloads.
693 .El
694 .Pp
695 The default is to count all types of requests.
696 .It Li k8-dc-access
697 Count data cache accesses including microcode scratchpad accesses.
698 .It Li k8-dc-copyback Op Li ,mask= Ns Ar qualifier
699 Count data cache copyback operations.
700 This event may be further qualified using
701 .Ar qualifier ,
702 which is a
703 .Ql +
704 separated set of the following keywords:
705 .Pp
706 .Bl -tag -width indent -compact
707 .It Li exclusive
708 Count operations for lines in the
709 .Dq exclusive
710 state.
711 .It Li invalid
712 Count operations for lines in the
713 .Dq invalid
714 state.
715 .It Li modified
716 Count operations for lines in the
717 .Dq modified
718 state.
719 .It Li owner
720 Count operations for lines in the
721 .Dq owner
722 state.
723 .It Li shared
724 Count operations for lines in the
725 .Dq shared
726 state.
727 .El
728 .Pp
729 The default is to count operations for lines in all the
730 above states.
731 .It Li k8-dc-dcache-accesses-by-locks Op Li ,mask= Ns Ar qualifier
732 Count data cache accesses by lock instructions.
733 This event is only available on processors of revision C or later
734 vintage.
735 This event may be further qualified using
736 .Ar qualifier ,
737 which is a
738 .Ql +
739 separated set of the following keywords:
740 .Pp
741 .Bl -tag -width indent -compact
742 .It Li accesses
743 Count data cache accesses by lock instructions.
744 .It Li misses
745 Count data cache misses by lock instructions.
746 .El
747 .Pp
748 The default is to count all accesses.
749 .It Li k8-dc-dispatched-prefetch-instructions Op Li ,mask= Ns Ar qualifier
750 Count the number of dispatched prefetch instructions.
751 This event may be further qualified using
752 .Ar qualifier ,
753 which is a
754 .Ql +
755 separated set of the following keywords:
756 .Pp
757 .Bl -tag -width indent -compact
758 .It Li load
759 Count load operations.
760 .It Li nta
761 Count non-temporal operations.
762 .It Li store
763 Count store operations.
764 .El
765 .Pp
766 The default is to count all operations.
767 .It Li k8-dc-l1-dtlb-miss-and-l2-dtlb-hit
768 Count L1 DTLB misses that are L2 DTLB hits.
769 .It Li k8-dc-l1-dtlb-miss-and-l2-dtlb-miss
770 Count L1 DTLB misses that are also misses in the L2 DTLB.
771 .It Li k8-dc-microarchitectural-early-cancel-of-an-access
772 Count microarchitectural early cancels of data cache accesses.
773 .It Li k8-dc-microarchitectural-late-cancel-of-an-access
774 Count microarchitectural late cancels of data cache accesses.
775 .It Li k8-dc-misaligned-data-reference
776 Count misaligned data references.
777 .It Li k8-dc-miss
778 Count data cache misses.
779 .It Li k8-dc-one-bit-ecc-error Op Li ,mask= Ns Ar qualifier
780 Count one bit ECC errors found by the scrubber.
781 This event may be further qualified using
782 .Ar qualifier ,
783 which is a
784 .Ql +
785 separated set of the following keywords:
786 .Pp
787 .Bl -tag -width indent -compact
788 .It Li scrubber
789 Count scrubber detected errors.
790 .It Li piggyback
791 Count piggyback scrubber errors.
792 .El
793 .Pp
794 The default is to count both kinds of errors.
795 .It Li k8-dc-refill-from-l2 Op Li ,mask= Ns Ar qualifier
796 Count data cache refills from L2 cache.
797 This event may be further qualified using
798 .Ar qualifier ,
799 which is a
800 .Ql +
801 separated set of the following keywords:
802 .Pp
803 .Bl -tag -width indent -compact
804 .It Li exclusive
805 Count operations for lines in the
806 .Dq exclusive
807 state.
808 .It Li invalid
809 Count operations for lines in the
810 .Dq invalid
811 state.
812 .It Li modified
813 Count operations for lines in the
814 .Dq modified
815 state.
816 .It Li owner
817 Count operations for lines in the
818 .Dq owner
819 state.
820 .It Li shared
821 Count operations for lines in the
822 .Dq shared
823 state.
824 .El
825 .Pp
826 The default is to count operations for lines in all the
827 above states.
828 .It Li k8-dc-refill-from-system Op Li ,mask= Ns Ar qualifier
829 Count data cache refills from system memory.
830 This event may be further qualified using
831 .Ar qualifier ,
832 which is a
833 .Ql +
834 separated set of the following keywords:
835 .Pp
836 .Bl -tag -width indent -compact
837 .It Li exclusive
838 Count operations for lines in the
839 .Dq exclusive
840 state.
841 .It Li invalid
842 Count operations for lines in the
843 .Dq invalid
844 state.
845 .It Li modified
846 Count operations for lines in the
847 .Dq modified
848 state.
849 .It Li owner
850 Count operations for lines in the
851 .Dq owner
852 state.
853 .It Li shared
854 Count operations for lines in the
855 .Dq shared
856 state.
857 .El
858 .Pp
859 The default is to count operations for lines in all the
860 above states.
861 .It Li k8-fp-dispatched-fpu-ops Op Li ,mask= Ns Ar qualifier
862 Count the number of dispatched FPU ops.
863 This event is supported in revision B and later CPUs.
864 This event may be further qualified using
865 .Ar qualifier ,
866 which is a
867 .Ql +
868 separated set of the following keywords:
869 .Pp
870 .Bl -tag -width indent -compact
871 .It Li add-pipe-excluding-junk-ops
872 Count add pipe ops excluding junk ops.
873 .It Li add-pipe-junk-ops
874 Count junk ops in the add pipe.
875 .It Li multiply-pipe-excluding-junk-ops
876 Count multiply pipe ops excluding junk ops.
877 .It Li multiply-pipe-junk-ops
878 Count junk ops in the multiply pipe.
879 .It Li store-pipe-excluding-junk-ops
880 Count store pipe ops excluding junk ops
881 .It Li store-pipe-junk-ops
882 Count junk ops in the store pipe.
883 .El
884 .Pp
885 The default is to count all types of ops.
886 .It Li k8-fp-cycles-with-no-fpu-ops-retired
887 Count cycles when no FPU ops were retired.
888 This event is supported in revision B and later CPUs.
889 .It Li k8-fp-dispatched-fpu-fast-flag-ops
890 Count dispatched FPU ops that use the fast flag interface.
891 This event is supported in revision B and later CPUs.
892 .It Li k8-fr-decoder-empty
893 Count cycles when there was nothing to dispatch (i.e., the decoder
894 was empty).
895 .It Li k8-fr-dispatch-stalls
896 Count all dispatch stalls.
897 .It Li k8-fr-dispatch-stall-for-segment-load
898 Count dispatch stalls for segment loads.
899 .It Li k8-fr-dispatch-stall-for-serialization
900 Count dispatch stalls for serialization.
901 .It Li k8-fr-dispatch-stall-from-branch-abort-to-retire
902 Count dispatch stalls from branch abort to retiral.
903 .It Li k8-fr-dispatch-stall-when-fpu-is-full
904 Count dispatch stalls when the FPU is full.
905 .It Li k8-fr-dispatch-stall-when-ls-is-full
906 Count dispatch stalls when the load/store unit is full.
907 .It Li k8-fr-dispatch-stall-when-reorder-buffer-is-full
908 Count dispatch stalls when the reorder buffer is full.
909 .It Li k8-fr-dispatch-stall-when-reservation-stations-are-full
910 Count dispatch stalls when reservation stations are full.
911 .It Li k8-fr-dispatch-stall-when-waiting-for-all-to-be-quiet
912 Count dispatch stalls when waiting for all to be quiet.
913 .\" XXX What does "waiting for all to be quiet" mean?
914 .It Li k8-fr-dispatch-stall-when-waiting-far-xfer-or-resync-branch-pending
915 Count dispatch stalls when a far control transfer or a resync branch
916 is pending.
917 .It Li k8-fr-fpu-exceptions Op Li ,mask= Ns Ar qualifier
918 Count FPU exceptions.
919 This event is supported in revision B and later CPUs.
920 This event may be further qualified using
921 .Ar qualifier ,
922 which is a
923 .Ql +
924 separated set of the following keywords:
925 .Pp
926 .Bl -tag -width indent -compact
927 .It Li sse-and-x87-microtraps
928 Count SSE and x87 microtraps.
929 .It Li sse-reclass-microfaults
930 Count SSE reclass microfaults
931 .It Li sse-retype-microfaults
932 Count SSE retype microfaults
933 .It Li x87-reclass-microfaults
934 Count x87 reclass microfaults.
935 .El
936 .Pp
937 The default is to count all types of exceptions.
938 .It Li k8-fr-interrupts-masked-cycles
939 Count cycles when interrupts were masked (by CPU RFLAGS field IF was zero).
940 .It Li k8-fr-interrupts-masked-while-pending-cycles
941 Count cycles while interrupts were masked while pending (i.e., cycles
942 when INTR was asserted while CPU RFLAGS field IF was zero).
943 .It Li k8-fr-number-of-breakpoints-for-dr0
944 Count the number of breakpoints for DR0.
945 .It Li k8-fr-number-of-breakpoints-for-dr1
946 Count the number of breakpoints for DR1.
947 .It Li k8-fr-number-of-breakpoints-for-dr2
948 Count the number of breakpoints for DR2.
949 .It Li k8-fr-number-of-breakpoints-for-dr3
950 Count the number of breakpoints for DR3.
951 .It Li k8-fr-retired-branches
952 Count retired branches including exceptions and interrupts.
953 .It Li k8-fr-retired-branches-mispredicted
954 Count mispredicted retired branches.
955 .It Li k8-fr-retired-far-control-transfers
956 Count retired far control transfers (which are always mispredicted).
957 .It Li k8-fr-retired-fastpath-double-op-instructions Op Li ,mask= Ns Ar qualifier
958 Count retired fastpath double op instructions.
959 This event is supported in revision B and later CPUs.
960 This event may be further qualified using
961 .Ar qualifier ,
962 which is a
963 .Ql +
964 separated set of the following keywords:
965 .Pp
966 .Bl -tag -width indent -compact
967 .It Li low-op-pos-0
968 Count instructions with the low op in position 0.
969 .It Li low-op-pos-1
970 Count instructions with the low op in position 1.
971 .It Li low-op-pos-2
972 Count instructions with the low op in position 2.
973 .El
974 .Pp
975 The default is to count all types of instructions.
976 .It Li k8-fr-retired-fpu-instructions Op Li ,mask= Ns Ar qualifier
977 Count retired FPU instructions.
978 This event is supported in revision B and later CPUs.
979 This event may be further qualified using
980 .Ar qualifier ,
981 which is a
982 .Ql +
983 separated set of the following keywords:
984 .Pp
985 .Bl -tag -width indent -compact
986 .It Li mmx-3dnow
987 Count MMX and 3DNow!\& instructions.
988 .It Li packed-sse-sse2
989 Count packed SSE and SSE2 instructions.
990 .It Li scalar-sse-sse2
991 Count scalar SSE and SSE2 instructions
992 .It Li x87
993 Count x87 instructions.
994 .El
995 .Pp
996 The default is to count all types of instructions.
997 .It Li k8-fr-retired-near-returns
998 Count retired near returns.
999 .It Li k8-fr-retired-near-returns-mispredicted
1000 Count mispredicted near returns.
1001 .It Li k8-fr-retired-resyncs
1002 Count retired resyncs (non-control transfer branches).
1003 .It Li k8-fr-retired-taken-hardware-interrupts
1004 Count retired taken hardware interrupts.
1005 .It Li k8-fr-retired-taken-branches
1006 Count retired taken branches.
1007 .It Li k8-fr-retired-taken-branches-mispredicted
1008 Count retired taken branches that were mispredicted.
1009 .It Li k8-fr-retired-taken-branches-mispredicted-by-addr-miscompare
1010 Count retired taken branches that were mispredicted only due to an
1011 address miscompare.
1012 .It Li k8-fr-retired-uops
1013 Count retired uops.
1014 .It Li k8-fr-retired-x86-instructions
1015 Count retired x86 instructions including exceptions and interrupts.
1016 .It Li k8-ic-fetch
1017 Count instruction cache fetches.
1018 .It Li k8-ic-instruction-fetch-stall
1019 Count cycles in stalls due to instruction fetch.
1020 .It Li k8-ic-l1-itlb-miss-and-l2-itlb-hit
1021 Count L1 ITLB misses that are L2 ITLB hits.
1022 .It Li k8-ic-l1-itlb-miss-and-l2-itlb-miss
1023 Count ITLB misses that miss in both L1 and L2 ITLBs.
1024 .It Li k8-ic-microarchitectural-resync-by-snoop
1025 Count microarchitectural resyncs caused by snoops.
1026 .It Li k8-ic-miss
1027 Count instruction cache misses.
1028 .It Li k8-ic-refill-from-l2
1029 Count instruction cache refills from L2 cache.
1030 .It Li k8-ic-refill-from-system
1031 Count instruction cache refills from system memory.
1032 .It Li k8-ic-return-stack-hits
1033 Count hits to the return stack.
1034 .It Li k8-ic-return-stack-overflow
1035 Count overflows of the return stack.
1036 .It Li k8-ls-buffer2-full
1037 Count load/store buffer2 full events.
1038 .It Li k8-ls-locked-operation Op Li ,mask= Ns Ar qualifier
1039 Count locked operations.
1040 For revision C and later CPUs, the following qualifiers are supported:
1041 .Pp
1042 .Bl -tag -width indent -compact
1043 .It Li cycles-in-request
1044 Count the number of cycles in the lock request/grant stage.
1045 .It Li cycles-to-complete
1046 Count the number of cycles a lock takes to complete once it is
1047 non-speculative and is the older load/store operation.
1048 .It Li locked-instructions
1049 Count the number of lock instructions executed.
1050 .El
1051 .Pp
1052 The default is to count the number of lock instructions executed.
1053 .It Li k8-ls-microarchitectural-late-cancel
1054 Count microarchitectural late cancels of operations in the load/store
1055 unit.
1056 .It Li k8-ls-microarchitectural-resync-by-self-modifying-code
1057 Count microarchitectural resyncs caused by self-modifying code.
1058 .It Li k8-ls-microarchitectural-resync-by-snoop
1059 Count microarchitectural resyncs caused by snoops.
1060 .It Li k8-ls-retired-cflush-instructions
1061 Count retired CFLUSH instructions.
1062 .It Li k8-ls-retired-cpuid-instructions
1063 Count retired CPUID instructions.
1064 .It Li k8-ls-segment-register-load Op Li ,mask= Ns Ar qualifier
1065 Count segment register loads.
1066 This event may be further qualified using
1067 .Ar qualifier ,
1068 which is a
1069 .Ql +
1070 separated set of the following keywords:
1071 .Bl -tag -width indent -compact
1072 .It Li cs
1073 Count CS register loads.
1074 .It Li ds
1075 Count DS register loads.
1076 .It Li es
1077 Count ES register loads.
1078 .It Li fs
1079 Count FS register loads.
1080 .It Li gs
1081 Count GS register loads.
1082 .\" .It Li hs
1083 .\" Count HS register loads.
1084 .\" XXX "HS" register?
1085 .It Li ss
1086 Count SS register loads.
1087 .El
1088 .Pp
1089 The default is to count all types of loads.
1090 .It Li k8-nb-memory-controller-bypass-saturation Op Li ,mask= Ns Ar qualifier
1091 Count memory controller bypass counter saturation events.
1092 This event may be further qualified using
1093 .Ar qualifier ,
1094 which is a
1095 .Ql +
1096 separated set of the following keywords:
1097 .Pp
1098 .Bl -tag -width indent -compact
1099 .It Li dram-controller-interface-bypass
1100 Count DRAM controller interface bypass.
1101 .It Li dram-controller-queue-bypass
1102 Count DRAM controller queue bypass.
1103 .It Li memory-controller-hi-pri-bypass
1104 Count memory controller high priority bypasses.
1105 .It Li memory-controller-lo-pri-bypass
1106 Count memory controller low priority bypasses.
1107 .El
1108 .Pp
1109 .It Li k8-nb-memory-controller-dram-slots-missed
1110 Count memory controller DRAM command slots missed (in MemClks).
1111 .It Li k8-nb-memory-controller-page-access-event Op Li ,mask= Ns Ar qualifier
1112 Count memory controller page access events.
1113 This event may be further qualified using
1114 .Ar qualifier ,
1115 which is a
1116 .Ql +
1117 separated set of the following keywords:
1118 .Pp
1119 .Bl -tag -width indent -compact
1120 .It Li page-conflict
1121 Count page conflicts.
1122 .It Li page-hit
1123 Count page hits.
1124 .It Li page-miss
1125 Count page misses.
1126 .El
1127 .Pp
1128 The default is to count all types of events.
1129 .It Li k8-nb-memory-controller-page-table-overflow
1130 Count memory control page table overflow events.
1131 .It Li k8-nb-probe-result Op Li ,mask= Ns Ar qualifier
1132 Count probe events.
1133 This event may be further qualified using
1134 .Ar qualifier ,
1135 which is a
1136 .Ql +
1137 separated set of the following keywords:
1138 .Pp
1139 .Bl -tag -width indent -compact
1140 .It Li probe-hit
1141 Count all probe hits.
1142 .It Li probe-hit-dirty-no-memory-cancel
1143 Count probe hits without memory cancels.
1144 .It Li probe-hit-dirty-with-memory-cancel
1145 Count probe hits with memory cancels.
1146 .It Li probe-miss
1147 Count probe misses.
1148 .El
1149 .It Li k8-nb-sized-commands Op Li ,mask= Ns Ar qualifier
1150 Count sized commands issued.
1151 This event may be further qualified using
1152 .Ar qualifier ,
1153 which is a
1154 .Ql +
1155 separated set of the following keywords:
1156 .Pp
1157 .Bl -tag -width indent -compact
1158 .It Li nonpostwrszbyte
1159 .It Li nonpostwrszdword
1160 .It Li postwrszbyte
1161 .It Li postwrszdword
1162 .It Li rdszbyte
1163 .It Li rdszdword
1164 .It Li rdmodwr
1165 .El
1166 .Pp
1167 The default is to count all types of commands.
1168 .It Li k8-nb-memory-controller-turnaround Op Li ,mask= Ns Ar qualifier
1169 Count memory control turnaround events.
1170 This event may be further qualified using
1171 .Ar qualifier ,
1172 which is a
1173 .Ql +
1174 separated set of the following keywords:
1175 .Pp
1176 .Bl -tag -width indent -compact
1177 .\" XXX doc is unclear whether these are cycle counts or event counts
1178 .It Li dimm-turnaround
1179 Count DIMM turnarounds.
1180 .It Li read-to-write-turnaround
1181 Count read to write turnarounds.
1182 .It Li write-to-read-turnaround
1183 Count write to read turnarounds.
1184 .El
1185 .Pp
1186 The default is to count all types of events.
1187 .It Li k8-nb-ht-bus0-bandwidth Op Li ,mask= Ns Ar qualifier
1188 .It Li k8-nb-ht-bus1-bandwidth Op Li ,mask= Ns Ar qualifier
1189 .It Li k8-nb-ht-bus2-bandwidth Op Li ,mask= Ns Ar qualifier
1190 Count events on the HyperTransport(tm) buses.
1191 These events may be further qualified using
1192 .Ar qualifier ,
1193 which is a
1194 .Ql +
1195 separated set of the following keywords:
1196 .Pp
1197 .Bl -tag -width indent -compact
1198 .It Li buffer-release
1199 Count buffer release messages sent.
1200 .It Li command
1201 Count command messages sent.
1202 .It Li data
1203 Count data messages sent.
1204 .It Li nop
1205 Count nop messages sent.
1206 .El
1207 .Pp
1208 The default is to count all types of messages.
1209 .El
1210 .Ss Intel Pentium PMCS
1211 Intel Pentium PMCs are present in Intel
1212 .Tn Pentium
1213 and
1214 .Tn "Pentium MMX"
1215 processors.
1216 .Pp
1217 These CPUs have two counters.
1218 Some events may only be used on specific counters and some events
1219 are defined only on processors supporting the MMX instruction set.
1220 .Pp
1221 These PMCs are documented in
1222 .Rs
1223 .%B "Intel 64 and IA-32 Intel(R) Architectures Software Developer's Manual"
1224 .%T "Volume 3B: System Programming Guide, Part 2"
1225 .%N "Order Number 253669-024US"
1226 .%D "August 2007"
1227 .%Q "Intel Corporation"
1228 .Re
1229 .Pp
1230 Event specifiers for Intel Pentium PMCs can have the following common
1231 qualifiers:
1232 .Bl -tag -width indent
1233 .It Li duration
1234 Count duration (in clocks) of events.
1235 The default is to count events.
1236 .It Li os
1237 Measure events at privilege levels 0, 1 and 2.
1238 .It Li overflow
1239 Assert the external processor pin associated with a counter on counter
1240 overflow.
1241 .It Li usr
1242 Measure events at privilege level 3.
1243 .El
1244 .Pp
1245 Note that these PMCs do not have the ability to interrupt the CPU.
1246 .Pp
1247 The event specifiers supported by Intel Pentium PMCs are:
1248 .Bl -tag -width indent
1249 .It Li p5-any-segment-register-loaded
1250 The number of writes to any segment register, including the LDTR,
1251 GDTR, TR and IDTR.
1252 Far control transfers and task switches that involve privilege
1253 level changes will count this event twice.
1254 .It Li p5-bank-conflicts
1255 The number of actual bank conflicts.
1256 .It Li p5-branches
1257 The number of taken and not taken branches including branches, jumps, calls,
1258 software interrupts and interrupt returns.
1259 .It Li p5-breakpoint-match-on-dr0-register
1260 The number of matches on the DR0 breakpoint register.
1261 .It Li p5-breakpoint-match-on-dr1-register
1262 The number of matches on the DR1 breakpoint register.
1263 .It Li p5-breakpoint-match-on-dr2-register
1264 The number of matches on the DR2 breakpoint register.
1265 .It Li p5-breakpoint-match-on-dr3-register
1266 The number of matches on the DR3 breakpoint register.
1267 .It Li p5-btb-false-entries
1268 .Pq Tn Pentium MMX
1269 The number of false entries in the BTB.
1270 This event is only allocated on counter 0.
1271 .It Li p5-btb-hits
1272 The number of branches executed that hit in the branch table buffer.
1273 .It Li p5-btb-miss-prediction-on-not-taken-branch
1274 .Pq Tn Pentium MMX
1275 The number of times the BTB predicted a not-taken branch as taken.
1276 This event is only allocated on counter 1.
1277 .It Li p5-bus-cycle-duration
1278 The number of cycles while a bus cycle was in progress.
1279 .It Li p5-bus-ownership-latency
1280 .Pq Tn Pentium MMX
1281 The time from bus ownership being requested to ownership being granted.
1282 This event is only allocated on counter 0.
1283 .It Li p5-bus-ownership-transfers
1284 .Pq Tn Pentium MMX
1285 The number of bus ownership transfers.
1286 This event is only allocated on counter 1.
1287 .It Li p5-bus-utilization-due-to-processor-activity
1288 .Pq Tn Pentium MMX
1289 The number of clocks the bus is busy due to the processor's own
1290 activity.
1291 This event is only allocated on counter 0.
1292 .It Li p5-cache-line-sharing
1293 .Pq Tn Pentium MMX
1294 The number of shared data lines in L1 cache.
1295 This event is only allocated on counter 1.
1296 .It Li p5-cache-m-state-line-sharing
1297 .Pq Tn Pentium MMX
1298 The number of hits to an M- state line due to a memory access by
1299 another processor.
1300 This event is only allocated on counter 0.
1301 .It Li p5-code-cache-miss
1302 The number of instruction reads that miss the internal code cache.
1303 Both cacheable and uncacheable misses are counted.
1304 .It Li p5-code-read
1305 The number of instruction reads to both cacheable and uncacheable regions.
1306 .It Li p5-code-tlb-miss
1307 The number of instruction reads that miss the instruction TLB.
1308 Both cacheable and uncacheable unreads are counted.
1309 .It Li p5-d1-starvation-and-fifo-is-empty
1310 .Pq Tn Pentium MMX
1311 The number of times the D1 stage cannot issue any instructions because
1312 the FIFO was empty.
1313 This event is only allocated on counter 0.
1314 .It Li p5-d1-starvation-and-only-one-instruction-in-fifo
1315 .Pq Tn Pentium MMX
1316 The number of times the D1 stage could issue only one instruction
1317 because the FIFO had one instruction ready.
1318 This event is only allocated on counter 1.
1319 .It Li p5-data-cache-lines-written-back
1320 The number of data cache lines that are written back, including
1321 those caused by internal and external snoops.
1322 .It Li p5-data-cache-tlb-miss-stall-duration
1323 .Pq Tn Pentium MMX
1324 The number of clocks the pipeline is stalled due to a data cache
1325 TLB miss.
1326 This event is only allocated on counter 1.
1327 .It Li p5-data-read
1328 The number of memory data reads, counting internal data cache hits and
1329 misses.
1330 I/O and data memory accesses due to TLB miss processing are
1331 not included.
1332 Split cycle reads are counted individually.
1333 .It Li p5-data-read-miss
1334 The number of memory read accesses that miss the data cache, counting
1335 both cacheable and uncacheable accesses.
1336 Data accesses that are part of TLB miss processing are not included.
1337 I/O accesses are not included.
1338 .It Li p5-data-read-miss-or-write-miss
1339 The number of data reads and writes that miss the internal data cache,
1340 counting uncacheable accesses.
1341 Data accesses due to TLB miss processing are not counted.
1342 .It Li p5-data-read-or-write
1343 The number of data reads and writes including internal data cache hits
1344 and misses.
1345 Data reads due to TLB miss processing are not counted.
1346 .It Li p5-data-tlb-miss
1347 The number of misses to the data cache translation lookaside buffer.
1348 .It Li p5-data-write
1349 The number of memory data writes, counting internal data cache hits
1350 and misses.
1351 I/O is not included and split cycle writes are counted individually.
1352 .It Li p5-data-write-miss
1353 The number of memory write accesses that miss the data cache, counting
1354 both cacheable and uncacheable accesses.
1355 I/O accesses are not counted.
1356 .It Li p5-emms-instructions-executed
1357 .Pq Tn Pentium MMX
1358 The number of EMMS instructions executed.
1359 This event is only allocated on counter 0.
1360 .It Li p5-external-data-cache-snoop-hits
1361 The number of external snoops to the data cache that hit a valid line,
1362 or the data line fill buffer, or one of the write back buffers.
1363 .It Li p5-external-snoops
1364 The number of external snoop requests accepted, including snoops that
1365 hit in the code cache, the data cache and that hit in neither.
1366 .It Li p5-floating-point-stalls-duration
1367 .Pq Tn Pentium MMX
1368 The number of cycles the pipeline is stalled due to a floating point
1369 freeze.
1370 This event is only allocated on counter 0.
1371 .It Li p5-flops
1372 The number of floating point adds, subtracts, multiples, divides and
1373 square roots.
1374 Transcendental instructions trigger this event multiple times.
1375 Instructions generating divide-by-zero, negative square root, special
1376 operand and stack exceptions are not counted.
1377 Integer multiply instructions that use the x87 FPU are counted.
1378 .It Li p5-full-write-buffer-stall-duration-while-executing-mmx-instructions
1379 .Pq Tn Pentium MMX
1380 The number of clocks the pipeline has stalled due to full write
1381 buffers when executing MMX instructions.
1382 This event is only allocated on counter 0.
1383 .It Li p5-hardware-interrupts
1384 The number of taken INTR and NMI interrupts.
1385 .It Li p5-instructions-executed
1386 The number of instructions executed.
1387 Repeat prefixed instructions are counted only once.
1388 The HLT instruction is counted only once, irrespective of the number
1389 of cycles spent in the halted state.
1390 All hardware and software exceptions are counted as instructions, and
1391 fault handler invocations are also counted as instructions.
1392 .It Li p5-instructions-executed-v-pipe
1393 The number of instructions that executed in the V pipe.
1394 .It Li p5-io-read-or-write-cycle
1395 The number of bus cycles directed to I/O space.
1396 .It Li p5-locked-bus-cycle
1397 The number of locked bus cycles that occur on account of the lock
1398 prefixes, LOCK instructions, page table updates and descriptor table
1399 updates.
1400 .It Li p5-memory-accesses-in-both-pipes
1401 The number of data memory reads or writes that are paired in both pipes.
1402 .It Li p5-misaligned-data-memory-on-mmx-instructions
1403 .Pq Tn Pentium MMX
1404 The number of misaligned data memory references when executing MMX
1405 instructions.
1406 This event is only allocated on counter 0.
1407 .It Li p5-misaligned-data-memory-or-io-references
1408 The number of memory or I/O reads or writes that are not aligned on
1409 natural boundaries.
1410 2- and 4-byte accesses are counted as misaligned if they cross a 4
1411 byte boundary.
1412 .It Li p5-mispredicted-or-unpredicted-returns
1413 .Pq Tn Pentium MMX
1414 The number of returns predicted incorrectly or not at all, only
1415 counting RET instructions.
1416 This event is only allocated on counter 0.
1417 .It Li p5-mmx-instruction-data-read-misses
1418 .Pq Tn Pentium MMX
1419 The number of MMX instruction data read misses.
1420 This event is only allocated on counter 1.
1421 .It Li p5-mmx-instruction-data-reads
1422 .Pq Tn Pentium MMX
1423 The number of MMX instruction data reads.
1424 This event is only allocated on counter 0.
1425 .It Li p5-mmx-instruction-data-write-misses
1426 .Pq Tn Pentium MMX
1427 The number of data write misses caused by MMX instructions.
1428 This event is only allocated on counter 1.
1429 .It Li p5-mmx-instruction-data-writes
1430 .Pq Tn Pentium MMX
1431 The number of data writes caused by MMX instructions.
1432 This event is only allocated on counter 0.
1433 .It Li p5-mmx-instructions-executed-u-pipe
1434 .Pq Tn Pentium MMX
1435 The number of MMX instructions executed in the U pipe.
1436 This event is only allocated on counter 0.
1437 .It Li p5-mmx-instructions-executed-v-pipe
1438 The number of MMX instructions executed in the V pipe.
1439 This event is only allocated on counter 1.
1440 .It Li p5-mmx-multiply-unit-interlock
1441 .Pq Tn Pentium MMX
1442 The number of clocks the pipeline is stalled because the destination
1443 of a prior MMX multiply is not ready.
1444 This event is only allocated on counter 0.
1445 .It Li p5-movd-movq-store-stall-due-to-previous-mmx-operation
1446 .Pq Tn Pentium MMX
1447 The number of clocks a MOVD/MOVQ instruction stalled in the D2 stage
1448 of the pipeline due to a previous MMX instruction.
1449 This event is only allocated on counter 1.
1450 .It Li p5-noncacheable-memory-reads
1451 The number of bus cycles for non-cacheable instruction or data reads,
1452 including cycles caused by TLB misses.
1453 .It Li p5-number-of-cycles-not-in-halt-state
1454 .Pq Tn Pentium MMX
1455 The number of cycles the processor is not idle due to the HLT
1456 instruction.
1457 This event is only allocated on counter 0.
1458 .It Li p5-pipeline-agi-stalls
1459 The number of address generation interlock stalls.
1460 An AGI that occurs in both the U and V pipelines in the same clock
1461 signals the event twice.
1462 .It Li p5-pipeline-flushes
1463 The number of pipeline flushes that occur.
1464 Pipeline flushes are caused by branch mispredicts, exceptions,
1465 interrupts, some segment register loads, and BTB misses.
1466 Prefetch queue flushes due to serializing instructions are not
1467 counted.
1468 .It Li p5-pipeline-flushes-due-to-wrong-branch-predictions
1469 .Pq Tn Pentium MMX
1470 The number of pipeline flushes due to wrong branch predictions
1471 resolved in either the E- or WB- stage of the pipeline.
1472 This event is only allocated on counter 0.
1473 .It Li p5-pipeline-flushes-due-to-wrong-branch-predictions-resolved-in-wb-stage
1474 .Pq Tn Pentium MMX
1475 The number of pipeline flushes due to wrong branch predictions
1476 resolved in the stage of the pipeline.
1477 This event is only allocated on counter 1.
1478 .It Li p5-pipeline-stall-for-mmx-instruction-data-memory-reads
1479 .Pq Tn Pentium MMX
1480 The number of clocks during pipeline stalls caused by waiting MMX data
1481 memory reads.
1482 This event is only allocated on counter 0.
1483 .It Li p5-predicted-returns
1484 .Pq Tn Pentium MMX
1485 The number of predicted returns, whether correct or incorrect.
1486 This counter only counts RET instructions.
1487 This event is only allocated on counter 1.
1488 .It Li p5-returns
1489 .Pq Tn Pentium MMX
1490 The number of RET instructions executed.
1491 This event is only allocated on counter 0.
1492 .It Li p5-saturating-mmx-instructions-executed
1493 .Pq Tn Pentium MMX
1494 The number of saturating MMX instructions executed.
1495 This event is only allocated on counter 0.
1496 .It Li p5-saturations-performed
1497 .Pq Tn Pentium MMX
1498 The number of saturating MMX instructions executed when at least one
1499 of its results were actually saturated.
1500 This event is only allocated on counter 1.
1501 .It Li p5-stall-on-mmx-instruction-write-to-e-o-m-state-line
1502 .Pq Tn Pentium MMX
1503 The number of clocks during stalls on MMX instructions writing to
1504 E- or M- state cache lines.
1505 This event is only allocated on counter 1.
1506 .It Li p5-stall-on-write-to-an-e-or-m-state-line
1507 The number of stalls on a write to an exclusive or modified data cache
1508 line.
1509 .It Li p5-taken-branch-or-btb-hit
1510 The number of events that may cause a hit in the BTB, namely either
1511 taken branches or BTB hits.
1512 .It Li p5-taken-branches
1513 .Pq Tn Pentium MMX
1514 The number of taken branches.
1515 This event is only allocated on counter 1.
1516 .It Li p5-transitions-between-mmx-and-fp-instructions
1517 .Pq Tn Pentium MMX
1518 The number of transitions between MMX and floating-point instructions
1519 and vice-versa.
1520 This event is only allocated on counter 1.
1521 .It Li p5-waiting-for-data-memory-read-stall-duration
1522 The number of clocks the pipeline was stalled waiting for data
1523 memory reads.
1524 Data TLB misses processing is included in this count.
1525 .It Li p5-write-buffer-full-stall-duration
1526 The number of clocks while the pipeline was stalled due to write
1527 buffers being full.
1528 .It Li p5-write-hit-to-m-or-e-state-lines
1529 The number of writes that hit exclusive or modified lines in the data
1530 cache.
1531 .It Li p5-writes-to-noncacheable-memory
1532 .Pq Tn Pentium MMX
1533 The number of writes to non-cacheable memory, including write cycles
1534 caused by TLB misses and I/O writes.
1535 This event is only allocated on counter 1.
1536 .El
1537 .Ss Intel P6 PMCS
1538 Intel P6 PMCs are present in Intel
1539 .Tn "Pentium Pro" ,
1540 .Tn "Pentium II" ,
1541 .Tn Celeron ,
1542 .Tn "Pentium III"
1543 and
1544 .Tn "Pentium M"
1545 processors.
1546 .Pp
1547 These CPUs have two counters.
1548 Some events may only be used on specific counters and some events are
1549 defined only on specific processor models.
1550 .Pp
1551 These PMCs are documented in
1552 .Rs
1553 .%B "IA-32 Intel(R) Architecture Software Developer's Manual"
1554 .%T "Volume 3: System Programming Guide"
1555 .%N "Order Number 245472-012"
1556 .%D 2003
1557 .%Q "Intel Corporation"
1558 .Re
1559 .Pp
1560 Some of these events are affected by processor errata described in
1561 .Rs
1562 .%B "Intel(R) Pentium(R) III Processor Specification Update"
1563 .%N "Document Number: 244453-054"
1564 .%D "April 2005"
1565 .%Q "Intel Corporation"
1566 .Re
1567 .Pp
1568 Event specifiers for Intel P6 PMCs can have the following common
1569 qualifiers:
1570 .Bl -tag -width indent
1571 .It Li cmask= Ns Ar value
1572 Configure the PMC to increment only if the number of configured
1573 events measured in a cycle is greater than or equal to
1574 .Ar value .
1575 .It Li edge
1576 Configure the PMC to count the number of deasserted to asserted
1577 transitions of the conditions expressed by the other qualifiers.
1578 If specified, the counter will increment only once whenever a
1579 condition becomes true, irrespective of the number of clocks during
1580 which the condition remains true.
1581 .It Li inv
1582 Invert the sense of comparision when the
1583 .Dq Li cmask
1584 qualifier is present, making the counter increment when the number of
1585 events per cycle is less than the value specified by the
1586 .Dq Li cmask
1587 qualifier.
1588 .It Li os
1589 Configure the PMC to count events happening at processor privilege
1590 level 0.
1591 .It Li umask= Ns Ar value
1592 This qualifier is used to further qualify the event selected (see
1593 below).
1594 .It Li usr
1595 Configure the PMC to count events occurring at privilege levels 1, 2
1596 or 3.
1597 .El
1598 .Pp
1599 If neither of the
1600 .Dq Li os
1601 or
1602 .Dq Li usr
1603 qualifiers are specified, the default is to enable both.
1604 .Pp
1605 The event specifiers supported by Intel P6 PMCs are:
1606 .Bl -tag -width indent
1607 .It Li p6-baclears
1608 Count the number of times a static branch prediction was made by the
1609 branch decoder because the BTB did not have a prediction.
1610 .It Li p6-br-bac-missp-exec
1611 .Pq Tn "Pentium M"
1612 Count the number of branch instructions executed that where
1613 mispredicted at the Front End (BAC).
1614 .It Li p6-br-bogus
1615 Count the number of bogus branches.
1616 .It Li p6-br-call-exec
1617 .Pq Tn "Pentium M"
1618 Count the number of call instructions executed.
1619 .It Li p6-br-call-missp-exec
1620 .Pq Tn "Pentium M"
1621 Count the number of call instructions executed that were mispredicted.
1622 .It Li p6-br-cnd-exec
1623 .Pq Tn "Pentium M"
1624 Count the number of conditional branch instructions executed.
1625 .It Li p6-br-cnd-missp-exec
1626 .Pq Tn "Pentium M"
1627 Count the number of conditional branch instructions executed that were
1628 mispredicted.
1629 .It Li p6-br-ind-call-exec
1630 .Pq Tn "Pentium M"
1631 Count the number of indirect call instructions executed.
1632 .It Li p6-br-ind-exec
1633 .Pq Tn "Pentium M"
1634 Count the number of indirect branch instructions executed.
1635 .It Li p6-br-ind-missp-exec
1636 .Pq Tn "Pentium M"
1637 Count the number of indirect branch instructions executed that were
1638 mispredicted.
1639 .It Li p6-br-inst-decoded
1640 Count the number of branch instructions decoded.
1641 .It Li p6-br-inst-exec
1642 .Pq Tn "Pentium M"
1643 Count the number of branch instructions executed but necessarily retired.
1644 .It Li p6-br-inst-retired
1645 Count the number of branch instructions retired.
1646 .It Li p6-br-miss-pred-retired
1647 Count the number of mispredicted branch instructions retired.
1648 .It Li p6-br-miss-pred-taken-ret
1649 Count the number of taken mispredicted branches retired.
1650 .It Li p6-br-missp-exec
1651 .Pq Tn "Pentium M"
1652 Count the number of branch instructions executed that were
1653 mispredicted at execution.
1654 .It Li p6-br-ret-bac-missp-exec
1655 .Pq Tn "Pentium M"
1656 Count the number of return instructions executed that were
1657 mispredicted at the Front End (BAC).
1658 .It Li p6-br-ret-exec
1659 .Pq Tn "Pentium M"
1660 Count the number of return instructions executed.
1661 .It Li p6-br-ret-missp-exec
1662 .Pq Tn "Pentium M"
1663 Count the number of return instructions executed that were
1664 mispredicted at execution.
1665 .It Li p6-br-taken-retired
1666 Count the number of taken branches retired.
1667 .It Li p6-btb-misses
1668 Count the number of branches for which the BTB did not produce a
1669 prediction.
1670 .It Li p6-bus-bnr-drv
1671 Count the number of bus clock cycles during which this processor is
1672 driving the BNR# pin.
1673 .It Li p6-bus-data-rcv
1674 Count the number of bus clock cycles during which this processor is
1675 receiving data.
1676 .It Li p6-bus-drdy-clocks Op Li ,umask= Ns Ar qualifier
1677 Count the number of clocks during which DRDY# is asserted.
1678 An additional qualifier may be specified, and comprises one of the
1679 following keywords:
1680 .Pp
1681 .Bl -tag -width indent -compact
1682 .It Li any
1683 Count transactions generated by any agent on the bus.
1684 .It Li self
1685 Count transactions generated by this processor.
1686 .El
1687 .Pp
1688 The default is to count operations generated by this processor.
1689 .It Li p6-bus-hit-drv
1690 Count the number of bus clock cycles during which this processor is
1691 driving the HIT# pin.
1692 .It Li p6-bus-hitm-drv
1693 Count the number of bus clock cycles during which this processor is
1694 driving the HITM# pin.
1695 .It Li p6-bus-lock-clocks Op Li ,umask= Ns Ar qualifier
1696 Count the number of clocks during with LOCK# is asserted on the
1697 external system bus.
1698 An additional qualifier may be specified and comprises one of the following
1699 keywords:
1700 .Pp
1701 .Bl -tag -width indent -compact
1702 .It Li any
1703 Count transactions generated by any agent on the bus.
1704 .It Li self
1705 Count transactions generated by this processor.
1706 .El
1707 .Pp
1708 The default is to count operations generated by this processor.
1709 .It Li p6-bus-req-outstanding
1710 Count the number of bus requests outstanding in any given cycle.
1711 .It Li p6-bus-snoop-stall
1712 Count the number of clock cycles during which the bus is snoop stalled.
1713 .It Li p6-bus-tran-any Op Li ,umask= Ns Ar qualifier
1714 Count the number of completed bus transactions of any kind.
1715 An additional qualifier may be specified and comprises one of the following
1716 keywords:
1717 .Pp
1718 .Bl -tag -width indent -compact
1719 .It Li any
1720 Count transactions generated by any agent on the bus.
1721 .It Li self
1722 Count transactions generated by this processor.
1723 .El
1724 .Pp
1725 The default is to count operations generated by this processor.
1726 .It Li p6-bus-tran-brd Op Li ,umask= Ns Ar qualifier
1727 Count the number of burst read transactions.
1728 An additional qualifier may be specified and comprises one of the following
1729 keywords:
1730 .Pp
1731 .Bl -tag -width indent -compact
1732 .It Li any
1733 Count transactions generated by any agent on the bus.
1734 .It Li self
1735 Count transactions generated by this processor.
1736 .El
1737 .Pp
1738 The default is to count operations generated by this processor.
1739 .It Li p6-bus-tran-burst Op Li ,umask= Ns Ar qualifier
1740 Count the number of completed burst transactions.
1741 An additional qualifier may be specified and comprises one of the following
1742 keywords:
1743 .Pp
1744 .Bl -tag -width indent -compact
1745 .It Li any
1746 Count transactions generated by any agent on the bus.
1747 .It Li self
1748 Count transactions generated by this processor.
1749 .El
1750 .Pp
1751 The default is to count operations generated by this processor.
1752 .It Li p6-bus-tran-def Op Li ,umask= Ns Ar qualifier
1753 Count the number of completed deferred transactions.
1754 An additional qualifier may be specified and comprises one of the following
1755 keywords:
1756 .Pp
1757 .Bl -tag -width indent -compact
1758 .It Li any
1759 Count transactions generated by any agent on the bus.
1760 .It Li self
1761 Count transactions generated by this processor.
1762 .El
1763 .Pp
1764 The default is to count operations generated by this processor.
1765 .It Li p6-bus-tran-ifetch Op Li ,umask= Ns Ar qualifier
1766 Count the number of completed instruction fetch transactions.
1767 An additional qualifier may be specified and comprises one of the following
1768 keywords:
1769 .Pp
1770 .Bl -tag -width indent -compact
1771 .It Li any
1772 Count transactions generated by any agent on the bus.
1773 .It Li self
1774 Count transactions generated by this processor.
1775 .El
1776 .Pp
1777 The default is to count operations generated by this processor.
1778 .It Li p6-bus-tran-inval Op Li ,umask= Ns Ar qualifier
1779 Count the number of completed invalidate transactions.
1780 An additional qualifier may be specified and comprises one of the following
1781 keywords:
1782 .Pp
1783 .Bl -tag -width indent -compact
1784 .It Li any
1785 Count transactions generated by any agent on the bus.
1786 .It Li self
1787 Count transactions generated by this processor.
1788 .El
1789 .Pp
1790 The default is to count operations generated by this processor.
1791 .It Li p6-bus-tran-mem Op Li ,umask= Ns Ar qualifier
1792 Count the number of completed memory transactions.
1793 An additional qualifier may be specified and comprises one of the following
1794 keywords:
1795 .Pp
1796 .Bl -tag -width indent -compact
1797 .It Li any
1798 Count transactions generated by any agent on the bus.
1799 .It Li self
1800 Count transactions generated by this processor.
1801 .El
1802 .Pp
1803 The default is to count operations generated by this processor.
1804 .It Li p6-bus-tran-pwr Op Li ,umask= Ns Ar qualifier
1805 Count the number of completed partial write transactions.
1806 An additional qualifier may be specified and comprises one of the following
1807 keywords:
1808 .Pp
1809 .Bl -tag -width indent -compact
1810 .It Li any
1811 Count transactions generated by any agent on the bus.
1812 .It Li self
1813 Count transactions generated by this processor.
1814 .El
1815 .Pp
1816 The default is to count operations generated by this processor.
1817 .It Li p6-bus-tran-rfo Op Li ,umask= Ns Ar qualifier
1818 Count the number of completed read-for-ownership transactions.
1819 An additional qualifier may be specified and comprises one of the following
1820 keywords:
1821 .Pp
1822 .Bl -tag -width indent -compact
1823 .It Li any
1824 Count transactions generated by any agent on the bus.
1825 .It Li self
1826 Count transactions generated by this processor.
1827 .El
1828 .Pp
1829 The default is to count operations generated by this processor.
1830 .It Li p6-bus-trans-io Op Li ,umask= Ns Ar qualifier
1831 Count the number of completed I/O transactions.
1832 An additional qualifier may be specified and comprises one of the following
1833 keywords:
1834 .Pp
1835 .Bl -tag -width indent -compact
1836 .It Li any
1837 Count transactions generated by any agent on the bus.
1838 .It Li self
1839 Count transactions generated by this processor.
1840 .El
1841 .Pp
1842 The default is to count operations generated by this processor.
1843 .It Li p6-bus-trans-p Op Li ,umask= Ns Ar qualifier
1844 Count the number of completed partial transactions.
1845 An additional qualifier may be specified and comprises one of the following
1846 keywords:
1847 .Pp
1848 .Bl -tag -width indent -compact
1849 .It Li any
1850 Count transactions generated by any agent on the bus.
1851 .It Li self
1852 Count transactions generated by this processor.
1853 .El
1854 .Pp
1855 The default is to count operations generated by this processor.
1856 .It Li p6-bus-trans-wb Op Li ,umask= Ns Ar qualifier
1857 Count the number of completed write-back transactions.
1858 An additional qualifier may be specified and comprises one of the following
1859 keywords:
1860 .Pp
1861 .Bl -tag -width indent -compact
1862 .It Li any
1863 Count transactions generated by any agent on the bus.
1864 .It Li self
1865 Count transactions generated by this processor.
1866 .El
1867 .Pp
1868 The default is to count operations generated by this processor.
1869 .It Li p6-cpu-clk-unhalted
1870 Count the number of cycles during with the processor was not halted.
1871 .Pp
1872 .Pq Tn "Pentium M"
1873 Count the number of cycles during with the processor was not halted
1874 and not in a thermal trip.
1875 .It Li p6-cycles-div-busy
1876 Count the number of cycles during which the divider is busy and cannot
1877 accept new divides.
1878 This event is only allocated on counter 0.
1879 .It Li p6-cycles-in-pending-and-masked
1880 Count the number of processor cycles for which interrupts were
1881 disabled and interrupts were pending.
1882 .It Li p6-cycles-int-masked
1883 Count the number of processor cycles for which interrupts were
1884 disabled.
1885 .It Li p6-data-mem-refs
1886 Count all loads and all stores using any memory type, including
1887 internal retries.
1888 Each part of a split store is counted separately.
1889 .It Li p6-dcu-lines-in
1890 Count the total lines allocated in the data cache unit.
1891 .It Li p6-dcu-m-lines-in
1892 Count the number of M state lines allocated in the data cache unit.
1893 .It Li p6-dcu-m-lines-out
1894 Count the number of M state lines evicted from the data cache unit.
1895 .It Li p6-dcu-miss-outstanding
1896 Count the weighted number of cycles while a data cache unit miss is
1897 outstanding, incremented by the number of outstanding cache misses at
1898 any time.
1899 .It Li p6-div
1900 Count the number of integer and floating-point divides including
1901 speculative divides.
1902 This event is only allocated on counter 1.
1903 .It Li p6-emon-esp-uops
1904 .Pq Tn "Pentium M"
1905 Count the total number of micro-ops.
1906 .It Li p6-emon-est-trans Op Li ,umask= Ns Ar qualifier
1907 .Pq Tn "Pentium M"
1908 Count the number of
1909 .Tn "Enhanced Intel SpeedStep"
1910 transitions.
1911 An additional qualifier may be specified, and can be one of the
1912 following keywords:
1913 .Pp
1914 .Bl -tag -width indent -compact
1915 .It Li all
1916 Count all transitions.
1917 .It Li freq
1918 Count only frequency transitions.
1919 .El
1920 .Pp
1921 The default is to count all transitions.
1922 .It Li p6-emon-fused-uops-ret Op Li ,umask= Ns Ar qualifier
1923 .Pq Tn "Pentium M"
1924 Count the number of retired fused micro-ops.
1925 An additional qualifier may be specified, and may be one of the
1926 following keywords:
1927 .Pp
1928 .Bl -tag -width indent -compact
1929 .It Li all
1930 Count all fused micro-ops.
1931 .It Li loadop
1932 Count only load and op micro-ops.
1933 .It Li stdsta
1934 Count only STD/STA micro-ops.
1935 .El
1936 .Pp
1937 The default is to count all fused micro-ops.
1938 .It Li p6-emon-kni-comp-inst-ret
1939 .Pq Tn "Pentium III"
1940 Count the number of SSE computational instructions retired.
1941 An additional qualifier may be specified, and comprises one of the
1942 following keywords:
1943 .Pp
1944 .Bl -tag -width indent -compact
1945 .It Li packed-and-scalar
1946 Count packed and scalar operations.
1947 .It Li scalar
1948 Count scalar operations only.
1949 .El
1950 .Pp
1951 The default is to count packed and scalar operations.
1952 .It Li p6-emon-kni-inst-retired Op Li ,umask= Ns Ar qualifier
1953 .Pq Tn "Pentium III"
1954 Count the number of SSE instructions retired.
1955 An additional qualifier may be specified, and comprises one of the
1956 following keywords:
1957 .Pp
1958 .Bl -tag -width indent -compact
1959 .It Li packed-and-scalar
1960 Count packed and scalar operations.
1961 .It Li scalar
1962 Count scalar operations only.
1963 .El
1964 .Pp
1965 The default is to count packed and scalar operations.
1966 .It Li p6-emon-kni-pref-dispatched Op Li ,umask= Ns Ar qualifier
1967 .Pq Tn "Pentium III"
1968 Count the number of SSE prefetch or weakly ordered instructions
1969 dispatched (including speculative prefetches).
1970 An additional qualifier may be specified, and comprises one of the
1971 following keywords:
1972 .Pp
1973 .Bl -tag -width indent -compact
1974 .It Li nta
1975 Count non-temporal prefetches.
1976 .It Li t1
1977 Count prefetches to L1.
1978 .It Li t2
1979 Count prefetches to L2.
1980 .It Li wos
1981 Count weakly ordered stores.
1982 .El
1983 .Pp
1984 The default is to count non-temporal prefetches.
1985 .It Li p6-emon-kni-pref-miss Op Li ,umask= Ns Ar qualifier
1986 .Pq Tn "Pentium III"
1987 Count the number of prefetch or weakly ordered instructions that miss
1988 all caches.
1989 An additional qualifier may be specified, and comprises one of the
1990 following keywords:
1991 .Pp
1992 .Bl -tag -width indent -compact
1993 .It Li nta
1994 Count non-temporal prefetches.
1995 .It Li t1
1996 Count prefetches to L1.
1997 .It Li t2
1998 Count prefetches to L2.
1999 .It Li wos
2000 Count weakly ordered stores.
2001 .El
2002 .Pp
2003 The default is to count non-temporal prefetches.
2004 .It Li p6-emon-pref-rqsts-dn
2005 .Pq Tn "Pentium M"
2006 Count the number of downward prefetches issued.
2007 .It Li p6-emon-pref-rqsts-up
2008 .Pq Tn "Pentium M"
2009 Count the number of upward prefetches issued.
2010 .It Li p6-emon-simd-instr-retired
2011 .Pq Tn "Pentium M"
2012 Count the number of retired
2013 .Tn MMX
2014 instructions.
2015 .It Li p6-emon-sse-sse2-comp-inst-retired Op Li ,umask= Ns Ar qualifier
2016 .Pq Tn "Pentium M"
2017 Count the number of computational SSE instructions retired.
2018 An additional qualifier may be specified and can be one of the
2019 following keywords:
2020 .Pp
2021 .Bl -tag -width indent -compact
2022 .It Li sse-packed-single
2023 Count SSE packed-single instructions.
2024 .It Li sse-scalar-single
2025 Count SSE scalar-single instructions.
2026 .It Li sse2-packed-double
2027 Count SSE2 packed-double instructions.
2028 .It Li sse2-scalar-double
2029 Count SSE2 scalar-double instructions.
2030 .El
2031 .Pp
2032 The default is to count SSE packed-single instructions.
2033 .It Li p6-emon-sse-sse2-inst-retired Op Li ,umask= Ns Ar qualifer
2034 .Pp
2035 .Pq Tn "Pentium M"
2036 Count the number of SSE instructions retired.
2037 An additional qualifier can be specified, and can be one of the
2038 following keywords:
2039 .Pp
2040 .Bl -tag -width indent -compact
2041 .It Li sse-packed-single
2042 Count SSE packed-single instructions.
2043 .It Li sse-packed-single-scalar-single
2044 Count SSE packed-single and scalar-single instructions.
2045 .It Li sse2-packed-double
2046 Count SSE2 packed-double instructions.
2047 .It Li sse2-scalar-double
2048 Count SSE2 scalar-double instructions.
2049 .El
2050 .Pp
2051 The default is to count SSE packed-single instructions.
2052 .It Li p6-emon-synch-uops
2053 .Pq Tn "Pentium M"
2054 Count the number of sync micro-ops.
2055 .It Li p6-emon-thermal-trip
2056 .Pq Tn "Pentium M"
2057 Count the duration or occurrences of thermal trips.
2058 Use the
2059 .Dq Li edge
2060 qualifier to count occurrences of thermal trips.
2061 .It Li p6-emon-unfusion
2062 .Pq Tn "Pentium M"
2063 Count the number of unfusion events in the reorder buffer.
2064 .It Li p6-flops
2065 Count the number of computational floating point operations retired.
2066 This event is only allocated on counter 0.
2067 .It Li p6-fp-assist
2068 Count the number of floating point exceptions handled by microcode.
2069 This event is only allocated on counter 1.
2070 .It Li p6-fp-comps-ops-exe
2071 Count the number of computation floating point operations executed.
2072 This event is only allocated on counter 0.
2073 .It Li p6-fp-mmx-trans Op Li ,umask= Ns Ar qualifier
2074 .Pq Tn "Pentium II" , Tn "Pentium III"
2075 Count the number of transitions between MMX and floating-point
2076 instructions.
2077 An additional qualifier may be specified, and comprises one of the
2078 following keywords:
2079 .Pp
2080 .Bl -tag -width indent -compact
2081 .It Li mmxtofp
2082 Count transitions from MMX instructions to floating-point instructions.
2083 .It Li fptommx
2084 Count transitions from floating-point instructions to MMX instructions.
2085 .El
2086 .Pp
2087 The default is to count MMX to floating-point transitions.
2088 .It Li p6-hw-int-rx
2089 Count the number of hardware interrupts received.
2090 .It Li p6-ifu-fetch
2091 Count the number of instruction fetches, both cacheable and non-cacheable.
2092 .It Li p6-ifu-fetch-miss
2093 Count the number of instruction fetch misses (i.e., those that produce
2094 memory accesses).
2095 .It Li p6-ifu-mem-stall
2096 Count the number of cycles instruction fetch is stalled for any reason.
2097 .It Li p6-ild-stall
2098 Count the number of cycles the instruction length decoder is stalled.
2099 .It Li p6-inst-decoded
2100 Count the number of instructions decoded.
2101 .It Li p6-inst-retired
2102 Count the number of instructions retired.
2103 .It Li p6-itlb-miss
2104 Count the number of instruction TLB misses.
2105 .It Li p6-l2-ads
2106 Count the number of L2 address strobes.
2107 .It Li p6-l2-dbus-busy
2108 Count the number of cycles during which the L2 cache data bus was busy.
2109 .It Li p6-l2-dbus-busy-rd
2110 Count the number of cycles during which the L2 cache data bus was busy
2111 transferring read data from L2 to the processor.
2112 .It Li p6-l2-ifetch Op Li ,umask= Ns Ar qualifier
2113 Count the number of L2 instruction fetches.
2114 An additional qualifier may be specified and comprises a list of the following
2115 keywords separated by
2116 .Ql +
2117 characters:
2118 .Pp
2119 .Bl -tag -width indent -compact
2120 .It Li e
2121 Count operations affecting E (exclusive) state lines.
2122 .It Li i
2123 Count operations affecting I (invalid) state lines.
2124 .It Li m
2125 Count operations affecting M (modified) state lines.
2126 .It Li s
2127 Count operations affecting S (shared) state lines.
2128 .El
2129 .Pp
2130 The default is to count operations affecting all (MESI) state lines.
2131 .It Li p6-l2-ld Op Li ,umask= Ns Ar qualifier
2132 Count the number of L2 data loads.
2133 An additional qualifier may be specified and comprises a list of the following
2134 keywords separated by
2135 .Ql +
2136 characters:
2137 .Pp
2138 .Bl -tag -width indent -compact
2139 .It Li both
2140 .Pq Tn "Pentium M"
2141 Count both hardware-prefetched lines and non-hardware-prefetched lines.
2142 .It Li e
2143 Count operations affecting E (exclusive) state lines.
2144 .It Li hw
2145 .Pq Tn "Pentium M"
2146 Count hardware-prefetched lines only.
2147 .It Li i
2148 Count operations affecting I (invalid) state lines.
2149 .It Li m
2150 Count operations affecting M (modified) state lines.
2151 .It Li nonhw
2152 .Pq Tn "Pentium M"
2153 Exclude hardware-prefetched lines.
2154 .It Li s
2155 Count operations affecting S (shared) state lines.
2156 .El
2157 .Pp
2158 The default on processors other than
2159 .Tn "Pentium M"
2160 processors is to count operations affecting all (MESI) state lines.
2161 The default on
2162 .Tn "Pentium M"
2163 processors is to count both hardware-prefetched and
2164 non-hardware-prefetch operations on all (MESI) state lines.
2165 .Pq Errata
2166 This event is affected by processor errata E53.
2167 .It Li p6-l2-lines-in Op Li ,umask= Ns Ar qualifier
2168 Count the number of L2 lines allocated.
2169 An additional qualifier may be specified and comprises a list of the following
2170 keywords separated by
2171 .Ql +
2172 characters:
2173 .Pp
2174 .Bl -tag -width indent -compact
2175 .It Li both
2176 .Pq Tn "Pentium M"
2177 Count both hardware-prefetched lines and non-hardware-prefetched lines.
2178 .It Li e
2179 Count operations affecting E (exclusive) state lines.
2180 .It Li hw
2181 .Pq Tn "Pentium M"
2182 Count hardware-prefetched lines only.
2183 .It Li i
2184 Count operations affecting I (invalid) state lines.
2185 .It Li m
2186 Count operations affecting M (modified) state lines.
2187 .It Li nonhw
2188 .Pq Tn "Pentium M"
2189 Exclude hardware-prefetched lines.
2190 .It Li s
2191 Count operations affecting S (shared) state lines.
2192 .El
2193 .Pp
2194 The default on processors other than
2195 .Tn "Pentium M"
2196 processors is to count operations affecting all (MESI) state lines.
2197 The default on
2198 .Tn "Pentium M"
2199 processors is to count both hardware-prefetched and
2200 non-hardware-prefetch operations on all (MESI) state lines.
2201 .Pq Errata
2202 This event is affected by processor errata E45.
2203 .It Li p6-l2-lines-out Op Li ,umask= Ns Ar qualifier
2204 Count the number of L2 lines evicted.
2205 An additional qualifier may be specified and comprises a list of the following
2206 keywords separated by
2207 .Ql +
2208 characters:
2209 .Pp
2210 .Bl -tag -width indent -compact
2211 .It Li both
2212 .Pq Tn "Pentium M"
2213 Count both hardware-prefetched lines and non-hardware-prefetched lines.
2214 .It Li e
2215 Count operations affecting E (exclusive) state lines.
2216 .It Li hw
2217 .Pq Tn "Pentium M"
2218 Count hardware-prefetched lines only.
2219 .It Li i
2220 Count operations affecting I (invalid) state lines.
2221 .It Li m
2222 Count operations affecting M (modified) state lines.
2223 .It Li nonhw
2224 .Pq Tn "Pentium M" only
2225 Exclude hardware-prefetched lines.
2226 .It Li s
2227 Count operations affecting S (shared) state lines.
2228 .El
2229 .Pp
2230 The default on processors other than
2231 .Tn "Pentium M"
2232 processors is to count operations affecting all (MESI) state lines.
2233 The default on
2234 .Tn "Pentium M"
2235 processors is to count both hardware-prefetched and
2236 non-hardware-prefetch operations on all (MESI) state lines.
2237 .Pq Errata
2238 This event is affected by processor errata E45.
2239 .It Li p6-l2-m-lines-inm
2240 Count the number of modified lines allocated in L2 cache.
2241 .It Li p6-l2-m-lines-outm Op Li ,umask= Ns Ar qualifier
2242 Count the number of L2 M-state lines evicted.
2243 .Pp
2244 .Pq Tn "Pentium M"
2245 On these processors an additional qualifier may be specified and
2246 comprises a list of the following keywords separated by
2247 .Ql +
2248 characters:
2249 .Pp
2250 .Bl -tag -width indent -compact
2251 .It Li both
2252 Count both hardware-prefetched lines and non-hardware-prefetched lines.
2253 .It Li hw
2254 Count hardware-prefetched lines only.
2255 .It Li nonhw
2256 Exclude hardware-prefetched lines.
2257 .El
2258 .Pp
2259 The default is to count both hardware-prefetched and
2260 non-hardware-prefetch operations.
2261 .Pq Errata
2262 This event is affected by processor errata E53.
2263 .It Li p6-l2-rqsts Op Li ,umask= Ns Ar qualifier
2264 Count the total number of L2 requests.
2265 An additional qualifier may be specified and comprises a list of the following
2266 keywords separated by
2267 .Ql +
2268 characters:
2269 .Pp
2270 .Bl -tag -width indent -compact
2271 .It Li e
2272 Count operations affecting E (exclusive) state lines.
2273 .It Li i
2274 Count operations affecting I (invalid) state lines.
2275 .It Li m
2276 Count operations affecting M (modified) state lines.
2277 .It Li s
2278 Count operations affecting S (shared) state lines.
2279 .El
2280 .Pp
2281 The default is to count operations affecting all (MESI) state lines.
2282 .It Li p6-l2-st
2283 Count the number of L2 data stores.
2284 An additional qualifier may be specified and comprises a list of the following
2285 keywords separated by
2286 .Ql +
2287 characters:
2288 .Pp
2289 .Bl -tag -width indent -compact
2290 .It Li e
2291 Count operations affecting E (exclusive) state lines.
2292 .It Li i
2293 Count operations affecting I (invalid) state lines.
2294 .It Li m
2295 Count operations affecting M (modified) state lines.
2296 .It Li s
2297 Count operations affecting S (shared) state lines.
2298 .El
2299 .Pp
2300 The default is to count operations affecting all (MESI) state lines.
2301 .It Li p6-ld-blocks
2302 Count the number of load operations delayed due to store buffer blocks.
2303 .It Li p6-misalign-mem-ref
2304 Count the number of misaligned data memory references (crossing a 64
2305 bit boundary).
2306 .It Li p6-mmx-assist
2307 .Pq Tn "Pentium II" , Tn "Pentium III"
2308 Count the number of MMX assists executed.
2309 .It Li p6-mmx-instr-exec
2310 .Pq Tn Celeron , Tn "Pentium II"
2311 Count the number of MMX instructions executed, except MOVQ and MOVD
2312 stores from register to memory.
2313 .It Li p6-mmx-instr-ret
2314 .Pq Tn "Pentium II"
2315 Count the number of MMX instructions retired.
2316 .It Li p6-mmx-instr-type-exec Op Li ,umask= Ns Ar qualifier
2317 .Pq Tn "Pentium II" , Tn "Pentium III"
2318 Count the number of MMX instructions executed.
2319 An additional qualifier may be specified and comprises a list of
2320 the following keywords separated by
2321 .Ql +
2322 characters:
2323 .Pp
2324 .Bl -tag -width indent -compact
2325 .It Li pack
2326 Count MMX pack operation instructions.
2327 .It Li packed-arithmetic
2328 Count MMX packed arithmetic instructions.
2329 .It Li packed-logical
2330 Count MMX packed logical instructions.
2331 .It Li packed-multiply
2332 Count MMX packed multiply instructions.
2333 .It Li packed-shift
2334 Count MMX packed shift instructions.
2335 .It Li unpack
2336 Count MMX unpack operation instructions.
2337 .El
2338 .Pp
2339 The default is to count all operations.
2340 .It Li p6-mmx-sat-instr-exec
2341 .Pq Tn "Pentium II" , Tn "Pentium III"
2342 Count the number of MMX saturating instructions executed.
2343 .It Li p6-mmx-uops-exec
2344 .Pq Tn "Pentium II" , Tn "Pentium III"
2345 Count the number of MMX micro-ops executed.
2346 .It Li p6-mul
2347 Count the number of integer and floating-point multiplies, including
2348 speculative multiplies.
2349 This event is only allocated on counter 1.
2350 .It Li p6-partial-rat-stalls
2351 Count the number of cycles or events for partial stalls.
2352 .It Li p6-resource-stalls
2353 Count the number of cycles there was a resource related stall of any kind.
2354 .It Li p6-ret-seg-renames
2355 .Pq Tn "Pentium II" , Tn "Pentium III"
2356 Count the number of segment register rename events retired.
2357 .It Li p6-sb-drains
2358 Count the number of cycles the store buffer is draining.
2359 .It Li p6-seg-reg-renames Op Li ,umask= Ns Ar qualifier
2360 .Pq Tn "Pentium II" , Tn "Pentium III"
2361 Count the number of segment register renames.
2362 An additional qualifier may be specified, and comprises a list of the
2363 following keywords separated by
2364 .Ql +
2365 characters:
2366 .Pp
2367 .Bl -tag -width indent -compact
2368 .It Li ds
2369 Count renames for segment register DS.
2370 .It Li es
2371 Count renames for segment register ES.
2372 .It Li fs
2373 Count renames for segment register FS.
2374 .It Li gs
2375 Count renames for segment register GS.
2376 .El
2377 .Pp
2378 The default is to count operations affecting all segment registers.
2379 .It Li p6-seg-rename-stalls
2380 .Pq Tn "Pentium II" , Tn "Pentium III"
2381 Count the number of segment register renaming stalls.
2382 An additional qualifier may be specified, and comprises a list of the
2383 following keywords separated by
2384 .Ql +
2385 characters:
2386 .Pp
2387 .Bl -tag -width indent -compact
2388 .It Li ds
2389 Count stalls for segment register DS.
2390 .It Li es
2391 Count stalls for segment register ES.
2392 .It Li fs
2393 Count stalls for segment register FS.
2394 .It Li gs
2395 Count stalls for segment register GS.
2396 .El
2397 .Pp
2398 The default is to count operations affecting all the segment registers.
2399 .It Li p6-segment-reg-loads
2400 Count the number of segment register loads.
2401 .It Li p6-uops-retired
2402 Count the number of micro-ops retired.
2403 .El
2404 .Ss Intel P4 PMCS
2405 Intel P4 PMCs are present in Intel
2406 .Tn "Pentium 4"
2407 and
2408 .Tn Xeon
2409 processors.
2410 These PMCs are documented in
2411 .Rs
2412 .%B "IA-32 Intel(R) Architecture Software Developer's Manual"
2413 .%T "Volume 3: System Programming Guide"
2414 .%N "Order Number 245472-012"
2415 .%D 2003
2416 .%Q "Intel Corporation"
2417 .Re
2418 Further information about using these PMCs may be found in
2419 .Rs
2420 .%B "IA-32 Intel(R) Architecture Optimization Guide"
2421 .%D 2003
2422 .%N "Order Number 248966-009"
2423 .%Q "Intel Corporation"
2424 .Re
2425 Some of these events are affected by processor errata described in
2426 .Rs
2427 .%B "Intel(R) Pentium(R) 4 Processor Specification Update"
2428 .%N "Document Number: 249199-059"
2429 .%D "April 2005"
2430 .%Q "Intel Corporation"
2431 .Re
2432 .Pp
2433 Event specifiers for Intel P4 PMCs can have the following common
2434 qualifiers:
2435 .Bl -tag -width indent
2436 .It Li active= Ns Ar choice
2437 (On P4 HTT CPUs) Filter event counting based on which logical
2438 processors are active.
2439 The allowed values of
2440 .Ar choice
2441 are:
2442 .Pp
2443 .Bl -tag -width indent -compact
2444 .It Li any
2445 Count when either logical processor is active.
2446 .It Li both
2447 Count when both logical processors are active.
2448 .It Li none
2449 Count only when neither logical processor is active.
2450 .It Li single
2451 Count only when one logical processor is active.
2452 .El
2453 .Pp
2454 The default is
2455 .Dq Li both .
2456 .It Li cascade
2457 Configure the PMC to cascade onto its partner.
2458 See
2459 .Sx "Cascading P4 PMCs"
2460 below for more information.
2461 .It Li edge
2462 Configure the counter to count false to true transitions of the threshold
2463 comparision output.
2464 This qualifier only takes effect if a threshold qualifier has also been
2465 specified.
2466 .It Li complement
2467 Configure the counter to increment only when the event count seen is
2468 less than the threshold qualifier value specified.
2469 .It Li mask= Ns Ar qualifier
2470 Many event specifiers for Intel P4 PMCs need to be additionally
2471 qualified using a mask qualifier.
2472 The allowed syntax for these qualifiers is event specific and is
2473 described along with the events.
2474 .It Li os
2475 Configure the PMC to count when the CPL of the processor is 0.
2476 .It Li precise
2477 Select precise event based sampling.
2478 Precise sampling is supported by the hardware for a limited set of
2479 events.
2480 .It Li tag= Ns Ar value
2481 Configure the PMC to tag the internal uop selected by the other
2482 fields in this event specifier with value
2483 .Ar value .
2484 This feature is used when cascading PMCs.
2485 .It Li threshold= Ns Ar value
2486 Configure the PMC to increment only when the event counts seen are
2487 greater than the specified threshold value
2488 .Ar value .
2489 .It Li usr
2490 Configure the PMC to count when the CPL of the processor is 1, 2 or 3.
2491 .El
2492 .Pp
2493 If neither of the
2494 .Dq Li os
2495 or
2496 .Dq Li usr
2497 qualifiers are specified, the default is to enable both.
2498 .Pp
2499 On Intel Pentium 4 processors with HTT, events are
2500 divided into two classes:
2501 .Pp
2502 .Bl -tag -width indent -compact
2503 .It "TS Events"
2504 are those where hardware can differentiate between events
2505 generated on one logical processor from those generated on the
2506 other.
2507 .It "TI Events"
2508 are those where hardware cannot differentiate between events
2509 generated by multiple logical processors in a package.
2510 .El
2511 .Pp
2512 Only TS events are allowed for use with process-mode PMCs on
2513 Pentium-4/HTT CPUs.
2514 .Pp
2515 The event specifiers supported by Intel P4 PMCs are:
2516 .Pp
2517 .Bl -tag -width indent
2518 .It Li p4-128bit-mmx-uop Op Li ,mask= Ns Ar flags
2519 .Pq "TI event"
2520 Count integer SIMD SSE2 instructions that operate on 128 bit SIMD
2521 operands.
2522 Qualifier
2523 .Ar flags
2524 can take the following value (which is also the default):
2525 .Pp
2526 .Bl -tag -width indent -compact
2527 .It Li all
2528 Count all uops operating on 128 bit SIMD integer operands in memory or
2529 XMM register.
2530 .El
2531 .Pp
2532 If an instruction contains more than one 128 bit MMX uop, then each
2533 uop will be counted.
2534 .It Li p4-64bit-mmx-uop Op Li ,mask= Ns Ar flags
2535 .Pq "TI event"
2536 Count MMX instructions that operate on 64 bit SIMD operands.
2537 Qualifier
2538 .Ar flags
2539 can take the following value (which is also the default):
2540 .Pp
2541 .Bl -tag -width indent -compact
2542 .It Li all
2543 Count all uops operating on 64 bit SIMD integer operands in memory or
2544 in MMX registers.
2545 .El
2546 .Pp
2547 If an instruction contains more than one 64 bit MMX uop, then each
2548 uop will be counted.
2549 .It Li p4-b2b-cycles
2550 .Pq "TI event"
2551 Count back-to-back bus cycles.
2552 Further documentation for this event is unavailable.
2553 .It Li p4-bnr
2554 .Pq "TI event"
2555 Count bus-not-ready conditions.
2556 Further documentation for this event is unavailable.
2557 .It Li p4-bpu-fetch-request Op Li ,mask= Ns Ar qualifier
2558 .Pq "TS event"
2559 Count instruction fetch requests qualified by additional
2560 flags specified in
2561 .Ar qualifier .
2562 At this point only one flag is supported:
2563 .Pp
2564 .Bl -tag -width indent -compact
2565 .It Li tcmiss
2566 Count trace cache lookup misses.
2567 .El
2568 .Pp
2569 The default qualifier is also
2570 .Dq Li mask=tcmiss .
2571 .It Li p4-branch-retired Op Li ,mask= Ns Ar flags
2572 .Pq "TS event"
2573 Counts retired branches.
2574 Qualifier
2575 .Ar flags
2576 is a list of the following
2577 .Ql +
2578 separated strings:
2579 .Pp
2580 .Bl -tag -width indent -compact
2581 .It Li mmnp
2582 Count branches not-taken and predicted.
2583 .It Li mmnm
2584 Count branches not-taken and mis-predicted.
2585 .It Li mmtp
2586 Count branches taken and predicted.
2587 .It Li mmtm
2588 Count branches taken and mis-predicted.
2589 .El
2590 .Pp
2591 The default qualifier counts all four kinds of branches.
2592 .It Li p4-bsq-active-entries Op Li ,mask= Ns Ar qualifier
2593 .Pq "TS event"
2594 Count the number of entries (clipped at 15) currently active in the
2595 BSQ.
2596 Qualifier
2597 .Ar qualifier
2598 is a
2599 .Ql +
2600 separated set of the following flags:
2601 .Pp
2602 .Bl -tag -width indent -compact
2603 .It Li req-type0 , Li req-type1
2604 Forms a 2-bit number used to select the request type encoding:
2605 .Pp
2606 .Bl -tag -width indent -compact
2607 .It Li 0
2608 reads excluding read invalidate
2609 .It Li 1
2610 read invalidates
2611 .It Li 2
2612 writes other than writebacks
2613 .It Li 3
2614 writebacks
2615 .El
2616 .Pp
2617 Bit
2618 .Dq Li req-type1
2619 is the MSB for this two bit number.
2620 .It Li req-len0 , Li req-len1
2621 Forms a two-bit number that specifies the request length encoding:
2622 .Pp
2623 .Bl -tag -width indent -compact
2624 .It Li 0
2625 0 chunks
2626 .It Li 1
2627 1 chunk
2628 .It Li 3
2629 8 chunks
2630 .El
2631 .Pp
2632 Bit
2633 .Dq Li req-len1
2634 is the MSB for this two bit number.
2635 .It Li req-io-type
2636 Count requests that are input or output requests.
2637 .It Li req-lock-type
2638 Count requests that lock the bus.
2639 .It Li req-lock-cache
2640 Count requests that lock the cache.
2641 .It Li req-split-type
2642 Count requests that is a bus 8-byte chunk that is split across an
2643 8-byte boundary.
2644 .It Li req-dem-type
2645 Count requests that are demand (not prefetches) if set.
2646 Count requests that are prefetches if not set.
2647 .It Li req-ord-type
2648 Count requests that are ordered.
2649 .It Li mem-type0 , Li mem-type1 , Li mem-type2
2650 Forms a 3-bit number that specifies a memory type encoding:
2651 .Pp
2652 .Bl -tag -width indent -compact
2653 .It Li 0
2654 UC
2655 .It Li 1
2656 USWC
2657 .It Li 4
2658 WT
2659 .It Li 5
2660 WP
2661 .It Li 6
2662 WB
2663 .El
2664 .Pp
2665 Bit
2666 .Dq Li mem-type2
2667 is the MSB of this 3-bit number.
2668 .El
2669 .Pp
2670 The default qualifier has all the above bits set.
2671 .Pp
2672 Edge triggering using the
2673 .Dq Li edge
2674 qualifier should not be used with this event when counting cycles.
2675 .It Li p4-bsq-allocation Op Li ,mask= Ns Ar qualifier
2676 .Pq "TS event"
2677 Count allocations in the bus sequence unit according to the flags
2678 specified in
2679 .Ar qualifier ,
2680 which is a
2681 .Ql +
2682 separated set of the following flags:
2683 .Pp
2684 .Bl -tag -width indent -compact
2685 .It Li req-type0 , Li req-type1
2686 Forms a 2-bit number used to select the request type encoding:
2687 .Pp
2688 .Bl -tag -width indent -compact
2689 .It Li 0
2690 reads excluding read invalidate
2691 .It Li 1
2692 read invalidates
2693 .It Li 2
2694 writes other than writebacks
2695 .It Li 3
2696 writebacks
2697 .El
2698 .Pp
2699 Bit
2700 .Dq Li req-type1
2701 is the MSB for this two bit number.
2702 .It Li req-len0 , Li req-len1
2703 Forms a two-bit number that specifies the request length encoding:
2704 .Pp
2705 .Bl -tag -width indent -compact
2706 .It Li 0
2707 0 chunks
2708 .It Li 1
2709 1 chunk
2710 .It Li 3
2711 8 chunks
2712 .El
2713 .Pp
2714 Bit
2715 .Dq Li req-len1
2716 is the MSB for this two bit number.
2717 .It Li req-io-type
2718 Count requests that are input or output requests.
2719 .It Li req-lock-type
2720 Count requests that lock the bus.
2721 .It Li req-lock-cache
2722 Count requests that lock the cache.
2723 .It Li req-split-type
2724 Count requests that is a bus 8-byte chunk that is split across an
2725 8-byte boundary.
2726 .It Li req-dem-type
2727 Count requests that are demand (not prefetches) if set.
2728 Count requests that are prefetches if not set.
2729 .It Li req-ord-type
2730 Count requests that are ordered.
2731 .It Li mem-type0 , Li mem-type1 , Li mem-type2
2732 Forms a 3-bit number that specifies a memory type encoding:
2733 .Pp
2734 .Bl -tag -width indent -compact
2735 .It Li 0
2736 UC
2737 .It Li 1
2738 USWC
2739 .It Li 4
2740 WT
2741 .It Li 5
2742 WP
2743 .It Li 6
2744 WB
2745 .El
2746 .Pp
2747 Bit
2748 .Dq Li mem-type2
2749 is the MSB of this 3-bit number.
2750 .El
2751 .Pp
2752 The default qualifier has all the above bits set.
2753 .Pp
2754 This event is usually used along with the
2755 .Dq Li edge
2756 qualifier to avoid multiple counting.
2757 .It Li p4-bsq-cache-reference Op Li ,mask= Ns Ar qualifier
2758 .Pq "TS event"
2759 Count cache references as seen by the bus unit (2nd or 3rd level
2760 cache references).
2761 Qualifier
2762 .Ar qualifier
2763 is a
2764 .Ql +
2765 separated list of the following keywords:
2766 .Pp
2767 .Bl -tag -width indent -compact
2768 .It Li rd-2ndl-hits
2769 Count 2nd level cache hits in the shared state.
2770 .It Li rd-2ndl-hite
2771 Count 2nd level cache hits in the exclusive state.
2772 .It Li rd-2ndl-hitm
2773 Count 2nd level cache hits in the modified state.
2774 .It Li rd-3rdl-hits
2775 Count 3rd level cache hits in the shared state.
2776 .It Li rd-3rdl-hite
2777 Count 3rd level cache hits in the exclusive state.
2778 .It Li rd-3rdl-hitm
2779 Count 3rd level cache hits in the modified state.
2780 .It Li rd-2ndl-miss
2781 Count 2nd level cache misses.
2782 .It Li rd-3rdl-miss
2783 Count 3rd level cache misses.
2784 .It Li wr-2ndl-miss
2785 Count write-back lookups from the data access cache that miss the 2nd
2786 level cache.
2787 .El
2788 .Pp
2789 The default is to count all the above events.
2790 .It Li p4-execution-event Op Li ,mask= Ns Ar flags
2791 .Pq "TS event"
2792 Count the retirement of tagged uops selected through the execution
2793 tagging mechanism.
2794 Qualifier
2795 .Ar flags
2796 can contain the following strings separated by
2797 .Ql +
2798 characters:
2799 .Pp
2800 .Bl -tag -width indent -compact
2801 .It Li nbogus0 , Li nbogus1 , Li nbogus2 , Li nbogus3
2802 The marked uops are not bogus.
2803 .It Li bogus0 , Li bogus1 , Li bogus2 , Li bogus3
2804 The marked uops are bogus.
2805 .El
2806 .Pp
2807 This event requires additional (upstream) events to be allocated to
2808 perform the desired uop tagging.
2809 The default is to set all the above flags.
2810 This event can be used for precise event based sampling.
2811 .It Li p4-front-end-event Op Li ,mask= Ns Ar flags
2812 .Pq "TS event"
2813 Count the retirement of tagged uops selected through the front-end
2814 tagging mechanism.
2815 Qualifier
2816 .Ar flags
2817 can contain the following strings separated by
2818 .Ql +
2819 characters:
2820 .Pp
2821 .Bl -tag -width indent -compact
2822 .It Li nbogus
2823 The marked uops are not bogus.
2824 .It Li bogus
2825 The marked uops are bogus.
2826 .El
2827 .Pp
2828 This event requires additional (upstream) events to be allocated to
2829 perform the desired uop tagging.
2830 The default is to select both kinds of events.
2831 This event can be used for precise event based sampling.
2832 .It Li p4-fsb-data-activity Op Li ,mask= Ns Ar flags
2833 .Pq "TI event"
2834 Count each DBSY or DRDY event selected by qualifier
2835 .Ar flags .
2836 Qualifier
2837 .Ar flags
2838 is a
2839 .Ql +
2840 separated set of the following flags:
2841 .Pp
2842 .Bl -tag -width indent -compact
2843 .It Li drdy-drv
2844 Count when this processor is driving data onto the bus.
2845 .It Li drdy-own
2846 Count when this processor is reading data from the bus.
2847 .It Li drdy-other
2848 Count when data is on the bus but not being sampled by this processor.
2849 .It Li dbsy-drv
2850 Count when this processor reserves the bus for use in the next cycle
2851 in order to drive data.
2852 .It Li dbsy-own
2853 Count when some agent reserves the bus for use in the next bus cycle
2854 to drive data that this processor will sample.
2855 .It Li dbsy-other
2856 Count when some agent reserves the bus for use in the next bus cycle
2857 to drive data that this processor will not sample.
2858 .El
2859 .Pp
2860 Flags
2861 .Dq Li drdy-own
2862 and
2863 .Dq Li drdy-other
2864 are mutually exclusive.
2865 Flags
2866 .Dq Li dbsy-own
2867 and
2868 .Dq Li dbsy-other
2869 are mutually exclusive.
2870 The default value for
2871 .Ar qualifier
2872 is
2873 .Dq Li drdy-drv+drdy-own+dbsy-drv+dbsy-own .
2874 .It Li p4-global-power-events Op Li ,mask= Ns Ar flags
2875 .Pq "TS event"
2876 Count cycles during which the processor is not stopped.
2877 Qualifier
2878 .Ar flags
2879 can take the following value (which is also the default):
2880 .Pp
2881 .Bl -tag -width indent -compact
2882 .It Li running
2883 Count cycles when the processor is active.
2884 .El
2885 .Pp
2886 .It Li p4-instr-retired Op Li ,mask= Ns Ar flags
2887 .Pq "TS event"
2888 Count instructions retired during a clock cycle.
2889 Qualifer
2890 .Ar flags
2891 comprises of the following strings separated by
2892 .Ql +
2893 characters:
2894 .Pp
2895 .Bl -tag -width indent -compact
2896 .It Li nbogusntag
2897 Count non-bogus instructions that are not tagged.
2898 .It Li nbogustag
2899 Count non-bogus instructions that are tagged.
2900 .It Li bogusntag
2901 Count bogus instructions that are not tagged.
2902 .It Li bogustag
2903 Count bogus instructions that are tagged.
2904 .El
2905 .Pp
2906 The default qualifier counts all the above kinds of instructions.
2907 .It Li p4-ioq-active-entries Xo
2908 .Op Li ,mask= Ns Ar qualifier
2909 .Op Li ,busreqtype= Ns Ar req-type
2910 .Xc
2911 .Pq "TS event"
2912 Count the number of entries (clipped at 15) in the IOQ that are
2913 active.
2914 The event masks are specified by qualifier
2915 .Ar qualifier
2916 and
2917 .Ar req-type .
2918 .Pp
2919 Qualifier
2920 .Ar qualifier
2921 is a
2922 .Ql +
2923 separated set of the following flags:
2924 .Pp
2925 .Bl -tag -width indent -compact
2926 .It Li all-read
2927 Count read entries.
2928 .It Li all-write
2929 Count write entries.
2930 .It Li mem-uc
2931 Count entries accessing uncacheable memory.
2932 .It Li mem-wc
2933 Count entries accessing write-combining memory.
2934 .It Li mem-wt
2935 Count entries accessing write-through memory.
2936 .It Li mem-wp
2937 Count entries accessing write-protected memory
2938 .It Li mem-wb
2939 Count entries accessing write-back memory.
2940 .It Li own
2941 Count store requests driven by the processor (i.e., not by other
2942 processors or by DMA).
2943 .It Li other
2944 Count store requests driven by other processors or by DMA.
2945 .It Li prefetch
2946 Include hardware and software prefetch requests in the count.
2947 .El
2948 .Pp
2949 The default value for
2950 .Ar qualifier
2951 is to enable all the above flags.
2952 .Pp
2953 The
2954 .Ar req-type
2955 qualifier is a 5-bit number can be additionally used to select a
2956 specific bus request type.
2957 The default is 0.
2958 .Pp
2959 The
2960 .Dq Li edge
2961 qualifier should not be used when counting cycles with this event.
2962 The exact behaviour of this event depends on the processor revision.
2963 .It Li p4-ioq-allocation Xo
2964 .Op Li ,mask= Ns Ar qualifier
2965 .Op Li ,busreqtype= Ns Ar req-type
2966 .Xc
2967 .Pq "TS event"
2968 Count various types of transactions on the bus matching the flags set
2969 in
2970 .Ar qualifier
2971 and
2972 .Ar req-type .
2973 .Pp
2974 Qualifier
2975 .Ar qualifier
2976 is a
2977 .Ql +
2978 separated set of the following flags:
2979 .Pp
2980 .Bl -tag -width indent -compact
2981 .It Li all-read
2982 Count read entries.
2983 .It Li all-write
2984 Count write entries.
2985 .It Li mem-uc
2986 Count entries accessing uncacheable memory.
2987 .It Li mem-wc
2988 Count entries accessing write-combining memory.
2989 .It Li mem-wt
2990 Count entries accessing write-through memory.
2991 .It Li mem-wp
2992 Count entries accessing write-protected memory
2993 .It Li mem-wb
2994 Count entries accessing write-back memory.
2995 .It Li own
2996 Count store requests driven by the processor (i.e., not by other
2997 processors or by DMA).
2998 .It Li other
2999 Count store requests driven by other processors or by DMA.
3000 .It Li prefetch
3001 Include hardware and software prefetch requests in the count.
3002 .El
3003 .Pp
3004 The default value for
3005 .Ar qualifier
3006 is to enable all the above flags.
3007 .Pp
3008 The
3009 .Ar req-type
3010 qualifier is a 5-bit number can be additionally used to select a
3011 specific bus request type.
3012 The default is 0.
3013 .Pp
3014 The
3015 .Dq Li edge
3016 qualifier is normally used with this event to prevent multiple
3017 counting.
3018 The exact behaviour of this event depends on the processor revision.
3019 .It Li p4-itlb-reference Op mask= Ns Ar qualifier
3020 .Pq "TS event"
3021 Count translations using the intruction translation look-aside
3022 buffer.
3023 The
3024 .Ar qualifier
3025 argument is a list of the following strings separated by
3026 .Ql +
3027 characters.
3028 .Pp
3029 .Bl -tag -width indent -compact
3030 .It Li hit
3031 Count ITLB hits.
3032 .It Li miss
3033 Count ITLB misses.
3034 .It Li hit-uc
3035 Count uncacheable ITLB hits.
3036 .El
3037 .Pp
3038 If no
3039 .Ar qualifier
3040 is specified the default is to count all the three kinds of ITLB
3041 translations.
3042 .It Li p4-load-port-replay Op Li ,mask= Ns Ar qualifier
3043 .Pq "TS event"
3044 Count replayed events at the load port.
3045 Qualifier
3046 .Ar qualifier
3047 can take on one value:
3048 .Pp
3049 .Bl -tag -width indent -compact
3050 .It Li split-ld
3051 Count split loads.
3052 .El
3053 .Pp
3054 The default value for
3055 .Ar qualifier
3056 is
3057 .Dq Li split-ld .
3058 .It Li p4-mispred-branch-retired Op Li ,mask= Ns Ar flags
3059 .Pq "TS event"
3060 Count mispredicted IA-32 branch instructions.
3061 Qualifier
3062 .Ar flags
3063 can take the following value (which is also the default):
3064 .Pp
3065 .Bl -tag -width indent -compact
3066 .It Li nbogus
3067 Count non-bogus retired branch instructions.
3068 .El
3069 .It Li p4-machine-clear Op Li ,mask= Ns Ar flags
3070 .Pq "TS event"
3071 Count the number of pipeline clears seen by the processor.
3072 Qualifer
3073 .Ar flags
3074 is a list of the following strings separated by
3075 .Ql +
3076 characters:
3077 .Pp
3078 .Bl -tag -width indent -compact
3079 .It Li clear
3080 Count for a portion of the many cycles when the machine is being
3081 cleared for any reason.
3082 .It Li moclear
3083 Count machine clears due to memory ordering issues.
3084 .It Li smclear
3085 Count machine clears due to self-modifying code.
3086 .El
3087 .Pp
3088 Use qualifier
3089 .Dq Li edge
3090 to get a count of occurrences of machine clears.
3091 The default qualifier is
3092 .Dq Li clear .
3093 .It Li p4-memory-cancel Op Li ,mask= Ns Ar event-list
3094 .Pq "TS event"
3095 Count the cancelling of various kinds of requests in the data cache
3096 address control unit of the CPU.
3097 The qualifier
3098 .Ar event-list
3099 is a list of the following strings separated by
3100 .Ql +
3101 characters:
3102 .Pp
3103 .Bl -tag -width indent -compact
3104 .It Li st-rb-full
3105 Requests cancelled because no store request buffer was available.
3106 .It Li 64k-conf
3107 Requests that conflict due to 64K aliasing.
3108 .El
3109 .Pp
3110 If
3111 .Ar event-list
3112 is not specified, then the default is to count both kinds of events.
3113 .It Li p4-memory-complete Op Li ,mask= Ns Ar event-list
3114 .Pq "TS event"
3115 Count the completion of load split, store split, uncacheable split and
3116 uncacheable load operations selected by qualifier
3117 .Ar event-list .
3118 The qualifier
3119 .Ar event-list
3120 is a
3121 .Ql +
3122 separated list of the following flags:
3123 .Pp
3124 .Bl -tag -width indent -compact
3125 .It Li lsc
3126 Count load splits completed, excluding loads from uncacheable or
3127 write-combining areas.
3128 .It Li ssc
3129 Count any split stores completed.
3130 .El
3131 .Pp
3132 The default is to count both kinds of operations.
3133 .It Li p4-mob-load-replay Op Li ,mask= Ns Ar qualifier
3134 .Pq "TS event"
3135 Count load replays triggered by the memory order buffer.
3136 Qualifier
3137 .Ar qualifier
3138 can be a
3139 .Ql +
3140 separated list of the following flags:
3141 .Pp
3142 .Bl -tag -width indent -compact
3143 .It Li no-sta
3144 Count replays because of unknown store addresses.
3145 .It Li no-std
3146 Count replays because of unknown store data.
3147 .It Li partial-data
3148 Count replays because of partially overlapped data accesses between
3149 load and store operations.
3150 .It Li unalgn-addr
3151 Count replays because of mismatches in the lower 4 bits of load and
3152 store operations.
3153 .El
3154 .Pp
3155 The default qualifier is
3156 .Ar no-sta+no-std+partial-data+unalgn-addr .
3157 .It Li p4-packed-dp-uop Op Li ,mask= Ns Ar flags
3158 .Pq "TI event"
3159 Count packed double-precision uops.
3160 Qualifier
3161 .Ar flags
3162 can take the following value (which is also the default):
3163 .Pp
3164 .Bl -tag -width indent -compact
3165 .It Li all
3166 Count all uops operating on packed double-precision operands.
3167 .El
3168 .It Li p4-packed-sp-uop Op Li ,mask= Ns Ar flags
3169 .Pq "TI event"
3170 Count packed single-precision uops.
3171 Qualifier
3172 .Ar flags
3173 can take the following value (which is also the default):
3174 .Pp
3175 .Bl -tag -width indent -compact
3176 .It Li all
3177 Count all uops operating on packed single-precision operands.
3178 .El
3179 .It Li p4-page-walk-type Op Li ,mask= Ns Ar qualifier
3180 .Pq "TI event"
3181 Count page walks performed by the page miss handler.
3182 Qualifier
3183 .Ar qualifier
3184 can be a
3185 .Ql +
3186 separated list of the following keywords:
3187 .Pp
3188 .Bl -tag -width indent -compact
3189 .It Li dtmiss
3190 Count page walks for data TLB misses.
3191 .It Li itmiss
3192 Count page walks for instruction TLB misses.
3193 .El
3194 .Pp
3195 The default value for
3196 .Ar qualifier
3197 is
3198 .Dq Li dtmiss+itmiss .
3199 .It Li p4-replay-event Op Li ,mask= Ns Ar flags
3200 .Pq "TS event"
3201 Count the retirement of tagged uops selected through the replay
3202 tagging mechanism.
3203 Qualifier
3204 .Ar flags
3205 contains a
3206 .Ql +
3207 separated set of the following strings:
3208 .Pp
3209 .Bl -tag -width indent -compact
3210 .It Li nbogus
3211 The marked uops are not bogus.
3212 .It Li bogus
3213 The marked uops are bogus.
3214 .El
3215 .Pp
3216 This event requires additional (upstream) events to be allocated to
3217 perform the desired uop tagging.
3218 The default qualifier counts both kinds of uops.
3219 This event can be used for precise event based sampling.
3220 .It Li p4-resource-stall Op Li ,mask= Ns Ar flags
3221 .Pq "TS event"
3222 Count the occurrence or latency of stalls in the allocator.
3223 Qualifier
3224 .Ar flags
3225 can take the following value (which is also the default):
3226 .Pp
3227 .Bl -tag -width indent -compact
3228 .It Li sbfull
3229 A stall due to the lack of store buffers.
3230 .El
3231 .It Li p4-response
3232 .Pq "TI event"
3233 Count different types of responses.
3234 Further documentation on this event is not available.
3235 .It Li p4-retired-branch-type Op Li ,mask= Ns Ar flags
3236 .Pq "TS event"
3237 Count branches retired.
3238 Qualifier
3239 .Ar flags
3240 contains a
3241 .Ql +
3242 separated list of strings:
3243 .Pp
3244 .Bl -tag -width indent -compact
3245 .It Li conditional
3246 Count conditional jumps.
3247 .It Li call
3248 Count direct and indirect call branches.
3249 .It Li return
3250 Count return branches.
3251 .It Li indirect
3252 Count returns, indirect calls or indirect jumps.
3253 .El
3254 .Pp
3255 The default qualifier counts all the above branch types.
3256 .It Li p4-retired-mispred-branch-type Op Li ,mask= Ns Ar flags
3257 .Pq "TS event"
3258 Count mispredicted branches retired.
3259 Qualifier
3260 .Ar flags
3261 contains a
3262 .Ql +
3263 separated list of strings:
3264 .Pp
3265 .Bl -tag -width indent -compact
3266 .It Li conditional
3267 Count conditional jumps.
3268 .It Li call
3269 Count indirect call branches.
3270 .It Li return
3271 Count return branches.
3272 .It Li indirect
3273 Count returns, indirect calls or indirect jumps.
3274 .El
3275 .Pp
3276 The default qualifier counts all the above branch types.
3277 .It Li p4-scalar-dp-uop Op Li ,mask= Ns Ar flags
3278 .Pq "TI event"
3279 Count the number of scalar double-precision uops.
3280 Qualifier
3281 .Ar flags
3282 can take the following value (which is also the default):
3283 .Pp
3284 .Bl -tag -width indent -compact
3285 .It Li all
3286 Count the number of scalar double-precision uops.
3287 .El
3288 .It Li p4-scalar-sp-uop Op Li ,mask= Ns Ar flags
3289 .Pq "TI event"
3290 Count the number of scalar single-precision uops.
3291 Qualifier
3292 .Ar flags
3293 can take the following value (which is also the default):
3294 .Pp
3295 .Bl -tag -width indent -compact
3296 .It Li all
3297 Count all uops operating on scalar single-precision operands.
3298 .El
3299 .It Li p4-snoop
3300 .Pq "TI event"
3301 Count snoop traffic.
3302 Further documentation on this event is not available.
3303 .It Li p4-sse-input-assist Op Li ,mask= Ns Ar flags
3304 .Pq "TI event"
3305 Count the number of times an assist is required to handle problems
3306 with the operands for SSE and SSE2 operations.
3307 Qualifier
3308 .Ar flags
3309 can take the following value (which is also the default):
3310 .Pp
3311 .Bl -tag -width indent -compact
3312 .It Li all
3313 Count assists for all SSE and SSE2 uops.
3314 .El
3315 .It Li p4-store-port-replay Op Li ,mask= Ns Ar qualifier
3316 .Pq "TS event"
3317 Count events replayed at the store port.
3318 Qualifier
3319 .Ar qualifier
3320 can take on one value:
3321 .Pp
3322 .Bl -tag -width indent -compact
3323 .It Li split-st
3324 Count split stores.
3325 .El
3326 .Pp
3327 The default value for
3328 .Ar qualifier
3329 is
3330 .Dq Li split-st .
3331 .It Li p4-tc-deliver-mode Op Li ,mask= Ns Ar qualifier
3332 .Pq "TI event"
3333 Count the duration in cycles of operating modes of the trace cache and
3334 decode engine.
3335 The desired operating mode is selected by
3336 .Ar qualifier ,
3337 which is a list of the following strings separated by
3338 .Ql +
3339 characters:
3340 .Pp
3341 .Bl -tag -width indent -compact
3342 .It Li DD
3343 Both logical processors are in deliver mode.
3344 .It Li DB
3345 Logical processor 0 is in deliver mode while logical processor 1 is in
3346 build mode.
3347 .It Li DI
3348 Logical processor 0 is in deliver mode while logical processor 1 is
3349 halted, or in machine clear, or transitioning to a long microcode
3350 flow.
3351 .It Li BD
3352 Logical processor 0 is in build mode while logical processor 1 is in
3353 deliver mode.
3354 .It Li BB
3355 Both logical processors are in build mode.
3356 .It Li BI
3357 Logical processor 0 is in build mode while logical processor 1 is
3358 halted, or in machine clear or transitioning to a long microcode
3359 flow.
3360 .It Li ID
3361 Logical processor 0 is halted, or in machine clear or transitioning to
3362 a long microcode flow while logical processor 1 is in deliver mode.
3363 .It Li IB
3364 Logical processor 0 is halted, or in machine clear or transitioning to
3365 a long microcode flow while logical processor 1 is in build mode.
3366 .El
3367 .Pp
3368 If there is only one logical processor in the processor package then
3369 the qualifier for logical processor 1 is ignored.
3370 If no qualifier is specified, the default qualifier is
3371 .Dq Li DD+DB+DI+BD+BB+BI+ID+IB .
3372 .It Li p4-tc-ms-xfer Op Li ,mask= Ns Ar flags
3373 .Pq "TI event"
3374 Count the number of times uop delivery changed from the trace cache to
3375 MS ROM.
3376 Qualifier
3377 .Ar flags
3378 can take the following value (which is also the default):
3379 .Pp
3380 .Bl -tag -width indent -compact
3381 .It Li cisc
3382 Count TC to MS transfers.
3383 .El
3384 .It Li p4-uop-queue-writes Op Li ,mask= Ns Ar flags
3385 .Pq "TS event"
3386 Count the number of valid uops written to the uop queue.
3387 Qualifier
3388 .Ar flags
3389 is a list of the following strings, separated by
3390 .Ql +
3391 characters:
3392 .Pp
3393 .Bl -tag -width indent -compact
3394 .It Li from-tc-build
3395 Count uops being written from the trace cache in build mode.
3396 .It Li from-tc-deliver
3397 Count uops being written from the trace cache in deliver mode.
3398 .It Li from-rom
3399 Count uops being written from microcode ROM.
3400 .El
3401 .Pp
3402 The default qualifier counts all the above kinds of uops.
3403 .It Li p4-uop-type Op Li ,mask= Ns Ar flags
3404 .Pq "TS event"
3405 This event is used in conjunction with the front-end at-retirement
3406 mechanism to tag load and store uops.
3407 Qualifer
3408 .Ar flags
3409 comprises the following strings separated by
3410 .Ql +
3411 characters:
3412 .Pp
3413 .Bl -tag -width indent -compact
3414 .It Li tagloads
3415 Mark uops that are load operations.
3416 .It Li tagstores
3417 Mark uops that are store operations.
3418 .El
3419 .Pp
3420 The default qualifier counts both kinds of uops.
3421 .It Li p4-uops-retired Op Li ,mask= Ns Ar flags
3422 .Pq "TS event"
3423 Count uops retired during a clock cycle.
3424 Qualifier
3425 .Ar flags
3426 comprises the following strings separated by
3427 .Ql +
3428 characters:
3429 .Pp
3430 .Bl -tag -width indent -compact
3431 .It Li nbogus
3432 Count marked uops that are not bogus.
3433 .It Li bogus
3434 Count marked uops that are bogus.
3435 .El
3436 .Pp
3437 The default qualifier counts both kinds of uops.
3438 .It Li p4-wc-buffer Op Li ,mask= Ns Ar flags
3439 .Pq "TI event"
3440 Count write-combining buffer operations.
3441 Qualifier
3442 .Ar flags
3443 contains the following strings separated by
3444 .Ql +
3445 characters:
3446 .Pp
3447 .Bl -tag -width indent -compact
3448 .It Li wcb-evicts
3449 WC buffer evictions due to any cause.
3450 .It Li wcb-full-evict
3451 WC buffer evictions due to no WC buffer being available.
3452 .El
3453 .Pp
3454 The default qualifer counts both kinds of evictions.
3455 .It Li p4-x87-assist Op Li ,mask= Ns Ar flags
3456 .Pq "TS event"
3457 Count the retirement of x87 instructions that required special
3458 handling.
3459 Qualifier
3460 .Ar flags
3461 contains the following strings separated by
3462 .Ql +
3463 characters:
3464 .Pp
3465 .Bl -tag -width indent -compact
3466 .It Li fpsu
3467 Count instructions that saw an FP stack underflow.
3468 .It Li fpso
3469 Count instructions that saw an FP stack overflow.
3470 .It Li poao
3471 Count instructions that saw an x87 output overflow.
3472 .It Li poau
3473 Count instructions that saw an x87 output underflow.
3474 .It Li prea
3475 Count instructions that needed an x87 input assist.
3476 .El
3477 .Pp
3478 The default qualifier counts all the above types of instruction
3479 retirements.
3480 .It Li p4-x87-fp-uop Op Li ,mask= Ns Ar flags
3481 .Pq "TI event"
3482 Count x87 floating-point uops.
3483 Qualifier
3484 .Ar flags
3485 can take the following value (which is also the default):
3486 .Pp
3487 .Bl -tag -width indent -compact
3488 .It Li all
3489 Count all x87 floating-point uops.
3490 .El
3491 .Pp
3492 If an instruction contains more than one x87 floating-point uops, then
3493 all x87 floating-point uops will be counted.
3494 This event does not count x87 floating-point data movement operations.
3495 .It Li p4-x87-simd-moves-uop Op Li ,mask= Ns Ar flags
3496 .Pq "TI event"
3497 Count each x87 FPU, MMX, SSE, or SSE2 uops that load data or store
3498 data or perform register-to-register moves.
3499 This event does not count integer move uops.
3500 Qualifier
3501 .Ar flags
3502 may contain the following keywords separated by
3503 .Ql +
3504 characters:
3505 .Pp
3506 .Bl -tag -width indent -compact
3507 .It Li allp0
3508 Count all x87 and SIMD store and move uops.
3509 .It Li allp2
3510 Count all x87 and SIMD load uops.
3511 .El
3512 .Pp
3513 The default is to count all uops.
3514 .Pq Errata
3515 This event may be affected by processor errata N43.
3516 .El
3517 .Ss "Cascading P4 PMCs"
3518 PMC cascading support is currently poorly implemented.
3519 While individual event counters may be allocated with a
3520 .Dq Li cascade
3521 qualifier, the current API does not offer the ability
3522 to name and allocate all the resources needed for a
3523 cascaded event counter pair in a single operation.
3524 .Ss "Precise Event Based Sampling"
3525 Support for precise event based sampling is currently
3526 unimplemented.
3527 .Sh COMPATIBILITY
3528 The interface between the
3529 .Nm pmc
3530 library and the
3531 .Xr hwpmc 4
3532 driver is intended to be private to the implementation and may
3533 change.
3534 In order to ease forward compatibility with future versions of the
3535 .Xr hwpmc 4
3536 driver, applications are urged to dynamically link with the
3537 .Nm pmc
3538 library.
3539 .Pp
3540 The
3541 .Nm pmc
3542 API is
3543 .Ud
3544 .Sh SEE ALSO
3545 .Xr pmclog 3 ,
3546 .Xr hwpmc 4 ,
3547 .Xr pmccontrol 8 ,
3548 .Xr pmcstat 8
3549 .Sh HISTORY
3550 The
3551 .Nm pmc
3552 library first appeared in
3553 .Fx 6.0 .
3554 .Sh AUTHORS
3555 The
3556 .Lb libpmc
3557 library was written by
3558 .An "Joseph Koshy"
3559 .Aq jkoshy@FreeBSD.org .