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