PMC.HASWELL(3)
okay so welcome to PMC.HASWELL(3), bestie π this is a Library Functions Manual page, and it's the whole tea on Intel Haswell measurement events. grab a snack, we're getting into it π
β¨ NAME β¨
pmc.haswell β measurement events for Intel Haswell family CPUs π
πΈ LIBRARY πΈ
Performance Counters Library (libpmc, -lpmc) β literally just link it, iykyk π
π¦ SYNOPSIS π¦
#include <pmc.h>
that's it. that's the whole synopsis. iconic.
π DESCRIPTION π
okay so Intel Haswell CPUs contain PMCs that conform to version 2 of the Intel performance measurement architecture. these CPUs may contain up to two classes of PMCs:
PMC_CLASS_IAFβ fixed-function counters that count only one hardware event per counter.PMC_CLASS_IAPβ programmable counters that may be configured to count one of a defined set of hardware events.
the number of PMCs available in each class and their widths? you do not get to guess that, bestie β you have to determine it at run time by calling pmc_cpuinfo(3) π«Ά
Intel Haswell PMCs are documented in βCombined Volumes: 1, 2A, 2B, 2C, 3A, 3B and 3Cβ, Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Order Number: 325462-045US, Intel Corporation, January 2013. very "here's my source, I cited it" of them π
β HASWELL FIXED FUNCTION PMCS β
these PMCs and their supported events are documented in pmc.iaf(3). go read that one, it's a whole separate vibe.
π₯ HASWELL PROGRAMMABLE PMCS π₯
the programmable PMCs support the following capabilities:
PMC_CAP_CASCADEβ No πPMC_CAP_EDGEβ Yes β¨PMC_CAP_INTERRUPTβ Yes β¨PMC_CAP_INVERTβ Yes β¨PMC_CAP_READβ Yes β¨PMC_CAP_PRECISEβ No πPMC_CAP_SYSTEMβ Yes β¨PMC_CAP_TAGGINGβ No πPMC_CAP_THRESHOLDβ Yes β¨PMC_CAP_USERβ Yes β¨PMC_CAP_WRITEβ Yes β¨
like, mostly yes, but PMC_CAP_CASCADE, PMC_CAP_PRECISE and PMC_CAP_TAGGING are a hard no on this chip. noted. moving on π
π Event Qualifiers π
event specifiers for these PMCs support the following common qualifiers:
rsp=valueβ configure the Off-core Response bits. and inside that there's a whole menu, so buckle up:DMND_DATA_RDβ counts the number of demand and DCU prefetch data reads of full and partial cachelines as well as demand data page table entry cacheline reads. does not count L2 data read prefetches or instruction fetches.REQ_DMND_RFOβ counts the number of demand and DCU prefetch reads for ownership (RFO) requests generated by a write to data cacheline. does not count L2 RFO prefetches.REQ_DMND_IFETCHβ counts the number of demand and DCU prefetch instruction cacheline reads. does not count L2 code read prefetches.REQ_WBβ counts the number of writeback (modified to exclusive) transactions.REQ_PF_DATA_RDβ counts the number of data cacheline reads generated by L2 prefetchers.REQ_PF_RFOβ counts the number of RFO requests generated by L2 prefetchers.REQ_PF_IFETCHβ counts the number of code reads generated by L2 prefetchers.REQ_PF_LLC_DATA_RDβ L2 prefetcher to L3 for loads.REQ_PF_LLC_RFOβ RFO requests generated by L2 prefetcherREQ_PF_LLC_IFETCHβ L2 prefetcher to L3 for instruction fetches.REQ_BUS_LOCKSβ bus lock and split lock requests.REQ_STRM_STβ streaming store requests.REQ_OTHERβ any other request that crosses IDI, including I/O.RES_ANYβ catch all value for any response types.RES_SUPPLIER_NO_SUPPβ no Supplier Information available.RES_SUPPLIER_LLC_HITMβ M-state initial lookup stat in L3.RES_SUPPLIER_LLC_HITEβ E-state.RES_SUPPLIER_LLC_HITSβ S-state.RES_SUPPLIER_LLC_HITFβ F-state.RES_SUPPLIER_LOCALβ local DRAM Controller.RES_SNOOP_SNP_NONEβ no details on snoop-related information.RES_SNOOP_SNP_NO_NEEDEDβ no snoop was needed to satisfy the request.RES_SNOOP_SNP_MISSβ a snoop was needed and it missed all snooped caches: -For LLC Hit, ReslHitl was returned by all cores -For LLC Miss, Rspl was returned by all sockets and data was returned from DRAM.RES_SNOOP_HIT_NO_FWDβ a snoop was needed and it hits in at least one snooped cache. Hit denotes a cache-line was valid before snoop effect. this includes: -Snoop Hit w/ Invalidation (LLC Hit, RFO) -Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) -Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S). In the LLC Miss case, data is returned from DRAM.RES_SNOOP_HIT_FWDβ a snoop was needed and data was forwarded from a remote socket. this includes: -Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT).RES_SNOOP_HITMβ a snoop was needed and it HitM-ed in local or remote cache. HitM denotes a cache-line was in modified state before effect as a results of snoop. this includes: -Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) -Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) -Snoop MtoS (LLC Hit, IFetch/Data_RD).RES_NON_DRAMβ target was non-DRAM system address. this includes MMIO transactions.
cmask=valueβ configure the PMC to increment only if the number of configured events measured in a cycle is greater than or equal to value.edgeβ configure the PMC to count the number of de-asserted to asserted transitions of the conditions expressed by the other qualifiers. if specified, the counter will increment only once whenever a condition becomes true, irrespective of the number of clocks during which the condition remains true.invβ invert the sense of comparison when the<pink>cmask</pink>qualifier is present, making the counter increment when the number of events per cycle is less than the value specified by the<pink>cmask</pink>qualifier.osβ configure the PMC to count events happening at processor privilege level 0.usrβ configure the PMC to count events occurring at privilege levels 1, 2 or 3.
π«Ά if neither of the<pink>os</pink>or<pink>usr</pink>qualifiers are specified, the default is to enable both. so like, you get both unless you say otherwise. generous of them, tbh.
π Event Specifiers (Programmable PMCs) π
Haswell programmable PMCs support the following events β and yes, we're doing all of them, no skipping π
LD_BLOCKS.STORE_FORWARDβ (Event 03H, Umask 02H) Loads blocked by overlapping with store buffer that cannot be forwarded.MISALIGN_MEM_REF.LOADSβ (Event 05H, Umask 01H) Speculative cache-line split load uops dispatched to L1D.MISALIGN_MEM_REF.STORESβ (Event 05H, Umask 02H) Speculative cache-line split Store-address uops dispatched to L1D.LD_BLOCKS_PARTIAL.ADDRESS_ALIASβ (Event 07H, Umask 01H) False dependencies in MOB due to partial compare on address.DTLB_LOAD_MISSES.MISS_CAUSES_A_WALKβ (Event 08H, Umask 01H) Misses in all TLB levels that cause a page walk of any page size.DTLB_LOAD_MISSES.WALK_COMPLETED_4Kβ (Event 08H, Umask 02H) Completed page walks due to demand load misses that caused 4K page walks in any TLB levels.DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4Kβ (Event 08H, Umask 02H) Completed page walks due to demand load misses that caused 2M/4M page walks in any TLB levels.DTLB_LOAD_MISSES.WALK_COMPLETEDβ (Event 08H, Umask 0EH) Completed page walks in any TLB of any page size due to demand load missesDTLB_LOAD_MISSES.WALK_DURATIONβ (Event 08H, Umask 10H) Cycle PMH is busy with a walk.DTLB_LOAD_MISSES.STLB_HIT_4Kβ (Event 08H, Umask 20H) Load misses that missed DTLB but hit STLB (4K).DTLB_LOAD_MISSES.STLB_HIT_2Mβ (Event 08H, Umask 40H) Load misses that missed DTLB but hit STLB (2M).DTLB_LOAD_MISSES.STLB_HITβ (Event 08H, Umask 60H) Number of cache load STLB hits. No page walk.DTLB_LOAD_MISSES.PDE_CACHE_MISSβ (Event 08H, Umask 80H) DTLB demand load misses with low part of linear-to- physical address translation missedINT_MISC.RECOVERY_CYCLESβ (Event 0DH, Umask 03H) Cycles waiting to recover after Machine Clears except JEClear. SetCmask = 1.UOPS_ISSUED.ANYβ (Event 0EH, Umask 01H) increments each cycle the # of Uops issued by the RAT to RS. SetCmask = 1,Inv = 1,Any = 1to count stalled cycles of this core.UOPS_ISSUED.FLAGS_MERGEβ (Event 0EH, Umask 10H) Number of flags-merge uops allocated. Such uops adds delay.UOPS_ISSUED.SLOW_LEAβ (Event 0EH, Umask 20H) Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 sources + immediate) regardless if as a result of LEA instruction or not.UOPS_ISSUED.SiNGLE_MULβ (Event 0EH, Umask 40H) Number of multiply packed/scalar single precision uops allocated. (and yes, that capitalSin the middle is fr fr how it's written β don't @ me, I don't make the rules π)L2_RQSTS.DEMAND_DATA_RD_MISSβ (Event 24H, Umask 21H) Demand Data Read requests that missed L2, no rejects.L2_RQSTS.DEMAND_DATA_RD_HITβ (Event 24H, Umask 41H) Demand Data Read requests that hit L2 cache.L2_RQSTS.ALL_DEMAND_DATA_RDβ (Event 24H, Umask E1H) Counts any demand and L1 HW prefetch data load requests to L2.L2_RQSTS.RFO_HITβ (Event 24H, Umask 42H) Counts the number of store RFO requests that hit the L2 cache.L2_RQSTS.RFO_MISSβ (Event 24H, Umask 22H) Counts the number of store RFO requests that miss the L2 cache.L2_RQSTS.ALL_RFOβ (Event 24H, Umask E2H) Counts all L2 store RFO requests.L2_RQSTS.CODE_RD_HITβ (Event 24H, Umask 44H) Number of instruction fetches that hit the L2 cache.L2_RQSTS.CODE_RD_MISSβ (Event 24H, Umask 24H) Number of instruction fetches that missed the L2 cache.L2_RQSTS.ALL_DEMAND_MISSβ (Event 24H, Umask 27H) Demand requests that miss L2 cache.L2_RQSTS.ALL_DEMAND_REFERENCESβ (Event 24H, Umask E7H) Demand requests to L2 cache.L2_RQSTS.ALL_CODE_RDβ (Event 24H, Umask E4H) Counts all L2 code requests.L2_RQSTS.L2_PF_HITβ (Event 24H, Umask 50H) Counts all L2 HW prefetcher requests that hit L2.
and that's where part one taps out β the L2_RQSTS saga does not end here, so stay tuned bestie π¦π
ok still rolling through the event list, bestie β grab a snack, there's a lot of TLB lore coming π
L2_RQSTS.L2_PF_MISS(Event 24H,Umask 30H) β counts, like, every single L2 HW prefetcher request that missed L2. all of them. the whole vibe.L2_RQSTS.ALL_PF(Event 24H,Umask F8H) β counts all L2 HW prefetcher requests, periodt.L2_RQSTS.MISS(Event 24H,Umask 3FH) β every request that missed L2. that's it. that's the event.L2_RQSTS.REFERENCES(Event 24H,Umask FFH) β all requests to L2 cache, the whole population β¨L2_DEMAND_RQSTS.WB_HIT(Event 27H,Umask 50H) β writebacks that hit L2 cache and were not rejected. we love a hit that stays hit π«ΆLONGEST_LAT_CACHE.REFERENCE(Event 2EH,Umask 4FH) β counts requests coming from the core that reference a cache line in the last level cache.LONGEST_LAT_CACHE.MISS(Event 2EH,Umask 41H) β counts each cache miss condition for references to the last level cache. the sad path πCPU_CLK_UNHALTED.THREAD_P(Event 3CH,Umask 00H) β counts the number of thread cycles while the thread is not in a halt state. the thread enters halt when it's running the HLT instruction. also heads up: the core frequency may change from time to time due to power or thermal throttling π₯ β so yeah, that's a thing.CPU_CLK_THREAD_UNHALTED.REF_XCLK(Event 3CH,Umask 01H) β increments at the frequency ofXCLK(100 MHz) when not halted.L1D_PEND_MISS.PENDING(Event 48H,Umask 01H) β increments the number of outstanding L1D misses every cycle. setCmaks = 1andEdge =1to count occurrences. (yes,Cmaks. keeping it exactly as written, iykyk π)DTLB_STORE_MISSES.MISS_CAUSES_A_WALK(Event 49H,Umask 01H) β a miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G).DTLB_STORE_MISSES.WALK_COMPLETED_4K(Event 49H,Umask 02H) β completed page walks due to store misses in one or more TLB levels of4Kpage structure.DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M(Event 49H,Umask 04H) β completed page walks due to store misses in one or more TLB levels of2M/4Mpage structure. big pages, big energy πΈDTLB_STORE_MISSES.WALK_COMPLETED(Event 49H,Umask 0EH) β completed page walks due to store miss in any TLB levels of any page size (4K/2M/4M/1G). the inclusive queen πDTLB_STORE_MISSES.WALK_DURATION(Event 49H,Umask 10H) β cyclesPMHis busy with this walk.DTLB_STORE_MISSES.STLB_HIT_4K(Event 49H,Umask 20H) β store misses that missed DTLB but hit STLB (4K). missed the first one, caught the second, iconic πDTLB_STORE_MISSES.STLB_HIT_2M(Event 49H,Umask 40H) β store misses that missed DTLB but hit STLB (2M).DTLB_STORE_MISSES.STLB_HIT(Event 49H,Umask 60H) β store operations that miss the first TLB level but hit the second and do not cause page walks. no walk, no stress π§DTLB_STORE_MISSES.PDE_CACHE_MISS(Event 49H,Umask 80H) β DTLB store misses with low part of linear-to-physical address translation missed.LOAD_HIT_PRE.SW_PF(Event 4CH,Umask 01H) β non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch.LOAD_HIT_PRE.HW_PF(Event 4CH,Umask 02H) β non-SW-prefetch load dispatches that hit fill buffer allocated for H/W prefetch.L1D.REPLACEMENT(Event 51H,Umask 01H) β counts the number of lines brought into the L1 data cache.MOVE_ELIMINATION.INT_NOT_ELIMINATED(Event 58H,Umask 04H) β number of integer Move Elimination candidate uops that were not eliminated. they didn't make the cut πMOVE_ELIMINATION.SMID_NOT_ELIMINATED(Event 58H,Umask 08H) β number of SIMD Move Elimination candidate uops that were not eliminated.MOVE_ELIMINATION.INT_ELIMINATED(Event 58H,Umask 01H) β unhalted core cycles when the thread is in ring 0.MOVE_ELIMINATION.SMID_ELIMINATED(Event 58H,Umask 02H) β number of SIMD Move Elimination candidate uops that were eliminated. slay, eliminated πCPL_CYCLES.RING0(Event 5CH,Umask 02H) β unhalted core cycles when the thread is in ring 0. kernel mode main character energy.CPL_CYCLES.RING123(Event 5CH,Umask 01H) β unhalted core cycles when the thread is not in ring 0.RS_EVENTS.EMPTY_CYCLES(Event 5EH,Umask 01H) β cycles the RS is empty for the thread. empty. nothing. void. π³οΈOFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD(Event 60H,Umask 01H) β offcore outstanding Demand Data Read transactions in SQ to uncore. setCmask=1to count cycles.OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD(Event 60H,Umask 02H) β offcore outstanding Demand code Read transactions in SQ to uncore. setCmask=1to count cycles.OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO(Event 60H,Umask 04H) β offcore outstanding RFO store transactions in SQ to uncore. setCmask=1to count cycles.OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD(Event 60H,Umask 08H) β offcore outstanding cacheable data read transactions in SQ to uncore. setCmask=1to count cycles.LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION(Event 63H,Umask 01H) β cycles in which the L1D and L2 are locked, due to a UC lock or split lock. both caches, held hostage πLOCK_CYCLES.CACHE_LOCK_DURATION(Event 63H,Umask 02H) β cycles in which the L1D is locked.IDQ.EMPTY(Event 79H,Umask 02H) β counts cycles the IDQ is empty.IDQ.MITE_UOPS(Event 79H,Umask 04H) β increment each cycle # of uops delivered to IDQ from MITE path. setCmask = 1to count cycles.IDQ.DSB_UOPS(Event 79H,Umask 08H) β increment each cycle. # of uops delivered to IDQ from DSB path. setCmask = 1to count cycles.IDQ.MS_DSB_UOPS(Event 79H,Umask 10H) β increment each cycle # of uops delivered to IDQ when MS_busy by DSB. setCmask = 1to count cycles. addEdge=1to count # of delivery.IDQ.MS_MITE_UOPS(Event 79H,Umask 20H) β ncrement each cycle # of uops delivered to IDQ when MS_busy by MITE. setCmask = 1to count cycles. (that'sncrement, no i β she's quirky like that, don't come for her π)IDQ.MS_UOPS(Event 79H,Umask 30H) β increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. setCmask = 1to count cycles.IDQ.ALL_DSB_CYCLES_ANY_UOPS(Event 79H,Umask 18H) β counts cycles DSB is delivered at least one uops. setCmask = 1.IDQ.ALL_DSB_CYCLES_4_UOPS(Event 79H,Umask 18H) β counts cycles DSB is delivered four uops. setCmask=4.IDQ.ALL_MITE_CYCLES_ANY_UOPS(Event 79H,Umask 24H) β counts cycles MITE is delivered at least one uops. setCmask = 1.IDQ.ALL_MITE_CYCLES_4_UOPS(Event 79H,Umask 24H) β counts cycles MITE is delivered four uops. setCmask =4.IDQ.MITE_ALL_UOPS(Event 79H,Umask 3CH) β # of uops delivered to IDQ from any path. any. all. the works πICACHE.MISSES(Event 80H,Umask 02H) β number of Instruction Cache, Streaming Buffer and Victim Cache Misses. includes UC accesses.ITLB_MISSES.MISS_CAUSES_A_WALK(Event 85H,Umask 01H) β misses in ITLB that causes a page walk of any page size.ITLB_MISSES.WALK_COMPLETED_4K(Event 85H,Umask 02H) β completed page walks due to misses in ITLB4Kpage entries.TLB_MISSES.WALK_COMPLETED_2M_4M(Event 85H,Umask 04H) β completed page walks due to misses in ITLB2M/4Mpage entries. (yes the event name saysTLB_MISSESup top, notITLB_MISSESβ writing it exactly as she is, no notes π )ITLB_MISSES.WALK_COMPLETED(Event 85H,Umask 0EH) β completed page walks in ITLB of any page size.ITLB_MISSES.WALK_DURATION(Event 85H,Umask 10H) β cyclePMHis busy with a walk.ITLB_MISSES.STLB_HIT_4K(Event 85H,Umask 20H) β ITLB misses that hit STLB (4K).ITLB_MISSES.STLB_HIT_2M(Event 85H,Umask 40H) β ITLB misses that hit STLB (2K). (the page says2Kand i'm not gonna gaslight you about it π«Ά)ITLB_MISSES.STLB_HIT(Event 85H,Umask 60H) β TLB misses that hit STLB. no page walk.ILD_STALL.LCP(Event 87H,Umask 01H) β stalls caused by changing prefix length of the instruction.ILD_STALL.IQ_FULL(Event 87H,Umask 04H) β stall cycles due to IQ is full.BR_INST_EXEC.NONTAKEN_COND(Event 88H,Umask 41H) β counts conditional near branch instructions that were executed (but not necessarily retired) and not taken.BR_INST_EXEC.TAKEN_COND(Event 88H,Umask 81H) β counts conditional near branch instructions that were executed (but not necessarily retired) and taken. she took the branch, she's braver than me πBR_INST_EXEC.DIRECT_JMP(Event 88H,Umask 82H) β counts all unconditional near branch instructions excluding calls and indirect branches.BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET(Event 88H,Umask 84H) β counts executed indirect near branch instructions that are not calls nor returns.BR_INST_EXEC.RETURN_NEAR(Event 88H,Umask 88H) β counts indirect near branches that have a return mnemonic.BR_INST_EXEC.DIRECT_NEAR_CALL(Event 88H,Umask 90H) β counts unconditional near call branch instructions, excluding non call branch, executed.BR_INST_EXEC.INDIRECT_NEAR_CALL(Event 88H,Umask A0H) β counts indirect near calls, including both register and memory indirect, executed.BR_INST_EXEC.ALL_BRANCHES(Event 88H,Umask FFH) β counts all near executed branches (not necessarily retired). the full collection β¨BR_MISP_EXEC.NONTAKEN_COND(Event 89H,Umask 41H) β counts conditional near branch instructions mispredicted as nontaken.BR_MISP_EXEC.TAKEN_COND(Event 89H,Umask 81H) β counts conditional near branch instructions mispredicted as taken.BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET(Event 89H,Umask 84H) β counts mispredicted indirect near branch instructions that are not calls nor returns.BR_MISP_EXEC.RETURN_NEAR(Event 89H,Umask 88H) β counts mispredicted indirect near branches that have a return mnemonic.BR_MISP_EXEC.DIRECT_NEAR_CALL(Event 89H,Umask 90H) β counts mispredicted unconditional near call branch instructions, excluding non call branch, executed.BR_MISP_EXEC.INDIRECT_NEAR_CALL(Event 89H,Umask A0H) β counts mispredicted indirect near calls, including both register and memory indirect, executed.BR_MISP_EXEC.ALL_BRANCHES(Event 89H,Umask FFH) β counts all mispredicted near executed branches (not necessarily retired). the misprediction hall of shame πIDQ_UOPS_NOT_DELIVERED.CORE(Event 9CH,Umask 01H) β count number of non-delivered uops to RAT per thread.UOPS_EXECUTED_PORT.PORT_0(Event A1H,Umask 01H) β cycles which a Uop is dispatched on port0in this thread.UOPS_EXECUTED_PORT.PORT_1(Event A1H,Umask 02H) β cycles which a Uop is dispatched on port1in this thread.
still going bestie, don't close the tab yet π¦
UOPS_EXECUTED_PORT.PORT_2β(Event A1H, Umask 04H)cycles where a uop gets dispatched on port 2 in this thread β¨UOPS_EXECUTED_PORT.PORT_3β(Event A1H, Umask 08H)cycles where a uop gets dispatched on port 3 in this threadUOPS_EXECUTED_PORT.PORT_4β(Event A1H, Umask 10H)cycles where a uop gets dispatched on port 4 in this threadUOPS_EXECUTED_PORT.PORT_5β(Event A1H, Umask 20H)cycles where a uop gets dispatched on port 5 in this threadUOPS_EXECUTED_PORT.PORT_6β(Event A1H, Umask 40H)cycles where a uop gets dispatched on port 6 in this threadUOPS_EXECUTED_PORT.PORT_7β(Event A1H, Umask 80H)cycles where a uop gets dispatched on port 7 in this thread
π ok ports 0 and 1 were in the last chunk, these are the rest of the squad, we love a complete set.
RESOURCE_STALLS.ANYβ(Event A2H, Umask 01H)cycles where allocation is stalled for a resource-related reason πRESOURCE_STALLS.RSβ(Event A2H, Umask 04H)cycles stalled because there's no eligible RS entry availableRESOURCE_STALLS.SBβ(Event A2H, Umask 08H)cycles stalled because no store buffers are available (and nope, that does not include draining form sync)RESOURCE_STALLS.ROBβ(Event A2H, Umask 10H)cycles stalled because the re-order buffer is full π«CYCLE_ACTIVITY.CYCLES_L2_PENDINGβ(Event A3H, Umask 01H)cycles with pending L2 miss loads. SetCmask=2to count cycle πCYCLE_ACTIVITY.CYCLES_LDM_PENDINGβ(Event A3H, Umask 02H)cycles with pending memory loads. SetCmask=2to count cycleCYCLE_ACTIVITY.STALLS_L2_PENDINGβ(Event A3H, Umask 05H)number of loads that missed L2CYCLE_ACTIVITY.CYCLES_L1D_PENDINGβ(Event A3H, Umask 08H)cycles with pending L1 cache miss loads. SetCmask=8to count cycle β
bestie pls note theCmaskvalues are literally part of the vibe check here β2,2, and8respectively. don't come for me, that's what the page says π
ITLB.ITLB_FLUSHβ(Event AEH, Umask 01H)counts the number of ITLB flushes, and yes it includes4k/2M/4Mpages π¦OFFCORE_REQUESTS.DEMAND_DATA_RDβ(Event B0H, Umask 01H)demand data read requests sent to uncoreOFFCORE_REQUESTS.DEMAND_CODE_RDβ(Event B0H, Umask 02H)demand code read requests sent to uncoreOFFCORE_REQUESTS.DEMAND_RFOβ(Event B0H, Umask 04H)demand RFO read requests sent to uncore, including regular RFOs, locks, and ItoMOFFCORE_REQUESTS.ALL_DATA_RDβ(Event B0H, Umask 08H)data read requests sent to uncore β both demand and prefetch, we're counting everybody πUOPS_EXECUTED.COREβ(Event B1H, Umask 02H)counts the total number of uops to be executed per-core each cycleOFF_CORE_RESPONSE_0β(Event B7H, Umask 01H)requires MSR01A6Hπ₯OFF_CORE_RESPONSE_1β(Event BBH, Umask 01H)requires MSR01A7H
ngl these two are giving "special guest star" energy β they literally need an MSR to even exist. main character events only π
PAGE_WALKER_LOADS.DTLB_L1β(Event BCH, Umask 11H)number of DTLB page walker loads that hit in the L1+FBPAGE_WALKER_LOADS.ITLB_L1β(Event BCH, Umask 21H)number of ITLB page walker loads that hit in the L1+FBPAGE_WALKER_LOADS.DTLB_L2β(Event BCH, Umask 12H)number of DTLB page walker loads that hit in the L2PAGE_WALKER_LOADS.ITLB_L2β(Event BCH, Umask 22H)number of ITLB page walker loads that hit in the L2PAGE_WALKER_LOADS.DTLB_L3β(Event BCH, Umask 14H)number of DTLB page walker loads that hit in the L3PAGE_WALKER_LOADS.ITLB_L3β(Event BCH, Umask 24H)number of ITLB page walker loads that hit in the L3PAGE_WALKER_LOADS.DTLB_MEMORYβ(Event BCH, Umask 18H)number of DTLB page walker loads from memory πPAGE_WALKER_LOADS.ITLB_MEMORYβ(Event BCH, Umask 28H)number of ITLB page walker loads from memory
lowkey obsessed with how these are all Event BCH with different umasks β it's giving one event, eight personalities π
TLB_FLUSH.DTLB_THREADβ(Event BDH, Umask 01H)DTLB flush attempts of the thread-specific entriesTLB_FLUSH.STLB_ANYβ(Event BDH, Umask 20H)count the number of STLB flush attempts
INST_RETIRED.ANY_Pβ(Event C0H, Umask 00H)number of instructions at retirement πINST_RETIRED.ALLβ(Event C0H, Umask 01H)precise instruction retired event with HW to reduce the effect of PEBS shadow in IP distribution β¨OTHER_ASSISTS.AVX_TO_SSEβ(Event C1H, Umask 08H)number of transitions from AVX-256 to legacy SSE when penalty is applicableOTHER_ASSISTS.SSE_TO_AVXβ(Event C1H, Umask 10H)number of transitions from SSE to AVX-256 when penalty is applicableOTHER_ASSISTS.ANY_WB_ASSISTβ(Event C1H, Umask 40H)number of microcode assists invoked by HW upon uop writeback π§UOPS_RETIRED.ALLβ(Event C2H, Umask 01H)counts the number of micro-ops retired. Usecmask=1and invert to count active cycles or stalled cycles π«ΆUOPS_RETIRED.RETIRE_SLOTSβ(Event C2H, Umask 02H)counts the number of retirement slots used each cycleMACHINE_CLEARS.MEMORY_ORDERINGβ(Event C3H, Umask 02H)counts the number of machine clears due to memory order conflictsMACHINE_CLEARS.SMCβ(Event C3H, Umask 04H)number of self-modifying-code machine clears detected πMACHINE_CLEARS.MASKMOVβ(Event C3H, Umask 20H)counts the number of executed AVX masked load operations that refer to an illegal address range with the mask bits set to0
BR_INST_RETIRED.ALL_BRANCHESβ(Event C4H, Umask 00H)branch instructions at retirementBR_INST_RETIRED.CONDITIONALβ(Event C4H, Umask 01H)counts the number of conditional branch instructions. Supports PEBS retired πBR_INST_RETIRED.NEAR_CALLβ(Event C4H, Umask 02H)direct and indirect near call instructions retiredBR_INST_RETIRED.ALL_BRANCHESβ(Event C4H, Umask 04H)counts the number of branch instructions retired
okay so yes,ALL_BRANCHESshows up twice with two different umasks (00Hand04H). Not me merging them β the page really does list both, so both stay. periodt π
BR_INST_RETIRED.NEAR_RETURNβ(Event C4H, Umask 08H)counts the number of near return instructions retiredBR_INST_RETIRED.NOT_TAKENβ(Event C4H, Umask 10H)counts the number of not taken branch instructions retiredBR_INST_RETIRED.NEAR_TAKENβ(Event C4H, Umask 20H)number of near taken branches retired
ngl the source page gets a lil glitchy right here β there's a strayIt Liwedged into the text β but the deets are exactly as above:NOT_TAKENis umask10H,NEAR_TAKENis umask20H, bothEvent C4Hπ¦
BR_INST_RETIRED.FAR_BRANCHβ(Event C4H, Umask 40H)number of far branches retiredBR_MISP_RETIRED.ALL_BRANCHESβ(Event C5H, Umask 00H)mispredicted branch instructions at retirement πBR_MISP_RETIRED.CONDITIONALβ(Event C5H, Umask 01H)mispredicted conditional branch instructions retiredBR_MISP_RETIRED.CONDITIONALβ(Event C5H, Umask 04H)mispredicted macro branch instructions retired
again β same event name, two umasks, two meanings (01H= conditional,04H= macro). Both listed, no cap π«
FP_ASSIST.X87_OUTPUTβ(Event CAH, Umask 02H)number of X87 FP assists due to Output valuesFP_ASSIST.X87_INPUTβ(Event CAH, Umask 04H)number of X87 FP assists due to input valuesFP_ASSIST.SIMD_OUTPUTβ(Event CAH, Umask 08H)number of SIMD FP assists due to Output valuesFP_ASSIST.SIMD_INPUTβ(Event CAH, Umask 10H)number of SIMD FP assists due to input valuesFP_ASSIST.ANYβ(Event CAH, Umask 1EH)cycles with any input/output SSE* or FP assists βROB_MISC_EVENTS.LBR_INSERTSβ(Event CCH, Umask 20H)counts cases of saving new LBR records by hardwareMEM_TRANS_RETIRED.LOAD_LATENCYβ(Event CDH, Umask 01H)randomly sampled loads whose latency is above a user defined threshold. A small fraction of the overall loads are sampled due to randomization πΈ
bestie this one is literally a sampler β it's supposed to miss most loads, that's the randomization doing its thing, not a bug π
MEM_UOPS_RETIRED.STLB_MISS_LOADSβ(Event D0H, Umask 11H)count retired load uops that missed the STLBMEM_UOPS_RETIRED.STLB_MISS_STORESβ(Event D0H, Umask 12H)count retired store uops that missed the STLBMEM_UOPS_RETIRED.SPLIT_LOADSβ(Event D0H, Umask 41H)count retired load uops that were split across a cache line πMEM_UOPS_RETIRED.SPLIT_STORESβ(Event D0H, Umask 42H)count retired store uops that were split across a cache lineMEM_UOPS_RETIRED.ALL_LOADSβ(Event D0H, Umask 81H)count all retired load uopsMEM_UOPS_RETIRED.ALL_STORESβ(Event D0H, Umask 82H)count all retired store uops π₯MEM_LOAD_UOPS_RETIRED.L1_HITβ(Event D1H, Umask 01H)retired load uops with L1 cache hits as data sourcesMEM_LOAD_UOPS_RETIRED.L2_HITβ(Event D1H, Umask 02H)retired load uops with L2 cache hits as data sourcesMEM_LOAD_UOPS_RETIRED.LLC_HITβ(Event D1H, Umask 04H)retired load uops with LLC cache hits as data sourcesMEM_LOAD_UOPS_RETIRED.L2_MISSβ(Event D1H, Umask 10H)retired load uops missed L2. Unknown data source excluded πMEM_LOAD_UOPS_RETIRED.HIT_LFBβ(Event D1H, Umask 40H)retired load uops whose data sources were load uops that missed L1 but hit FB due to a preceding miss to the same cache line with data not ready
MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISSβ(Event D2H, Umask 01H)retired load uops whose data sources were an LLC hit and a cross-core snoop missed in on-pkg core cacheMEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITβ(Event D2H, Umask 02H)retired load uops whose data sources were LLC and cross-core snoop hits in on-pkg core cache π¦MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITMβ(Event D2H, Umask 04H)retired load uops whose data sources were HitM responses from shared LLCMEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONEβ(Event D2H, Umask 08H)retired load uops whose data sources were hits in LLC without snoops required πMEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAMβ(Event D3H, Umask 01H)retired load uops whose data sources missed LLC but were serviced from local dram π
BACLEARS.ANYβ(Event E6H, Umask 1FH)number of front end re-steers due to BPU mispredictionL2_TRANS.DEMAND_DATA_RDβ(Event F0H, Umask 01H)Demand Data Read requests that access L2 cacheL2_TRANS.RFOβ(Event F0H, Umask 02H)RFO requests that access L2 cacheL2_TRANS.CODE_RDβ(Event F0H, Umask 04H)L2 cache accesses when fetching instructionsL2_TRANS.ALL_PFβ(Event F0H, Umask 08H)any MLC or LLC HW prefetch accessing L2, including rejects πL2_TRANS.L1D_WBβ(Event F0H, Umask 10H)L1D writebacks that access L2 cacheL2_TRANS.L2_FILLβ(Event F0H, Umask 20H)L2 fill requests that access L2 cacheL2_TRANS.L2_WBβ(Event F0H, Umask 40H)L2 writebacks that access L2 cache βL2_TRANS.ALL_REQUESTSβ (EventF0H, Umask80H) every single transaction that touches the L2 pipe. all of them. no skipping πL2_LINES_IN.Iβ (EventF1H, Umask01H) L2 cache lines filling L2 while they're sitting in the I state π§L2_LINES_IN.Sβ (EventF1H, Umask02H) L2 cache lines filling L2 while they're in the S state β¨L2_LINES_IN.Eβ (EventF1H, Umask04H) L2 cache lines filling L2 while they're in the E state π₯L2_LINES_IN.ALLβ (EventF1H, Umask07H) literally all the L2 cache lines filling L2, every state, the whole squad π«ΆL2_LINES_OUT.DEMAND_CLEANβ (EventF2H, Umask05H) clean L2 cache lines getting evicted by demand, bye bestie πL2_LINES_OUT.DEMAND_DIRTYβ (EventF2H, Umask06H) dirty L2 cache lines getting evicted by demand β messy, but make it performance-counter messy π
π SEE ALSO π
okay so this is the friend group, go say hi to all of them:
pmc(3)pmc.amd(3)pmc.atom(3)pmc.core(3)pmc.corei7(3)pmc.corei7uc(3)pmc.haswelluc(3)pmc.iaf(3)pmc.ivybridge(3)pmc.ivybridgexeon(3)pmc.sandybridge(3)pmc.sandybridgeuc(3)pmc.sandybridgexeon(3)pmc.soft(3)pmc.tsc(3)pmc.ucf(3)pmc.westmere(3)pmc.westmereuc(3)pmc_cpuinfo(3)pmclog(3)hwpmc(4)
π°οΈ HISTORY π°οΈ
the pmc library first appeared in FreeBSD 6.0. like, it's been iconic since day one, no cap π
π AUTHORS π
The Performance Counters Library (libpmc, -lpmc) library was written by Joseph Koshy <jkoshy@FreeBSD.org>.
The support for the Haswell microarchitecture was written by Hiren Panchasara <hiren.panchasara@gmail.com>.
absolute legends, both of them π«Άβ¨
and that's the whole page bestie!! this beauty came from the Debian crew, dated March 22, 2013, and its whole entire name is PMC.HASWELL(3) π go forth and count those counters ππ¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2013 Hiren Panchasara <hiren.panchasara@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms