xref: /freebsd/lib/libpmc/pmc.iaf.3 (revision 1d386b48)
1.\" Copyright (c) 2008 Joseph Koshy.  All rights reserved.
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\"    notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\"    notice, this list of conditions and the following disclaimer in the
10.\"    documentation and/or other materials provided with the distribution.
11.\"
12.\" THIS SOFTWARE IS PROVIDED BY 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
22.\" SUCH DAMAGE.
23.\"
24.\" $FreeBSD$
25.\"
26.Dd November 14, 2008
27.Dt PMC.IAF 3
28.Os
29.Sh NAME
30.Nm pmc.iaf
31.Nd measurement events for
32.Tn Intel
33fixed function performance counters.
34.Sh LIBRARY
35.Lb libpmc
36.Sh SYNOPSIS
37.In pmc.h
38.Sh DESCRIPTION
39.Tn Intel
40fixed-function PMCs are present in CPUs that conform to version 2 or
41later of the
42.Tn Intel
43Performance Measurement Architecture.
44Each fixed-function PMC measures a specific hardware event.
45The number of fixed-function PMCs implemented in a CPU can vary.
46The number of fixed-function PMCs present can be determined at runtime
47by using function
48.Xr pmc_cpuinfo 3 .
49.Pp
50Intel fixed-function PMCs are documented in
51.Rs
52.%B "IA-32 Intel(R) Architecture Software Developer's Manual"
53.%T "Volume 3: System Programming Guide"
54.%N "Order Number 253669-027US"
55.%D July 2008
56.%Q "Intel Corporation"
57.Re
58.Ss PMC Capabilities
59Fixed-function PMCs support the following capabilities:
60.Bl -column "PMC_CAP_INTERRUPT" "Support"
61.It Em Capability Ta Em Support
62.It PMC_CAP_CASCADE Ta \&No
63.It PMC_CAP_EDGE Ta \&No
64.It PMC_CAP_INTERRUPT Ta Yes
65.It PMC_CAP_INVERT Ta \&No
66.It PMC_CAP_READ Ta Yes
67.It PMC_CAP_PRECISE Ta \&No
68.It PMC_CAP_SYSTEM Ta Yes
69.It PMC_CAP_TAGGING Ta \&No
70.It PMC_CAP_THRESHOLD Ta \&No
71.It PMC_CAP_USER Ta Yes
72.It PMC_CAP_WRITE Ta Yes
73.El
74.Ss Class Name Prefix
75These PMCs are named using a class name prefix of
76.Dq Li iaf- .
77.Ss Event Qualifiers (Fixed Function PMCs)
78These PMCs support the following modifiers:
79.Bl -tag -width indent
80.It Li os
81Configure the PMC to count events occurring at ring level 0.
82.It Li usr
83Configure the PMC to count events occurring at ring levels 1, 2
84or 3.
85.It Li anythread
86.Pq Tn Atom CPUs
87Configure the PMC to count events on all logical processors sharing a
88processor core.
89The default is to count events on the current logical processor.
90.El
91.Pp
92If neither of the
93.Dq Li os
94or
95.Dq Li usr
96qualifiers are specified, the default is to enable both.
97.Ss Event Specifiers (Fixed Function PMCs)
98The fixed function PMCs are selectable using the following
99event names:
100.Bl -tag -width indent
101.It Li INSTR_RETIRED.ANY
102.Pq Fixed Function Counter 0
103The number of instructions retired.
104.It Li CPU_CLK_UNHALTED.CORE
105.Pq Fixed Function Counter 1
106The number of core cycles for which the core is not halted.
107.It Li CPU_CLK_UNHALTED.REF
108.Pq Fixed Function Counter 2
109The number of reference cycles for which the core is not halted.
110.El
111.Sh EXAMPLES
112To measure the number of core cycles for which the core was not halted
113use the event specifier
114.Qq iaf-cpu-clk-unhalted.core .
115.Pp
116To measure the number of user instructions retired use the event specifier
117.Qq iaf-instr-retired.any,usr .
118.Pp
119To measure the number of user instructions retired on all logical processors
120in an
121.Tn Atom
122CPU, use the event specifier
123.Qq iaf-instr-retired.any,usr,anythread .
124.Sh SEE ALSO
125.Xr pmc 3 ,
126.Xr pmc.atom 3 ,
127.Xr pmc.core 3 ,
128.Xr pmc.core2 3 ,
129.Xr pmc.k7 3 ,
130.Xr pmc.k8 3 ,
131.Xr pmc.soft 3 ,
132.Xr pmc.tsc 3 ,
133.Xr pmc_cpuinfo 3 ,
134.Xr pmclog 3 ,
135.Xr hwpmc 4
136.Sh HISTORY
137The
138.Nm pmc
139library first appeared in
140.Fx 6.0 .
141.Sh AUTHORS
142The
143.Lb libpmc
144library was written by
145.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
146