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 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 14, 2008 27.Os 28.Dt PMC.IAF 3 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.Pp 59.Ss PMC Capabilities 60Fixed-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 74.El 75.Ss Class Name Prefix 76These pmcs are named using a class name prefix of 77.Dq Li iaf- . 78.Ss Event Qualifiers (Fixed Function PMCs) 79These PMCs support the following modifiers: 80.Bl -tag -width indent 81.It Li os 82Configure the PMC to count events occurring at ring level 0. 83.It Li usr 84Configure the PMC to count events occurring at ring levels 1, 2 85or 3. 86.It Li anythread 87.Pq Tn Atom CPUs 88Configure the PMC to count events on all logical processors sharing a 89processor core. 90The default is to count events on the current logical processor. 91.El 92.Pp 93If neither of the 94.Dq Li os 95or 96.Dq Li usr 97qualifiers are specified, the default is to enable both. 98.Ss Event Specifiers (Fixed Function PMCs) 99The fixed function PMCs are selectable using the following 100event names: 101.Bl -tag -width indent 102.It Li INSTR_RETIRED.ANY 103.Pq Fixed Function Counter 0 104The number of instructions retired. 105.It Li CPU_CLK_UNHALTED.CORE 106.Pq Fixed Function Counter 1 107The number of core cycles for which the core is not halted. 108.It Li CPU_CLK_UNHALTED.REF 109.Pq Fixed Function Counter 2 110The number of reference cycles for which the core is not halted. 111.El 112.Sh EXAMPLES 113To measure the number of core cycles for which the core was not halted 114use the event specifier 115.Qq iaf-cpu-clk-unhalted.core . 116.Pp 117To measure the number of user instructions retired use the event specifier 118.Qq iaf-instr-retired.any,usr . 119.Pp 120To measure the number of user instructions retired on all logical processors 121in an 122.Tn Atom 123CPU, use the event specifier 124.Qq iaf-instr-retired.any,usr,anythread . 125.Sh SEE ALSO 126.Xr pmc 3 , 127.Xr pmc.atom 3 , 128.Xr pmc.core 3 , 129.Xr pmc.core2 3 , 130.Xr pmc.k7 3 , 131.Xr pmc.k8 3 , 132.Xr pmc.p4 3 , 133.Xr pmc.p5 3 , 134.Xr pmc.p6 3 , 135.Xr pmc.tsc 3 , 136.Xr pmc_cpuinfo 3 , 137.Xr pmclog 3 , 138.Xr hwpmc 4 139.Sh HISTORY 140The 141.Nm pmc 142library first appeared in 143.Fx 6.0 . 144.Sh AUTHORS 145The 146.Lb libpmc 147library was written by 148.An "Joseph Koshy" 149.Aq jkoshy@FreeBSD.org . 150