17042d3b9SJoseph Koshy.\" Copyright (c) 2008 Joseph Koshy. All rights reserved. 27042d3b9SJoseph Koshy.\" 37042d3b9SJoseph Koshy.\" Redistribution and use in source and binary forms, with or without 47042d3b9SJoseph Koshy.\" modification, are permitted provided that the following conditions 57042d3b9SJoseph Koshy.\" are met: 67042d3b9SJoseph Koshy.\" 1. Redistributions of source code must retain the above copyright 77042d3b9SJoseph Koshy.\" notice, this list of conditions and the following disclaimer. 87042d3b9SJoseph Koshy.\" 2. Redistributions in binary form must reproduce the above copyright 97042d3b9SJoseph Koshy.\" notice, this list of conditions and the following disclaimer in the 107042d3b9SJoseph Koshy.\" documentation and/or other materials provided with the distribution. 117042d3b9SJoseph Koshy.\" 12026dbd29SChristian Brueffer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 13026dbd29SChristian Brueffer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14026dbd29SChristian Brueffer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15026dbd29SChristian Brueffer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 16026dbd29SChristian Brueffer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17026dbd29SChristian Brueffer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18026dbd29SChristian Brueffer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19026dbd29SChristian Brueffer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20026dbd29SChristian Brueffer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21026dbd29SChristian Brueffer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22026dbd29SChristian Brueffer.\" SUCH DAMAGE. 237042d3b9SJoseph Koshy.\" 24944e20faSJoseph Koshy.Dd November 14, 2008 257042d3b9SJoseph Koshy.Dt PMC.IAF 3 26aa12cea2SUlrich Spörlein.Os 277042d3b9SJoseph Koshy.Sh NAME 287042d3b9SJoseph Koshy.Nm pmc.iaf 297042d3b9SJoseph Koshy.Nd measurement events for 307042d3b9SJoseph Koshy.Tn Intel 317042d3b9SJoseph Koshyfixed function performance counters. 327042d3b9SJoseph Koshy.Sh LIBRARY 337042d3b9SJoseph Koshy.Lb libpmc 347042d3b9SJoseph Koshy.Sh SYNOPSIS 357042d3b9SJoseph Koshy.In pmc.h 367042d3b9SJoseph Koshy.Sh DESCRIPTION 377042d3b9SJoseph Koshy.Tn Intel 387042d3b9SJoseph Koshyfixed-function PMCs are present in CPUs that conform to version 2 or 397042d3b9SJoseph Koshylater of the 407042d3b9SJoseph Koshy.Tn Intel 417042d3b9SJoseph KoshyPerformance Measurement Architecture. 427042d3b9SJoseph KoshyEach fixed-function PMC measures a specific hardware event. 437042d3b9SJoseph KoshyThe number of fixed-function PMCs implemented in a CPU can vary. 447042d3b9SJoseph KoshyThe number of fixed-function PMCs present can be determined at runtime 457042d3b9SJoseph Koshyby using function 467042d3b9SJoseph Koshy.Xr pmc_cpuinfo 3 . 477042d3b9SJoseph Koshy.Pp 487042d3b9SJoseph KoshyIntel fixed-function PMCs are documented in 497042d3b9SJoseph Koshy.Rs 507042d3b9SJoseph Koshy.%B "IA-32 Intel(R) Architecture Software Developer's Manual" 517042d3b9SJoseph Koshy.%T "Volume 3: System Programming Guide" 527042d3b9SJoseph Koshy.%N "Order Number 253669-027US" 537042d3b9SJoseph Koshy.%D July 2008 547042d3b9SJoseph Koshy.%Q "Intel Corporation" 557042d3b9SJoseph Koshy.Re 567042d3b9SJoseph Koshy.Ss PMC Capabilities 577042d3b9SJoseph KoshyFixed-function PMCs support the following capabilities: 587042d3b9SJoseph Koshy.Bl -column "PMC_CAP_INTERRUPT" "Support" 597042d3b9SJoseph Koshy.It Em Capability Ta Em Support 607042d3b9SJoseph Koshy.It PMC_CAP_CASCADE Ta \&No 617042d3b9SJoseph Koshy.It PMC_CAP_EDGE Ta \&No 627042d3b9SJoseph Koshy.It PMC_CAP_INTERRUPT Ta Yes 637042d3b9SJoseph Koshy.It PMC_CAP_INVERT Ta \&No 647042d3b9SJoseph Koshy.It PMC_CAP_READ Ta Yes 657042d3b9SJoseph Koshy.It PMC_CAP_PRECISE Ta \&No 667042d3b9SJoseph Koshy.It PMC_CAP_SYSTEM Ta Yes 677042d3b9SJoseph Koshy.It PMC_CAP_TAGGING Ta \&No 687042d3b9SJoseph Koshy.It PMC_CAP_THRESHOLD Ta \&No 697042d3b9SJoseph Koshy.It PMC_CAP_USER Ta Yes 707042d3b9SJoseph Koshy.It PMC_CAP_WRITE Ta Yes 717042d3b9SJoseph Koshy.El 72944e20faSJoseph Koshy.Ss Class Name Prefix 73ef582158SJoseph KoshyThese PMCs are named using a class name prefix of 74944e20faSJoseph Koshy.Dq Li iaf- . 757042d3b9SJoseph Koshy.Ss Event Qualifiers (Fixed Function PMCs) 767042d3b9SJoseph KoshyThese PMCs support the following modifiers: 777042d3b9SJoseph Koshy.Bl -tag -width indent 787042d3b9SJoseph Koshy.It Li os 797042d3b9SJoseph KoshyConfigure the PMC to count events occurring at ring level 0. 807042d3b9SJoseph Koshy.It Li usr 817042d3b9SJoseph KoshyConfigure the PMC to count events occurring at ring levels 1, 2 827042d3b9SJoseph Koshyor 3. 83944e20faSJoseph Koshy.It Li anythread 84944e20faSJoseph Koshy.Pq Tn Atom CPUs 85944e20faSJoseph KoshyConfigure the PMC to count events on all logical processors sharing a 86944e20faSJoseph Koshyprocessor core. 87944e20faSJoseph KoshyThe default is to count events on the current logical processor. 887042d3b9SJoseph Koshy.El 897042d3b9SJoseph Koshy.Pp 907042d3b9SJoseph KoshyIf neither of the 917042d3b9SJoseph Koshy.Dq Li os 927042d3b9SJoseph Koshyor 937042d3b9SJoseph Koshy.Dq Li usr 947042d3b9SJoseph Koshyqualifiers are specified, the default is to enable both. 957042d3b9SJoseph Koshy.Ss Event Specifiers (Fixed Function PMCs) 967042d3b9SJoseph KoshyThe fixed function PMCs are selectable using the following 977042d3b9SJoseph Koshyevent names: 987042d3b9SJoseph Koshy.Bl -tag -width indent 9906209c44SJoseph Koshy.It Li INSTR_RETIRED.ANY 1007042d3b9SJoseph Koshy.Pq Fixed Function Counter 0 1017042d3b9SJoseph KoshyThe number of instructions retired. 10206209c44SJoseph Koshy.It Li CPU_CLK_UNHALTED.CORE 1037042d3b9SJoseph Koshy.Pq Fixed Function Counter 1 1047042d3b9SJoseph KoshyThe number of core cycles for which the core is not halted. 10506209c44SJoseph Koshy.It Li CPU_CLK_UNHALTED.REF 1067042d3b9SJoseph Koshy.Pq Fixed Function Counter 2 1077042d3b9SJoseph KoshyThe number of reference cycles for which the core is not halted. 1087042d3b9SJoseph Koshy.El 109944e20faSJoseph Koshy.Sh EXAMPLES 110944e20faSJoseph KoshyTo measure the number of core cycles for which the core was not halted 111944e20faSJoseph Koshyuse the event specifier 112944e20faSJoseph Koshy.Qq iaf-cpu-clk-unhalted.core . 113944e20faSJoseph Koshy.Pp 114944e20faSJoseph KoshyTo measure the number of user instructions retired use the event specifier 115944e20faSJoseph Koshy.Qq iaf-instr-retired.any,usr . 116944e20faSJoseph Koshy.Pp 117944e20faSJoseph KoshyTo measure the number of user instructions retired on all logical processors 118944e20faSJoseph Koshyin an 119944e20faSJoseph Koshy.Tn Atom 120944e20faSJoseph KoshyCPU, use the event specifier 121944e20faSJoseph Koshy.Qq iaf-instr-retired.any,usr,anythread . 1227042d3b9SJoseph Koshy.Sh SEE ALSO 1237042d3b9SJoseph Koshy.Xr pmc 3 , 124*b2934971SMitchell Horne.Xr pmc.amd 3 , 1257042d3b9SJoseph Koshy.Xr pmc.atom 3 , 1267042d3b9SJoseph Koshy.Xr pmc.core 3 , 1277042d3b9SJoseph Koshy.Xr pmc.core2 3 , 128f5f9340bSFabien Thomas.Xr pmc.soft 3 , 1297042d3b9SJoseph Koshy.Xr pmc.tsc 3 , 1307042d3b9SJoseph Koshy.Xr pmc_cpuinfo 3 , 1317042d3b9SJoseph Koshy.Xr pmclog 3 , 1327042d3b9SJoseph Koshy.Xr hwpmc 4 1337042d3b9SJoseph Koshy.Sh HISTORY 1347042d3b9SJoseph KoshyThe 1357042d3b9SJoseph Koshy.Nm pmc 1367042d3b9SJoseph Koshylibrary first appeared in 1377042d3b9SJoseph Koshy.Fx 6.0 . 1387042d3b9SJoseph Koshy.Sh AUTHORS 1397042d3b9SJoseph KoshyThe 1407042d3b9SJoseph Koshy.Lb libpmc 1417042d3b9SJoseph Koshylibrary was written by 1422b7af31cSBaptiste Daroussin.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org . 143