PMC.IAF(3)
π PMC.IAF(3) β Intel Fixed-Function Performance Counters, but make it cute
Okay so this is the PMC.IAF(3) page from the Library Functions Manual, and bestie, it's all about the Intel fixed-function performance counters. No cap, these things are iconic little hardware event trackers. Let's get into it. π
πΈ NAME
pmc.iaf β measurement events for Intel fixed function performance counters. Yes, that's the whole vibe. π
π LIBRARY
Performance Counters Library (libpmc, -lpmc) β link it and slay. β¨
π§ SYNOPSIS
#include <pmc.h>
That's it. That's the whole include. Periodt. π
π₯ DESCRIPTION
Intel fixed-function PMCs are literally built into CPUs that conform to version 2 or later of the Intel Performance Measurement Architecture. Each fixed-function PMC measures a specific hardware event β like, it has one job and it does it. The number of fixed-function PMCs implemented in a CPU can vary, because of course it can. π You can find out at runtime how many you've got by calling pmc_cpuinfo(3). Vibe check your CPU, bestie.
Intel fixed-function PMCs are documented in βVolume 3: System Programming Guideβ, IA-32 Intel(R) Architecture Software Developer's Manual, Order Number 253669-027US, Intel Corporation, July 2008. Very official. Very PDF-core. π
π PMC Capabilities
Fixed-function PMCs support the following capabilities:
PMC_CAP_CASCADEβ NoPMC_CAP_EDGEβ NoPMC_CAP_INTERRUPTβ YesPMC_CAP_INVERTβ NoPMC_CAP_READβ YesPMC_CAP_PRECISEβ NoPMC_CAP_SYSTEMβ YesPMC_CAP_TAGGINGβ NoPMC_CAP_THRESHOLDβ NoPMC_CAP_USERβ YesPMC_CAP_WRITEβ Yes
So yeah: interrupt, read, system, user, and write are a yes. The rest are a hard no. She's selective. π
π Class Name Prefix
These PMCs are named using a class name prefix of iaf-. That's the little nametag they wear. π·οΈ
π¦ Event Qualifiers (Fixed Function PMCs)
These PMCs support the following modifiers:
osβ Configure the PMC to count events occurring at ring level 0. (Kernel mode energy. π)usrβ Configure the PMC to count events occurring at ring levels 1, 2 or 3. (User mode energy. π«Ά)anythreadβ (Atom CPUs) Configure the PMC to count events on all logical processors sharing a processor core. The default is to count events on the current logical processor. So if you're on an Atom CPU and you want the whole squad counted, this is your girl. π§
If neither of the os or usr qualifiers are specified, the default is to enable both. So like, both is the default. Very generous. π
β Event Specifiers (Fixed Function PMCs)
The fixed function PMCs are selectable using the following event names:
INSTR_RETIRED.ANYβ (Fixed Function Counter 0) The number of instructions retired. They did their job, they retired, we love that for them. πCPU_CLK_UNHALTED.COREβ (Fixed Function Counter 1) The number of core cycles for which the core is not halted. Like, how many cycles did the core actually stay awake for. πCPU_CLK_UNHALTED.REFβ (Fixed Function Counter 2) The number of reference cycles for which the core is not halted. Reference cycles stay awake too bestie. π₯
π EXAMPLES
To measure the number of core cycles for which the core was not halted, use the event specifier "iaf-cpu-clk-unhalted.core". That's like the literal baseline move. πΈ
To measure the number of user instructions retired, use the event specifier "iaf-instr-retired.any,usr". Add that usr and you're counting user-mode retirement. Gorge. β¨
To measure the number of user instructions retired on all logical processors in an Atom CPU, use the event specifier "iaf-instr-retired.any,usr,anythread". That's the Atom-specific squad-counting version. No cap. π§
π«Ά SEE ALSO
pmc(3), pmc.amd(3), pmc.atom(3), pmc.core(3), pmc.core2(3), pmc.soft(3), pmc.tsc(3), pmc_cpuinfo(3), pmclog(3), hwpmc(4) β go read the whole friend group, iykyk. ππ
π HISTORY
The pmc library first appeared in FreeBSD 6.0. Oldie but goodie. π
π AUTHORS
The Performance Counters Library (libpmc, -lpmc) library was written by Joseph Koshy <jkoshy@FreeBSD.org>. We stan a legend. π«Ά
π That's the whole page bestie. Intel fixed-function PMCs, capabilities, qualifiers, event names, examples, references, history, authors β every detail is here. Don't skip theusr/osdefault, it's both. Periodt.
Debian Β· November 14, 2008 Β· PMC.IAF(3) β version/source and date, signed off cutely at the very end. πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2008 Joseph Koshy. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms