1 .\" Copyright (c) 2008 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
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.
12 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS 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
31 .Nd measurement events for
33 fixed function performance counters.
40 fixed-function PMCs are present in CPUs that conform to version 2 or
43 Performance Measurement Architecture.
44 Each fixed-function PMC measures a specific hardware event.
45 The number of fixed-function PMCs implemented in a CPU can vary.
46 The number of fixed-function PMCs present can be determined at runtime
50 Intel fixed-function PMCs are documented in
52 .%B "IA-32 Intel(R) Architecture Software Developer's Manual"
53 .%T "Volume 3: System Programming Guide"
54 .%N "Order Number 253669-027US"
56 .%Q "Intel Corporation"
60 Fixed-function PMCs support the following capabilities:
61 .Bl -column "PMC_CAP_INTERRUPT" "Support"
62 .It Em Capability Ta Em Support
63 .It PMC_CAP_CASCADE Ta \&No
64 .It PMC_CAP_EDGE Ta \&No
65 .It PMC_CAP_INTERRUPT Ta Yes
66 .It PMC_CAP_INVERT Ta \&No
67 .It PMC_CAP_READ Ta Yes
68 .It PMC_CAP_PRECISE Ta \&No
69 .It PMC_CAP_SYSTEM Ta Yes
70 .It PMC_CAP_TAGGING Ta \&No
71 .It PMC_CAP_THRESHOLD Ta \&No
72 .It PMC_CAP_USER Ta Yes
73 .It PMC_CAP_WRITE Ta Yes
76 These PMCs are named using a class name prefix of
78 .Ss Event Qualifiers (Fixed Function PMCs)
79 These PMCs support the following modifiers:
80 .Bl -tag -width indent
82 Configure the PMC to count events occurring at ring level 0.
84 Configure the PMC to count events occurring at ring levels 1, 2
88 Configure the PMC to count events on all logical processors sharing a
90 The default is to count events on the current logical processor.
97 qualifiers are specified, the default is to enable both.
98 .Ss Event Specifiers (Fixed Function PMCs)
99 The fixed function PMCs are selectable using the following
101 .Bl -tag -width indent
102 .It Li INSTR_RETIRED.ANY
103 .Pq Fixed Function Counter 0
104 The number of instructions retired.
105 .It Li CPU_CLK_UNHALTED.CORE
106 .Pq Fixed Function Counter 1
107 The number of core cycles for which the core is not halted.
108 .It Li CPU_CLK_UNHALTED.REF
109 .Pq Fixed Function Counter 2
110 The number of reference cycles for which the core is not halted.
113 To measure the number of core cycles for which the core was not halted
114 use the event specifier
115 .Qq iaf-cpu-clk-unhalted.core .
117 To measure the number of user instructions retired use the event specifier
118 .Qq iaf-instr-retired.any,usr .
120 To measure the number of user instructions retired on all logical processors
123 CPU, use the event specifier
124 .Qq iaf-instr-retired.any,usr,anythread .
143 library first appeared in
148 library was written by
149 .An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .