PMC.COREI7(3)
๐ธ PMC.COREI7(3) ๐ธ
okay so bestie, you found the manual page for pmc.corei7 and honestly? it's giving "deep lore" energy. this is the page where libpmc spills the tea on how to measure stuff on Intel Core i7 and Xeon 5500 family CPUs. it's a long one so hydrate first ๐
โจ NAME โจ
pmc.corei7 โ measurement events for Intel Core i7 and Xeon 5500 family CPUs ๐
๐ LIBRARY ๐
Performance Counters Library (libpmc, -lpmc)
๐ง SYNOPSIS ๐ง
#include <pmc.h>
that's it. one include. iconic behavior, no notes ๐
๐ซ DESCRIPTION ๐ซ
so. Intel Core i7 CPUs contain PMCs conforming to version 2 of the Intel performance measurement architecture. These CPUs may contain up to three classes of PMCs:
PMC_CLASS_IAFโ fixed-function counters that count only one hardware event per counter. no customization, no choices, she already knows what she wants ๐ซถPMC_CLASS_IAPโ programmable counters, meaning you can configure them to count one of a defined set of hardware events. main character energy, you pick the vibe โจ
the number of PMCs available in each class and their widths need to be determined at run time by calling pmc_cpuinfo(3). like, don't guess, bestie โ ask the CPU nicely first ๐ธ
Intel Core i7 and Xeon 5500 PMCs are documented in โVolume 3B: System Programming Guide, Part 2โ, Intel(R) 64 and IA-32 Architectures Software Developes Manual, Order Number: 253669-033US, Intel Corporation, December 2009. (yes, the manual is old enough to have a whole past life. respect your elders ๐ญ)
๐ฅ COREI7 AND XEON 5500 FIXED FUNCTION PMCS ๐ฅ
these PMCs and their supported events are documented in pmc.iaf(3). heads up though: not all CPUs in this family implement fixed-function counters. so check before you count, no cap ๐
๐ฆ COREI7 AND XEON 5500 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 โ๏ธ
๐ Event Qualifiers ๐
event specifiers for these PMCs support the following common qualifiers:
rsp=valueโ configure the Off-core Response bits. and here's the whole menu, bestie, it's a lot: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.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.DMND_IFETCHโ counts the number of demand and DCU prefetch instruction cacheline reads. does not count L2 code read prefetches.WBโ counts the number of writeback (modified to exclusive) transactions.PF_DATA_RDโ counts the number of data cacheline reads generated by L2 prefetchers.PF_RFOโ counts the number of RFO requests generated by L2 prefetchers.PF_IFETCHโ counts the number of code reads generated by L2 prefetchers.OTHERโ counts one of the following transaction types, including L3 invalidate, I/O, full or partial writes, WC or non-temporal stores, CLFLUSH, Fences, lock, unlock, split lock.UNCORE_HITโ L3 Hit: local or remote home requests that hit L3 cache in the uncore with no coherency actions required (snooping).OTHER_CORE_HIT_SNPโ L3 Hit: local or remote home requests that hit L3 cache in the uncore and was serviced by another core with a cross core snoop where no modified copies were found (clean).OTHER_CORE_HITMโ L3 Hit: local or remote home requests that hit L3 cache in the uncore and was serviced by another core with a cross core snoop where modified copies were found (HITM).REMOTE_CACHE_FWDโ L3 Miss: local homed requests that missed the L3 cache and was serviced by forwarded data following a cross package snoop where no modified copies found. (remote home requests are not counted ๐ซ)REMOTE_DRAMโ L3 Miss: remote home requests that missed the L3 cache and were serviced by remote DRAM.LOCAL_DRAMโ L3 Miss: local home requests that missed the L3 cache and were serviced by local DRAM.NON_DRAMโ non-DRAM requests that were serviced by IOH.
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. like a little threshold gate, she's picky ๐๏ธ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. one and done, periodt โจinvโ invert the sense of comparison when thecmaskqualifier is present, making the counter increment when the number of events per cycle is less than the value specified by thecmaskqualifier. flip it and reverse it ๐osโ configure the PMC to count events happening at processor privilege level0. ๐usrโ configure the PMC to count events occurring at privilege levels1,2or3. ๐ง
if neither of the os or usr qualifiers are specified, the default is to enable both. she said why choose ๐
๐ Event Specifiers (Programmable PMCs) ๐
Core i7 and Xeon 5500 programmable PMCs support the following events. buckle up, there are a lot of them and every single one is here ๐ซถ
SB_DRAIN.ANYโ (Event04H, Umask07H) counts the number of store buffer drains.STORE_BLOCKS.AT_RETโ (Event06H, Umask04H) counts number of loads delayed with at-Retirement block code. the following loads need to be executed at retirement and wait for all senior stores on the same thread to be drained: load splitting across 4K boundary (page split), load accessing uncacheable (UC or USWC) memory, load lock, and load with page table in UC or USWC memory region. it's giving "waiting in line behind everyone" ๐ญSTORE_BLOCKS.L1D_BLOCKโ (Event06H, Umask08H) cacheable loads delayed with L1D block codePARTIAL_ADDRESS_ALIASโ (Event07H, Umask01H) counts false dependency due to partial address aliasingDTLB_LOAD_MISSES.ANYโ (Event08H, Umask01H) counts all load misses that cause a page walkDTLB_LOAD_MISSES.WALK_COMPLETEDโ (Event08H, Umask02H) counts number of completed page walks due to load miss in the STLB.DTLB_LOAD_MISSES.STLB_HITโ (Event08H, Umask10H) number of cache load STLB hitsDTLB_LOAD_MISSES.PDE_MISSโ (Event08H, Umask20H) number of DTLB cache load misses where the low part of the linear to physical address translation was missed.DTLB_LOAD_MISSES.LARGE_WALK_COMPLETEDโ (Event08H, Umask80H) counts number of completed large page walks due to load miss in the STLB.MEM_INST_RETIRED.LOADSโ (Event0BH, Umask01H) counts the number of instructions with an architecturally-visible store retired on the architected path. in conjunction withld_latfacilityMEM_INST_RETIRED.STORESโ (Event0BH, Umask02H) counts the number of instructions with an architecturally-visible store retired on the architected path. in conjunction withld_latfacilityMEM_INST_RETIRED.LATENCY_ABOVE_THRESHOLDโ (Event0BH, Umask10H) counts the number of instructions exceeding the latency specified withld_latfacility. in conjunction withld_latfacilityMEM_STORE_RETIRED.DTLB_MISSโ (Event0CH, Umask01H) the event counts the number of retired stores that missed the DTLB. the DTLB miss is not counted if the store operation causes a fault. does not counter prefetches. counts both primary and secondary misses to the TLBUOPS_ISSUED.ANYโ (Event0EH, Umask01H) counts the number of Uops issued by the Register Allocation Table to the Reservation Station, i.e. the UOPs issued from the front end to the back end. ๐โโ๏ธUOPS_ISSUED.STALLED_CYCLESโ (Event0EH, Umask01H) counts the number of cycles no Uops issued by the Register Allocation Table to the Reservation Station, i.e. the UOPs issued from the front end to the back end. setinvert=1,cmask = 1๐UOPS_ISSUED.FUSEDโ (Event0EH, Umask02H) counts the number of fused Uops that were issued from the Register Allocation Table to the Reservation Station.MEM_UNCORE_RETIRED.L3_DATA_MISS_UNKNOWNโ (Event0FH, Umask01H) counts number of memory load instructions retired where the memory reference missed L3 and data source is unknown. available only for CPUID signature06_2EHMEM_UNCORE_RETIRED.OTHER_CORE_L2_HITMโ (Event0FH, Umask02H) counts number of memory load instructions retired where the memory reference hit modified data in a sibling core residing on the same socket.MEM_UNCORE_RETIRED.REMOTE_CACHE_LOCAL_HOME_HITโ (Event0FH, Umask08H) counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and HIT in a remote socket's cache. only counts locally homed lines.MEM_UNCORE_RETIRED.REMOTE_DRAMโ (Event0FH, Umask10H) counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and was remotely homed. this includes both DRAM access and HITM in a remote socket's cache for remotely homed lines.MEM_UNCORE_RETIRED.LOCAL_DRAMโ (Event0FH, Umask20H) counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and required a local socket memory reference. this includes locally homed cachelines that were in a modified state in another socket.MEM_UNCORE_RETIRED.UNCACHEABLEโ (Event0FH, Umask80H) counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and to perform I/O. available only for CPUID signature06_2EH
okay that's the end of part 1 bestie, don't go anywhere, there's more coming ๐ธ๐
FP_COMP_OPS_EXE.X87
(Event 10H, Umask 01H) โ Counts the number of FP Computational Uops Executed, bestie. And like, what counts as an FP Computational Uop? The number of FADD, FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer DIVs, and IDIVs. ๐
One lil caveat tho: this event does not distinguish an FADD used in the middle of a transcendental flow from a separate FADD instruction.
FP_COMP_OPS_EXE.MMX
(Event 10H, Umask 02H) โ Counts number of MMX Uops executed. that's it, that's the vibe โจ
FP_COMP_OPS_EXE.SSE_FP
(Event 10H, Umask 04H) โ Counts number of SSE and SSE2 FP uops executed.
FP_COMP_OPS_EXE.SSE2_INTEGER
(Event 10H, Umask 08H) โ Counts number of SSE2 integer uops executed.
FP_COMP_OPS_EXE.SSE_FP_PACKED
(Event 10H, Umask 10H) โ Counts number of SSE FP packed uops executed.
FP_COMP_OPS_EXE.SSE_FP_SCALAR
(Event 10H, Umask 20H) โ Counts number of SSE FP scalar uops executed.
FP_COMP_OPS_EXE.SSE_SINGLE_PRECISION
(Event 10H, Umask 40H) โ Counts number of SSE* FP single precision uops executed.
FP_COMP_OPS_EXE.SSE_DOUBLE_PRECISION
(Event 10H, Umask 80H) โ Counts number of SSE* FP double precision uops executed.
SIMD_INT_128.PACKED_MPY
(Event 12H, Umask 01H) โ Counts number of 128 bit SIMD integer multiply operations. math era ๐ฅ
SIMD_INT_128.PACKED_SHIFT
(Event 12H, Umask 02H) โ Counts number of 128 bit SIMD integer shift operations.
SIMD_INT_128.PACK
(Event 12H, Umask 04H) โ Counts number of 128 bit SIMD integer pack operations.
SIMD_INT_128.UNPACK
(Event 12H, Umask 08H) โ Counts number of 128 bit SIMD integer unpack operations.
SIMD_INT_128.PACKED_LOGICAL
(Event 12H, Umask 10H) โ Counts number of 128 bit SIMD integer logical operations.
SIMD_INT_128.PACKED_ARITH
(Event 12H, Umask 20H) โ Counts number of 128 bit SIMD integer arithmetic operations.
SIMD_INT_128.SHUFFLE_MOVE
(Event 12H, Umask 40H) โ Counts number of 128 bit SIMD integer shuffle and move operations.
LOAD_DISPATCH.RS
(Event 13H, Umask 01H) โ Counts number of loads dispatched from the Reservation Station that bypass the Memory Order Buffer. scootin' right past ๐
LOAD_DISPATCH.RS_DELAYED
(Event 13H, Umask 02H) โ Counts the number of delayed RS dispatches at the stage latch. And like, the lore here: if an RS dispatch can not bypass to LB, it has another chance to dispatch from the one-cycle delayed staging latch before it is written into the LB. second chances, we love to see it ๐ซถ
LOAD_DISPATCH.MOB
(Event 13H, Umask 04H) โ Counts the number of loads dispatched from the Reservation Station to the Memory Order Buffer.
LOAD_DISPATCH.ANY
(Event 13H, Umask 07H) โ Counts all loads dispatched from the Reservation Station. the whole squad fr fr
ARITH.CYCLES_DIV_BUSY
(Event 14H, Umask 01H) โ Counts the number of cycles the divider is busy executing divide or square root operations. The divide can be integer, X87 or Streaming SIMD Extensions (SSE). The square root operation can be either X87 or SSE. Set 'edge =1, invert=1, cmask=1' to count the number of divides. โ ๏ธ Heads up: Count may be incorrect When SMT is on. (yes, capital W "When", we don't ask questions ๐ญ)
ARITH.MUL
(Event 14H, Umask 02H) โ Counts the number of multiply operations executed. This includes integer as well as floating point multiply operations but excludes DPPS mul and MPSAD. Count may be incorrect When SMT is on.
INST_QUEUE_WRITES
(Event 17H, Umask 01H) โ Counts the number of instructions written into the instruction queue every cycle.
INST_DECODED.DEC0
(Event 18H, Umask 01H) โ Counts number of instructions that require decoder 0 to be decoded. Usually, this means that the instruction maps to more than 1 uop. decoder 0 is carrying the team ngl
TWO_UOP_INSTS_DECODED
(Event 19H, Umask 01H) โ An instruction that generates two uops was decoded.
INST_QUEUE_WRITE_CYCLES
(Event 1EH, Umask 01H) โ This event counts the number of cycles during which instructions are written to the instruction queue. Dividing this counter by the number of instructions written to the instruction queue (INST_QUEUE_WRITES) yields the average number of instructions decoded each cycle. โจ math โจ
If this number is less than four and the pipe stalls, this indicates that the decoder is failing to decode enough instructions per cycle to sustain the 4-wide pipeline. If SSE* instructions that are 6 bytes or longer arrive one after another, then front end throughput may limit execution speed. In such case,
okay so the original page literally justโฆ stops there. "In such case," and then nothing. mid-sentence. not me leaving y'all on a cliffhanger ๐ญ that's genuinely how it is, i'm not hiding anything from you bestie ๐
LSD_OVERFLOW
(Event 20H, Umask 01H) โ Counts number of loops that cant stream from the instruction queue. (their spelling, not mine ๐)
L2_RQSTS.LD_HIT
(Event 24H, Umask 01H) โ Counts number of loads that hit the L2 cache. L2 loads include both L1D demand misses as well as L1D prefetches. Note that L2 loads can be rejected for various reasons โ only non rejected loads are counted. ๐
L2_RQSTS.LD_MISS
(Event 24H, Umask 02H) โ Counts the number of loads that miss the L2 cache. L2 loads include both L1D demand misses as well as L1D prefetches.
L2_RQSTS.LOADS
(Event 24H, Umask 03H) โ Counts all L2 load requests. L2 loads include both L1D demand misses as well as L1D prefetches.
L2_RQSTS.RFO_HIT
(Event 24H, Umask 04H) โ Counts the number of store RFO requests that hit the L2 cache. L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. Count includes WC memory requests, where the data is not fetched but the permission to write the line is required. ๐
L2_RQSTS.RFO_MISS
(Event 24H, Umask 08H) โ Counts the number of store RFO requests that miss the L2 cache. L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches.
L2_RQSTS.RFOS
(Event 24H, Umask 0CH) โ Counts all L2 store RFO requests. L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches.
L2_RQSTS.IFETCH_HIT
(Event 24H, Umask 10H) โ Counts number of instruction fetches that hit the L2 cache. L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches.
L2_RQSTS.IFETCH_MISS
(Event 24H, Umask 20H) โ Counts number of instruction fetches that miss the L2 cache. L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches.
L2_RQSTS.IFETCHES
(Event 24H, Umask 30H) โ Counts all instruction fetches. L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches.
L2_RQSTS.PREFETCH_HIT
(Event 24H, Umask 40H) โ Counts L2 prefetch hits for both code and data.
L2_RQSTS.PREFETCH_MISS
(Event 24H, Umask 80H) โ Counts L2 prefetch misses for both code and data.
L2_RQSTS.PREFETCHES
(Event 24H, Umask C0H) โ Counts all L2 prefetches for both code and data.
L2_RQSTS.MISS
(Event 24H, Umask AAH) โ Counts all L2 misses for both code and data.
L2_RQSTS.REFERENCES
(Event 24H, Umask FFH) โ Counts all L2 requests for both code and data. the whole entire everything ๐
L2_DATA_RQSTS.DEMAND.I_STATE
(Event 26H, Umask 01H) โ Counts number of L2 data demand loads where the cache line to be loaded is in the I (invalid) state, i.e. a cache miss. L2 demand loads are both L1D demand misses and L1D prefetches.
L2_DATA_RQSTS.DEMAND.S_STATE
(Event 26H, Umask 02H) โ Counts number of L2 data demand loads where the cache line to be loaded is in the S (shared) state. L2 demand loads are both L1D demand misses and L1D prefetches.
L2_DATA_RQSTS.DEMAND.E_STATE
(Event 26H, Umask 04H) โ Counts number of L2 data demand loads where the cache line to be loaded is in the E (exclusive) state. L2 demand loads are both L1D demand misses and L1D prefetches.
L2_DATA_RQSTS.DEMAND.M_STATE
(Event 26H, Umask 08H) โ Counts number of L2 data demand loads where the cache line to be loaded is in the M (modified) state. L2 demand loads are both L1D demand misses and L1D prefetches.
L2_DATA_RQSTS.DEMAND.MESI
(Event 26H, Umask 0FH) โ Counts all L2 data demand requests. L2 demand loads are both L1D demand misses and L1D prefetches.
L2_DATA_RQSTS.PREFETCH.I_STATE
(Event 26H, Umask 10H) โ Counts number of L2 prefetch data loads where the cache line to be loaded is in the I (invalid) state, i.e. a cache miss.
L2_DATA_RQSTS.PREFETCH.S_STATE
(Event 26H, Umask 20H) โ Counts number of L2 prefetch data loads where the cache line to be loaded is in the S (shared) state. Fun detail for the girlies: a prefetch RFO will miss on an S state line, while a prefetch read will hit on an S state line. ๐ฆ
L2_DATA_RQSTS.PREFETCH.E_STATE
(Event 26H, Umask 40H) โ Counts number of L2 prefetch data loads where the cache line to be loaded is in the E (exclusive) state.
L2_DATA_RQSTS.PREFETCH.M_STATE
(Event 26H, Umask 80H) โ Counts number of L2 prefetch data loads where the cache line to be loaded is in the M (modified) state.
L2_DATA_RQSTS.PREFETCH.MESI
(Event 26H, Umask F0H) โ Counts all L2 prefetch requests.
L2_DATA_RQSTS.ANY
(Event 26H, Umask FFH) โ Counts all L2 data requests.
L2_WRITE.RFO.I_STATE
(Event 27H, Umask 01H) โ Counts number of L2 demand store RFO requests where the cache line to be loaded is in the I (invalid) state, i.e, a cache miss. The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request. (note the comma after "i.e" โ iconic, unchanged ๐
)
L2_WRITE.RFO.S_STATE
(Event 27H, Umask 02H) โ Counts number of L2 store RFO requests where the cache line to be loaded is in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request.
L2_WRITE.RFO.M_STATE
(Event 27H, Umask 08H) โ Counts number of L2 store RFO requests where the cache line to be loaded is in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request.
L2_WRITE.RFO.HIT
(Event 27H, Umask 0EH) โ Counts number of L2 store RFO requests where the cache line to be loaded is in either the S, E or M states. The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request. ๐ธ
L2_WRITE.RFO.MESIโ (Event27H, Umask0FH) counts every single L2 store RFO request there is. Quick lil note bestie: the L1D prefetcher does not issue a RFO prefetch, so this is a demand RFO request. ๐L2_WRITE.LOCK.I_STATEโ (Event27H, Umask10H) counts the L2 demand lock RFO requests where the cache line about to be loaded is sitting in the I (invalid) state โ which is just a fancy way of saying the read request missed the cache. ๐ญL2_WRITE.LOCK.S_STATEโ (Event27H, Umask20H) counts the L2 lock RFO requests where the cache line to be loaded is in the S (shared) state. ๐ซถL2_WRITE.LOCK.E_STATEโ (Event27H, Umask40H) counts the L2 demand lock RFO requests where the cache line to be loaded is in the E (exclusive) state. โจL2_WRITE.LOCK.M_STATEโ (Event27H, Umask80H) counts the L2 demand lock RFO requests where the cache line to be loaded is in the M (modified) state. ๐ฆL2_WRITE.LOCK.HITโ (Event27H, UmaskE0H) counts the L2 demand lock RFO requests where the cache line to be loaded is in either the S, E, or M state โ so, the whole "hit club," basically the it-girls of cache states. ๐L2_WRITE.LOCK.MESIโ (Event27H, UmaskF0H) counts all L2 demand lock RFO requests. every last one, no cap. ๐ฅ
L1D_WB_L2.I_STATEโ (Event28H, Umask01H) counts the L1 writebacks to the L2 where the cache line to be written is in the I (invalid) state, i.e. a cache miss. ๐L1D_WB_L2.S_STATEโ (Event28H, Umask02H) counts the L1 writebacks to the L2 where the cache line to be written is in the S state. ๐ธL1D_WB_L2.E_STATEโ (Event28H, Umask04H) counts the L1 writebacks to the L2 where the cache line to be written is in the E (exclusive) state. โญL1D_WB_L2.M_STATEโ (Event28H, Umask08H) counts the L1 writebacks to the L2 where the cache line to be written is in the M (modified) state. ๐L1D_WB_L2.MESIโ (Event28H, Umask0FH) counts all L1 writebacks to the L2. the whole parade. ๐
L3_LAT_CACHE.REFERENCEโ (Event2EH, Umask4FH) counts requests coming from the core that reference a cache line in the last level cache. The count includes speculative traffic but excludes cache line fills due to a L2 hardware-prefetch. And because cache hierarchy, cache sizes and other implementation-specific characteristics exist โ value comparison to estimate performance differences is not recommended. see Table A-1. ๐L3_LAT_CACHE.MISSโ (Event2EH, Umask41H) counts each cache miss condition for references to the last level cache. The count may include speculative traffic but excludes cache line fills due to L2 hardware-prefetches. Same warning bestie: because cache hierarchy, cache sizes and other implementation-specific characteristics โ value comparison to estimate performance differences is not recommended. see Table A-1. ๐ญ
CPU_CLK_UNHALTED.THREAD_Pโ (Event3CH, Umask00H) counts the number of thread cycles while the thread is not in a halt state. A thread enters the halt state when it's running theHLTinstruction. Heads up: the core frequency may change from time to time due to power or thermal throttling. ๐ฅ see Table A-1.CPU_CLK_UNHALTED.REF_Pโ (Event3CH, Umask01H) increments at the frequency ofTSCwhen not halted. see Table A-1. โฐ
L1D_CACHE_LD.I_STATEโ (Event40H, Umask01H) counts L1 data cache read requests where the cache line to be loaded is in the I (invalid) state โ i.e. the read request missed the cache. Counter 0, 1 only. ๐L1D_CACHE_LD.S_STATEโ (Event40H, Umask02H) counts L1 data cache read requests where the cache line to be loaded is in the S (shared) state. Counter 0, 1 only. ๐ธL1D_CACHE_LD.E_STATEโ (Event40H, Umask04H) counts L1 data cache read requests where the cache line to be loaded is in the E (exclusive) state. Counter 0, 1 only. โจL1D_CACHE_LD.M_STATEโ (Event40H, Umask08H) counts L1 data cache read requests where the cache line to be loaded is in the M (modified) state. Counter 0, 1 only. ๐ฆL1D_CACHE_LD.MESIโ (Event40H, Umask0FH) counts L1 data cache read requests, periodt. Counter 0, 1 only. ๐
L1D_CACHE_ST.S_STATEโ (Event41H, Umask02H) counts L1 data cache store RFO requests where the cache line to be loaded is in the S (shared) state. Counter 0, 1 only. ๐ซถL1D_CACHE_ST.E_STATEโ (Event41H, Umask04H) counts L1 data cache store RFO requests where the cache line to be loaded is in the E (exclusive) state. Counter 0, 1 only. โญL1D_CACHE_ST.M_STATEโ (Event41H, Umask08H) counts L1 data cache store RFO requests where the cache line to be loaded is in the M (modified) state. Counter 0, 1 only. ๐
L1D_CACHE_LOCK.HITโ (Event42H, Umask01H) counts retired load locks that hit in the L1 data cache or hit in an already allocated fill buffer. The lock portion of the load lock transaction must hit in the L1D โ and the initial load will pull the lock into the L1 data cache. Counter 0, 1 only. ๐L1D_CACHE_LOCK.S_STATEโ (Event42H, Umask02H) counts L1 data cache retired load locks that hit the target cache line in the shared state. Counter 0, 1 only. ๐ธL1D_CACHE_LOCK.E_STATEโ (Event42H, Umask04H) counts L1 data cache retired load locks that hit the target cache line in the exclusive state. Counter 0, 1 only. โจL1D_CACHE_LOCK.M_STATEโ (Event42H, Umask08H) counts L1 data cache retired load locks that hit the target cache line in the modified state. Counter 0, 1 only. ๐ฆ
L1D_ALL_REF.ANYโ (Event43H, Umask01H) counts all references โ uncached, speculated and retired โ to the L1 data cache, including all loads and stores with any memory types. Important detail: the event counts memory accesses only when they're actually performed. For example, a load blocked by an unknown store address and later performed is only counted once. And it does not include non-memory accesses, such as I/O accesses. Counter 0, 1 only. ๐ญL1D_ALL_REF.CACHEABLEโ (Event43H, Umask02H) counts all data reads and writes (speculated and retired) from cacheable memory, including locked operations. Counter 0, 1 only. ๐ฅ
DTLB_MISSES.ANYโ (Event49H, Umask01H) counts the number of misses in the STLB which cause a page walk. ๐ถโโ๏ธDTLB_MISSES.WALK_COMPLETEDโ (Event49H, Umask02H) counts the number of misses in the STLB which resulted in a completed page walk. โDTLB_MISSES.STLB_HITโ (Event49H, Umask10H) counts the number of DTLB first level misses that hit in the second level TLB. Heads up: this event is only relevant if the core contains multiple DTLB levels. ๐DTLB_MISSES.PDE_MISSโ (Event49H, Umask20H) is the number of DTLB misses caused by the low part of the address, and it includes references to 2M pages because 2M pages do not use the PDE. ๐งDTLB_MISSES.LARGE_WALK_COMPLETEDโ (Event49H, Umask80H) counts the number of misses in the STLB which resulted in a completed page walk for large pages. ๐
LOAD_HIT_PREโ (Event4CH, Umask01H) counts load operations sent to the L1 data cache while a previous SSE prefetch instruction to the same cache line has started prefetching but has not yet finished. the in-between era. ๐ซถ
L1D_PREFETCH.REQUESTSโ (Event4EH, Umask01H) counts the number of hardware prefetch requests dispatched out of the prefetch FIFO. ๐คL1D_PREFETCH.MISSโ (Event4EH, Umask02H) counts the number of hardware prefetch requests that miss the L1D. Quick lore drop: there are two prefetchers in the L1D โ a streamer, which predicts lines sequentially after this one should be fetched, and the IP prefetcher that remembers access patterns for the current instruction. The streamer prefetcher stops on an L1D hit, while the IP prefetcher does not. ๐L1D_PREFETCH.TRIGGERSโ (Event4EH, Umask04H) counts the number of prefetch requests triggered by the Finite State Machine and pushed into the prefetch FIFO. Some of these prefetch requests get dropped due to overwrites or competition between the IP index prefetcher and streamer prefetcher. Fun fact: the prefetch FIFO contains 4 entries. ๐
L1D.REPLโ (Event51H, Umask01H) counts the number of lines brought into the L1 data cache. Counter 0, 1 only. ๐ธL1D.M_REPLโ (Event51H, Umask02H) counts the number of modified lines brought into the L1 data cache. Counter 0, 1 only. โจL1D.M_EVICTโ (Event51H, Umask04H) counts the number of modified lines evicted from the L1 data cache due to replacement. Counter 0, 1 only. ๐ญL1D.M_SNOOP_EVICTโ (Event51H, Umask08H) counts the number of modified lines evicted from the L1 data cache due to snoopHITMintervention. Counter 0, 1 only. ๐
L1D_CACHE_PREFETCH_LOCK_FB_HITโ (Event52H, Umask01H) counts the number of cacheable load lock speculated instructions accepted into the fill buffer. ๐L1D_CACHE_LOCK_FB_HITโ (Event53H, Umask01H) counts the number of cacheable load lock speculated or retired instructions accepted into the fill buffer. ๐ซถ
CACHE_LOCK_CYCLES.L1D_L2โ (Event63H, Umask01H) is the cycle count during which the L1D and L2 are locked. A lock is asserted when there's a locked memory access, due to uncacheable memory, a locked operation that spans two cache lines, or a page walk from an uncacheable page table. Counter 0, 1 only. ๐จ Real talk: L1D and L2 locks have a very high performance penalty and it is highly recommended to avoid such accesses. not the vibe, avoid. ๐CACHE_LOCK_CYCLES.L1Dโ (Event63H, Umask02H) counts the number of cycles that the cacheline in the L1 data cache unit is locked. Counter 0, 1 only. ๐
IO_TRANSACTIONSโ (Event6CH, Umask01H) counts the number of completed I/O transactions. done and dusted. โ
L1I.HITSโ (Event80H, Umask01H) counts all instruction fetches that hit the L1 instruction cache. every single one, iconic. ๐โจL1I.MISSESโ (Event 80H, Umask 02H) Counts all the instruction fetches that miss the L1I cache ๐ that means instruction cache misses, streaming buffer misses, victim cache misses and uncacheable fetches all get counted. And bestie, listen: an instruction fetch miss gets counted once, not once for every cycle it's sitting there outstanding. No double-dipping, periodt.L1I.READSโ (Event 80H, Umask 03H) Counts every single instruction fetch, and yes that includes the uncacheable fetches that straight-up bypass the L1I ๐L1I.CYCLES_STALLEDโ (Event 80H, Umask 04H) Cycle counts for when an instruction fetch stalls because of a L1I cache miss, an ITLB miss, or an ITLB fault. It's giving "stuck in traffic" energy ๐ญLARGE_ITLB.HITโ (Event 82H, Umask 01H) Counts how many large ITLB hits happen. Slay.ITLB_MISSES.ANYโ (Event 85H, Umask 01H) Counts the number of misses in all levels of the ITLB that cause a page walk ๐ถโโ๏ธITLB_MISSES.WALK_COMPLETEDโ (Event 85H, Umask 02H) Counts the number of misses in all levels of the ITLB that resulted in a completed page walk โจILD_STALL.LCPโ (Event 87H, Umask 01H) Cycles the Instruction Length Decoder stalls because of length-changing prefixes:66,67, orREX.W(for EM64T) instructions that change the length of the decoded instruction. Iconic little troublemakers.ILD_STALL.MRUโ (Event 87H, Umask 02H) Instruction Length Decoder stall cycles caused by the Brand Prediction Unit (PBU) Most Recently Used (MRU) bypass.ILD_STALL.IQ_FULLโ (Event 87H, Umask 04H) Stall cycles because the instruction queue is full. Too many girlies in the queue, no cap ๐ILD_STALL.REGENโ (Event 87H, Umask 08H) Counts the number of regen stalls.ILD_STALL.ANYโ (Event 87H, Umask 0FH) Counts any cycles where the Instruction Length Decoder is stalled. The catch-all bestie ๐ซถBR_INST_EXEC.CONDโ (Event 88H, Umask 01H) Counts the number of conditional near branch instructions executed โ but not necessarily retired, iykyk.BR_INST_EXEC.DIRECTโ (Event 88H, Umask 02H) Counts all unconditional near branch instructions, excluding calls and indirect branches.BR_INST_EXEC.INDIRECT_NON_CALLโ (Event 88H, Umask 04H) Counts the number of executed indirect near branch instructions that are not calls.BR_INST_EXEC.NON_CALLSโ (Event 88H, Umask 07H) Counts all non-call near branch instructions executed, but not necessarily retired.BR_INST_EXEC.RETURN_NEARโ (Event 88H, Umask 08H) Counts indirect near branches that have a return mnemonic. Coming back like a boomerang ๐ชBR_INST_EXEC.DIRECT_NEAR_CALLโ (Event 88H, Umask 10H) Counts unconditional near call branch instructions executed, excluding non-call branches.BR_INST_EXEC.INDIRECT_NEAR_CALLโ (Event 88H, Umask 20H) Counts indirect near calls executed โ both register indirect and memory indirect ๐BR_INST_EXEC.NEAR_CALLSโ (Event 88H, Umask 30H) Counts all near call branches executed, but not necessarily retired.BR_INST_EXEC.TAKENโ (Event 88H, Umask 40H) Counts taken near branches executed, but not necessarily retired. Taken, like, obviously ๐BR_INST_EXEC.ANYโ (Event 88H, Umask 7FH) Counts all near executed branches (not necessarily retired). Heads up: this includes only instructions, not micro-op branches. And ngl โ frequent branching is not necessarily a major performance issue, but frequent branch mispredictions may be a problem ๐BR_MISP_EXEC.CONDโ (Event 89H, Umask 01H) Counts the number of mispredicted conditional near branch instructions executed, but not necessarily retired.BR_MISP_EXEC.DIRECTโ (Event 89H, Umask 02H) Counts mispredicted macro unconditional near branch instructions, excluding calls and indirect branches โ and bestie, this one should always be 0 ๐BR_MISP_EXEC.INDIRECT_NON_CALLโ (Event 89H, Umask 04H) Counts the number of executed mispredicted indirect near branch instructions that are not calls.BR_MISP_EXEC.NON_CALLSโ (Event 89H, Umask 07H) Counts mispredicted non-call near branches executed, but not necessarily retired.BR_MISP_EXEC.RETURN_NEARโ (Event 89H, Umask 08H) Counts mispredicted indirect branches that have a rear return mnemonic.BR_MISP_EXEC.DIRECT_NEAR_CALLโ (Event 89H, Umask 10H) Counts mispredicted non-indirect near calls executed โ and again, this should always be 0 ๐ญBR_MISP_EXEC.INDIRECT_NEAR_CALLโ (Event 89H, Umask 20H) Counts mispredicted indirect near calls executed, including both register and memory indirect.BR_MISP_EXEC.NEAR_CALLSโ (Event 89H, Umask 30H) Counts all mispredicted near call branches executed, but not necessarily retired.BR_MISP_EXEC.TAKENโ (Event 89H, Umask 40H) Counts executed mispredicted near branches that are taken, but not necessarily retired.BR_MISP_EXEC.ANYโ (Event 89H, Umask 7FH) Counts the number of mispredicted near branch instructions that were executed, but not necessarily retired. The whole misprediction cinematic universe ๐RESOURCE_STALLS.ANYโ (Event A2H, Umask 01H) Counts the number of Allocator resource-related stalls. Includes register renaming buffer entries and memory buffer entries. On top of the resource-related stalls, this also counts some other events โ including stalls that pop up during branch misprediction recovery, like when retirement of the mispredicted branch is delayed, and stalls that happen while the store buffer is draining from synchronizing operations. What it does not include: stalls due to SuperQ (off-core) queue full, too many cache misses, etc. So don't come for it about those ๐RESOURCE_STALLS.LOADโ (Event A2H, Umask 02H) Counts the cycles of stall due to a lack of load buffer for a load operation.RESOURCE_STALLS.RS_FULLโ (Event A2H, Umask 04H) Counts the number of cycles when the number of instructions in the pipeline waiting for execution reaches the limit the processor can handle. A high count of this event means there are long-latency operations in the pipe โ possibly load and store operations that miss the L2 cache, or instructions dependent on instructions further down the pipeline that have yet to retire. When the RS is full, new instructions cannot enter the reservation station and start execution. It's giving "club's at capacity" ๐ซRESOURCE_STALLS.STOREโ (Event A2H, Umask 08H) Counts the number of cycles where a resource-related stall will occur because the number of store instructions reached the pipeline's limit โ i.e. all store buffers are used. The stall ends when a store instruction commits its data to the cache or memory. Closure ๐RESOURCE_STALLS.ROB_FULLโ (Event A2H, Umask 10H) Counts the cycles of stall due to the re-order buffer being full.RESOURCE_STALLS.FPCWโ (Event A2H, Umask 20H) Counts the number of cycles while execution was stalled due to writing the floating-point unit (FPU) control word.RESOURCE_STALLS.MXCSRโ (Event A2H, Umask 40H) Stalls due to the MXCSR register rename occurring too close to a previous MXCSR rename. Just so you know, the MXCSR provides control and status for the MMX registers โจRESOURCE_STALLS.OTHERโ (Event A2H, Umask 80H) Counts the number of cycles while execution was stalled due to other resource issues. The miscellaneous era ๐MACRO_INSTS.FUSIONS_DECODEDโ (Event A6H, Umask 01H) Counts the number of instructions decoded that are macro-fused โ but not necessarily executed or retired. Decoded โ done, bestie.BACLEAR_FORCE_IQโ (Event A7H, Umask 01H) Counts the number of times a BACLEAR was forced by the Instruction Queue. So here's the lore: the IQ is also responsible for providing conditional branch prediction direction based on a static scheme and dynamic data provided by the L2 Branch Prediction Unit. If the conditional branch target isn't found in the Target Array and the IQ predicts that the branch is taken, then the IQ will force the Branch Address Calculator to issue a BACLEAR. Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble in the instruction fetch pipeline ๐ญ eight whole cycles, gone.LSD.UOPSโ (Event A8H, Umask 01H) Counts the number of micro-ops delivered by the loop stream detector. Usecmask=1and invert to count cycles.ITLB_FLUSHโ (Event AEH, Umask 01H) Counts the number of ITLB flushes ๐ฝ (jk, but it is a flush)OFFCORE_REQUESTS.L1D_WRITEBACKโ (Event B0H, Umask 40H) Counts the number of L1D writebacks to the uncore.UOPS_EXECUTED.PORT0โ (Event B1H, Umask 01H) Counts the number of Uops executed that were issued on port 0. Port 0 handles integer arithmetic, SIMD and FP add Uops. Busy girl ๐UOPS_EXECUTED.PORT1โ (Event B1H, Umask 02H) Counts the number of Uops executed that were issued on port 1. Port 1 handles integer arithmetic, SIMD, integer shift, FP multiply and FP divide Uops. She does it all ๐UOPS_EXECUTED.PORT2_COREโ (Event B1H, Umask 04H) Counts the number of Uops executed that were issued on port 2. Port 2 handles the load Uops. Heads up: this is a core count only and can not be collected per thread ๐ โโ๏ธUOPS_EXECUTED.PORT3_COREโ (Event B1H, Umask 08H) Counts the number of Uops executed that were issued on port 3. Port 3 handles store Uops. Again โ core count only, can not be collected per thread.UOPS_EXECUTED.PORT4_COREโ (Event B1H, Umask 10H) Counts the number of Uops executed that were issued on port 4. Port 4 handles the value to be stored for the store Uops issued on port 3. And yep โ core count only, can not be collected per thread.UOPS_EXECUTED.CORE_ACTIVE_CYCLES_NO_PORT5โ (Event B1H, Umask 1FH) Counts cycles when the Uops executed were issued from any ports except port 5. Bestie, the knob situation: useCmask=1for active cycles;Cmask=0for weighted cycles; useCMask=1,Invert=1to count P0-4 stalled cycles; useCmask=1,Edge=1,Invert=1to count P0-4 stalls.UOPS_EXECUTED.PORT5โ (Event B1H, Umask 20H) Counts the number of Uops executed that were issued on port 5. The one that got left out of the last event, we love her ๐ซถUOPS_EXECUTED.CORE_ACTIVE_CYCLESโ (Event B1H, Umask 3FH) Counts cycles when the Uops are executing. Same knob drill: useCmask=1for active cycles;Cmask=0for weighted cycles; useCMask=1,Invert=1to count P0-4 stalled cycles; useCmask=1,Edge=1,Invert=1to count P0-4 stalls.UOPS_EXECUTED.PORT015โ (EventB1H, Umask40H) counts how many uops got executed that were issued on port 0, 1, or 5. bestie if you wanna count stall cycles instead, usecmask=1, invert=1๐UOPS_EXECUTED.PORT234โ (EventB1H, Umask80H) counts the number of uops executed that were issued on port 2, 3, or 4. slay.OFFCORE_REQUESTS_SQ_FULLโ (EventB2H, Umask01H) counts the number of cycles the SQ is full and can't handle off-core requests. it's giving "line out the door" energy ๐ญOFF_CORE_RESPONSE_0โ (EventB7H, Umask01H) see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. โ ๏ธ requires programming MSR01A6Hโ no cap, you gotta set that up first.SNOOP_RESPONSE.HITโ (EventB8H, Umask01H) counts HIT snoop responses sent by this thread in response to a snoop request. ๐ฆSNOOP_RESPONSE.HITEโ (EventB8H, Umask02H) counts HIT E snoop responses sent by this thread in response to a snoop request. โจSNOOP_RESPONSE.HITMโ (EventB8H, Umask04H) counts HIT M snoop responses sent by this thread in response to a snoop request. ๐ฅOFF_CORE_RESPONSE_1โ (EventBBH, Umask01H) see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. โ ๏ธ this one needs MSR01A7Hprogrammed โ different MSR than the_0one, don't mix them up bestie ๐INST_RETIRED.ANY_Pโ (EventC0H, Umask01H) see Table A-1. Notes, and these matter:INST_RETIRED.ANYis counted by a designated fixed counter, whileINST_RETIRED.ANY_Pis counted by a programmable counter and is an architectural performance event. it's supported ifCPUID.A.EBX[1] = 0. Counting deets: faulting executions ofGETSEC/VM entry/VM Exit/MWait will not count as retired instructions. periodt ๐INST_RETIRED.X87โ (EventC0H, Umask02H) counts the number of MMX instructions retired. yes, that's what the original says, we're not gonna question it, we're just reporting it ๐ซถINST_RETIRED.MMXโ (EventC0H, Umask04H) counts the number of floating point computational operations retired โ specifically floating point computational operations executed by the assist handler, plus sub-operations of complex floating point instructions like transcendental instructions. ๐งUOPS_RETIRED.ANYโ (EventC2H, Umask01H) counts the number of micro-ops retired (macro-fused=1,micro-fused=2, others=1; maximum count of 8 per cycle). most instructions are composed of one or two micro-ops โ some instructions get decoded into longer sequences, like repeat instructions, floating point transcendental instructions, and assists. usecmask=1and invert to count active cycles or stalled cycles. ๐UOPS_RETIRED.RETIRE_SLOTSโ (EventC2H, Umask02H) counts the number of retirement slots used each cycle. iconic. ๐UOPS_RETIRED.MACRO_FUSEDโ (EventC2H, Umask04H) counts the number of macro-fused uops retired. ๐MACHINE_CLEARS.CYCLESโ (EventC3H, Umask01H) counts the cycles machine clear is asserted. ๐MACHINE_CLEARS.MEM_ORDERโ (EventC3H, Umask02H) counts the number of machine clears due to memory order conflicts. your pipeline said "nope" fr fr ๐ญMACHINE_CLEARS.SMCโ (EventC3H, Umask04H) counts the number of times a program writes to a code section. and listen โ self-modifying code causes a severe penalty in all Intel 64 and IA-32 processors. the modified cache line gets written back to the L2 and L3 caches. so like, don't do that ๐BR_INST_RETIRED.ALL_BRANCHESโ (EventC4H, Umask00H) see Table A-1. ๐BR_INST_RETIRED.CONDITIONALโ (EventC4H, Umask01H) counts the number of conditional branch instructions retired. the "if bestie then bestie else bestie" of instructions ๐ธBR_INST_RETIRED.NEAR_CALLโ (EventC4H, Umask02H) counts the number of direct & indirect near unconditional calls retired. ๐ซถBR_INST_RETIRED.ALL_BRANCHESโ (EventC4H, Umask04H) counts the number of branch instructions retired. (yes it's listed again with a different umask โ that's how the original rolls, I don't make the rules โจ)BR_MISP_RETIRED.ALL_BRANCHESโ (EventC5H, Umask00H) see Table A-1. ๐BR_MISP_RETIRED.NEAR_CALLโ (EventC5H, Umask02H) counts mispredicted direct & indirect near unconditional retired calls. the predictor fumbled the bag ๐SSEX_UOPS_RETIRED.PACKED_SINGLEโ (EventC7H, Umask01H) counts SIMD packed single-precision floating point Uops retired. ๐SSEX_UOPS_RETIRED.SCALAR_SINGLEโ (EventC7H, Umask02H) counts SIMD scalar single-precision floating point Uops retired. (sic โ the original literally says "SIMD calar", we're keeping the typo energy alive ๐ญ)SSEX_UOPS_RETIRED.PACKED_DOUBLEโ (EventC7H, Umask04H) counts SIMD packed double-precision floating point Uops retired. โจSSEX_UOPS_RETIRED.SCALAR_DOUBLEโ (EventC7H, Umask08H) counts SIMD scalar double-precision floating point Uops retired. ๐SSEX_UOPS_RETIRED.VECTOR_INTEGERโ (EventC7H, Umask10H) counts 128-bit SIMD vector integer Uops retired. highkey a vibe ๐ฅITLB_MISS_RETIREDโ (EventC8H, Umask20H) counts the number of retired instructions that missed the ITLB when the instruction was fetched. ๐ฆMEM_LOAD_RETIRED.L1D_HITโ (EventCBH, Umask01H) counts the number of retired loads that hit the L1 data cache. the cozy short trip ๐MEM_LOAD_RETIRED.L2_HITโ (EventCBH, Umask02H) counts the number of retired loads that hit the L2 data cache. โจMEM_LOAD_RETIRED.L3_UNSHARED_HITโ (EventCBH, Umask04H) counts the number of retired loads that hit their own, unshared lines in the L3 cache. no sharing, main character energy ๐MEM_LOAD_RETIRED.OTHER_CORE_L2_HIT_HITMโ (EventCBH, Umask08H) counts the number of retired loads that hit in a sibling core's L2 (on die core). since the L3 is inclusive of all cores on the package, this counts as an L3 hit โ and it counts both clean or modified hits. ๐ซถMEM_LOAD_RETIRED.L3_MISSโ (EventCBH, Umask10H) counts the number of retired loads that miss the L3 cache. the load was satisfied by a remote socket, local memory, or an IOH. long-distance relationship vibes ๐ญMEM_LOAD_RETIRED.HIT_LFBโ (EventCBH, Umask40H) counts the number of retired loads that miss the L1D and whose address is located in an allocated line fill buffer and will soon be committed to cache. this is counting secondary L1D misses. ๐ธMEM_LOAD_RETIRED.DTLB_MISSโ (EventCBH, Umask80H) counts the number of retired loads that missed the DTLB. a few caveats, bestie, pay attention: the DTLB miss is not counted if the load operation causes a fault; this event counts loads from cacheable memory only; the event does not count loads by software prefetches; and it counts both primary and secondary misses to the TLB. ๐FP_MMX_TRANS.TO_FPโ (EventCCH, Umask01H) counts the first floating-point instruction following any MMX instruction. you can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. ๐FP_MMX_TRANS.TO_MMXโ (EventCCH, Umask02H) counts the first MMX instruction following a floating-point instruction. same deal โ you can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. ๐FP_MMX_TRANS.ANYโ (EventCCH, Umask03H) counts all transitions from floating point to MMX instructions and from MMX instructions to floating point instructions. and yes, you can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. it's the both-ways bestie ๐MACRO_INSTS.DECODEDโ (EventD0H, Umask01H) counts the number of instructions decoded (but not necessarily executed or retired). decoded โ did the thing, iykyk ๐UOPS_DECODED.MSโ (EventD1H, Umask02H) counts the number of Uops decoded by the Microcode Sequencer, MS. the MS delivers uops when the instruction is more than 4 uops long or a microcode assist is occurring. ๐งUOPS_DECODED.ESP_FOLDINGโ (EventD1H, Umask04H) counts the number of stack pointer (ESP) instructions decoded:push,pop,call,ret, etc. ESP instructions do not generate a Uop to increment or decrement ESP โ instead, they update anESP_Offsetregister that keeps track of the delta to the current value of the ESP register. so efficient, we love that ๐UOPS_DECODED.ESP_SYNCโ (EventD1H, Umask08H) counts the number of stack pointer (ESP) sync operations, where an ESP instruction is corrected by adding the ESP offset register to the current value of the ESP register. ๐RAT_STALLS.FLAGSโ (EventD2H, Umask01H) counts the number of cycles during which execution stalled due to several reasons, one of which is a partial flag register stall. a partial register stall may occur when two conditions are met: 1) an instruction modifies some, but not all, of the flags in the flag register, and 2) the next instruction, which depends on flags, depends on flags that were not modified by this instruction. half-updated flags = chaos ๐ญRAT_STALLS.REGISTERSโ (EventD2H, Umask02H) this event counts the number of cycles instruction execution latency became longer than the defined latency, because the instruction used a register that was partially written by a previous instruction. ๐ซถRAT_STALLS.ROB_READ_PORTโ (EventD2H, Umask04H) counts the number of cycles when ROB read port stalls occurred, which did not allow new micro-ops to enter the out-of-order pipeline. ๐ heads up though: at this stage in the pipeline, additional stalls may occur at the same cycle and prevent the stalled micro-ops from entering the pipe โ in that case, micro-ops retry entering the execution pipe in the next cycle and the ROB-read port stall is counted again. ๐RAT_STALLS.SCOREBOARDโ (EventD2H, Umask08H) counts the cycles where we stall due to microarchitecturally required serialization. microcode scoreboarding stalls. it's giving "waiting for the group chat to agree" ๐RAT_STALLS.ANYโ (EventD2H, Umask0FH) counts all Register Allocation Table stall cycles due to: cycles when ROB read port stalls occurred, which did not allow new micro-ops to enter the execution pipe; cycles when partial register stalls occurred; cycles when flag stalls occurred; and cycles when floating-point unit (FPU) status word stalls occurred. ๐ to count each of these conditions separately, use the events:RAT_STALLS.ROB_READ_PORT,RAT_STALLS.PARTIAL,RAT_STALLS.FLAGS, andRAT_STALLS.FPSW.SEG_RENAME_STALLSโ (EventD4H, Umask01H) counts the stall cycles you eat because there just aren't enough renaming resources for theES,DS,FS, andGSsegment registers ๐ญ. Like, if a segment gets renamed but isn't retired yet and then a second update to that same segment shows up, the front-end of the pipeline just stalls out until the renamed segment retires. rip.ES_REG_RENAMESโ (EventD5H, Umask01H) counts how many times theESsegment register gets renamed โจ.UOP_UNFUSIONโ (EventDBH, Umask01H) counts unfusion events caused by a floating point exception hitting a fused uop ๐ .BR_INST_DECODEDโ (EventE0H, Umask01H) counts the branch instructions that got decoded ๐ธ.BPU_MISSED_CALL_RETโ (EventE5H, Umask01H) counts the times the Branch Prediction Unit fumbled predicting a call or a return branch ๐.BACLEAR.CLEARโ (EventE6H, Umask01H) counts how often the front end gets resteered โ mostly when the Branch Prediction Unit can't give a correct prediction and the Branch Address Calculator at the front end has to come in and fix it ๐ซถ. This can happen when the code has so many branches that the BPU can't consume them all. EveryBACLEARasserted by the BAC generates roughly an 8 cycle bubble in the instruction fetch pipeline, and the effect on total execution time depends on the surrounding code. iykyk.BACLEAR.BAD_TARGETโ (EventE6H, Umask02H) counts the Branch Address Calculator clears (BACLEAR) asserted because of conditional branch instructions where there was a target hit but the direction was wrong ๐. EachBACLEARasserted by the BAC generates approximately an 8 cycle bubble in the instruction fetch pipeline.BPU_CLEARS.EARLYโ (EventE8H, Umask01H) counts early (normal) Branch Prediction Unit clears: the BPU predicted a taken branch after incorrectly assuming it was not taken ๐ฌ. That clear leads to a 2 cycle bubble in the Front End.BPU_CLEARS.LATEโ (EventE8H, Umask02H) counts late Branch Prediction Unit clears due to Most Recently Used conflicts. The PBU clear leads to a 3 cycle bubble in the Front End.L2_TRANSACTIONS.LOADโ (EventF0H, Umask01H) counts L2 load operations from HW prefetch or demand loads ๐ฆ.L2_TRANSACTIONS.RFOโ (EventF0H, Umask02H) counts L2 RFO operations from HW prefetch or demand RFOs.L2_TRANSACTIONS.IFETCHโ (EventF0H, Umask04H) counts L2 instruction fetch operations from HW prefetch or demand ifetch.L2_TRANSACTIONS.PREFETCHโ (EventF0H, Umask08H) counts L2 prefetch operations.L2_TRANSACTIONS.L1D_WBโ (EventF0H, Umask10H) counts L1D writeback operations going to the L2.L2_TRANSACTIONS.FILLโ (EventF0H, Umask20H) counts L2 cache line fill operations from loads, RFO, L1D writeback or prefetch ๐ฅ.L2_TRANSACTIONS.WBโ (EventF0H, Umask40H) counts L2 writeback operations going to the L3.L2_TRANSACTIONS.ANYโ (EventF0H, Umask80H) counts, like, all the L2 cache operations ๐.L2_LINES_IN.S_STATEโ (EventF1H, Umask02H) counts the cache lines allocated in the L2 cache in the S (shared) state.L2_LINES_IN.E_STATEโ (EventF1H, Umask04H) counts the cache lines allocated in the L2 cache in the E (exclusive) state.L2_LINES_IN.ANYโ (EventF1H, Umask07H) counts the cache lines allocated in the L2 cache. full stop.L2_LINES_OUT.DEMAND_CLEANโ (EventF2H, Umask01H) counts L2 clean cache lines evicted by a demand request ๐งน.L2_LINES_OUT.DEMAND_DIRTYโ (EventF2H, Umask02H) counts L2 dirty (modified) cache lines evicted by a demand request.L2_LINES_OUT.PREFETCH_CLEANโ (EventF2H, Umask04H) counts L2 clean cache lines evicted by a prefetch request.L2_LINES_OUT.PREFETCH_DIRTYโ (EventF2H, Umask08H) counts L2 modified cache lines evicted by a prefetch request.L2_LINES_OUT.ANYโ (EventF2H, Umask0FH) counts every single L2 cache line evicted, no matter the reason ๐ .SQ_MISC.SPLIT_LOCKโ (EventF4H, Umask10H) counts the number of SQ lock splits across a cache line.SQ_FULL_STALL_CYCLESโ (EventF6H, Umask01H) counts the cycles where the Super Queue is full ๐ญ. When that happens, neither of the threads on this core can access the uncore. not one. not the other. rough.FP_ASSIST.ALLโ (EventF7H, Umask01H) counts the floating point operations that needed micro-code assist intervention ๐ฅ. Assists are required in these cases: SSE instructions, (Denormal input when theDAZflag is off or Underflow result when theFTZflag is off); x87 instructions, (NaN or denormal are loaded to a register or used as input from memory, Division by 0 or Underflow output).FP_ASSIST.OUTPUTโ (EventF7H, Umask02H) counts the floating point micro-code assists where the output value (destination register) is invalid.FP_ASSIST.INPUTโ (EventF7H, Umask04H) counts the floating point micro-code assists where the input value (one of the source operands to an FP instruction) is invalid.SIMD_INT_64.PACKED_MPYโ (EventFDH, Umask01H) counts SID integer 64 bit packed multiply operations โจ.SIMD_INT_64.PACKED_SHIFTโ (EventFDH, Umask02H) counts SID integer 64 bit packed shift operations.SIMD_INT_64.PACKโ (EventFDH, Umask04H) counts SID integer 64 bit pack operations.SIMD_INT_64.UNPACKโ (EventFDH, Umask08H) counts SID integer 64 bit unpack operations.SIMD_INT_64.PACKED_LOGICALโ (EventFDH, Umask10H) counts SID integer 64 bit logical operations.SIMD_INT_64.PACKED_ARITHโ (EventFDH, Umask20H) counts SID integer 64 bit arithmetic operations.SIMD_INT_64.SHUFFLE_MOVEโ (EventFDH, Umask40H) counts SID integer 64 bit shift or move operations.
๐ Event Specifiers (Programmable PMCs) ๐
Core i7 and Xeon 5500 programmable PMCs support the following events as the June 2009 document (removed in December 2009 โ ๏ธ) โ so yeah, these are giving limited-edition, archive-only, don't-count-on-them energy:
SB_FORWARD.ANYโ (Event02H, Umask01H) counts the number of store forwards ๐ซ.LOAD_BLOCK.STDโ (Event03H, Umask01H) counts the loads blocked by a preceding store with unknown data.LOAD_BLOCK.ADDRESS_OFFSETโ (Event03H, Umask04H) counts the loads blocked by a preceding store address.LOAD_BLOCK.ADDRESS_OFFSETโ (Event01H, Umask04H) counts the cycles of store buffer drains ๐ฎโ๐จ. (yes bestie, same name as the one above, different event โ that's genuinely what the doc says, not me glitching)MISALIGN_MEM_REF.LOADโ (Event05H, Umask01H) counts the number of misaligned load references.MISALIGN_MEM_REF.STOREโ (Event05H, Umask02H) counts the number of misaligned store references.MISALIGN_MEM_REF.ANYโ (Event05H, Umask03H) counts the number of misaligned memory references.STORE_BLOCKS.NOT_STAโ (Event06H, Umask01H) counts the load operations delayed by preceding stores whose addresses are known but whose data is unknown, plus preceding stores that conflict with the load but only incompletely overlap it ๐ซ .STORE_BLOCKS.STAโ (Event06H, Umask02H) counts load operations delayed by preceding stores whose addresses are unknown (STA block).STORE_BLOCKS.ANYโ (Event06H, Umask0FH) all loads delayed due to store blocks ๐.MEMORY_DISAMBIGURATION.RESETโ (Event09H, Umask01H) counts memory disambiguration reset cycles.MEMORY_DISAMBIGURATION.SUCCESSโ (Event09H, Umask02H) counts the loads where memory disambiguration succeeded โ .MEMORY_DISAMBIGURATION.WATCHDOGโ (Event09H, Umask04H) counts how many times the memory disambiguration watchdog kicked in ๐.MEMORY_DISAMBIGURATION.WATCH_CYCLESโ (Event09H, Umask08H) counts the cycles the memory disambiguration watchdog is active. setinvert=1,cmask = 1.HW_INT.RCVโ (Event1DH, Umask01H) number of interrupts received.HW_INT.CYCLES_MASKEDโ (Event1DH, Umask02H) number of cycles interrupts are masked ๐.HW_INT.CYCLES_PENDING_AND_MASKEDโ (Event1DH, Umask04H) number of cycles interrupts are pending and masked.HW_INT.CYCLES_PENDING_AND_MASKEDโ (Event04H, Umask04H) counts L2 store RFO requests where the cache line to be loaded is in the E (exclusive) state. The L1D prefetcher does not issue a RFO prefetch โ this is a demand RFO request ๐ . (same name again, different event code, we love a reused label)HW_INT.CYCLES_PENDING_AND_MASKEDโ (Event27H, Umask04H)LONGEST_LAT_CACH E.MISS(copying this one exactly as it's written, spaces and all โ not my typo to fix ๐)UOPS_DECODED.DEC0โ (Event3DH, Umask01H) counts micro-ops decoded by decoder 0 โญ.UOPS_DECODED.DEC0โ (Event01H, Umask01H) counts L1 data cache store RFO requests where the cache line to be loaded is in the I state. Counter 0, 1 only (and yes, same name, different event โ the doc said it twice and so did I)0FHโ (Event41H, Umask41H)L1D_CACHE_ST.MESIcounts L1 data cache store RFO requests. Counter 0, 1 only. (genuinely the whole name is0FH, I'm not messing with you ๐)DTLB_MISSES.PDE_MISSโ (Event49H, Umask20H) number of DTLB cache misses where the low part of the linear to physical address translation was missed.DTLB_MISSES.PDP_MISSโ (Event49H, Umask40H) number of DTLB misses where the high part of the linear to physical address translation was missed.DTLB_MISSES.LARGE_WALK_COMPLETEDโ (Event49H, Umask80H) counts the completed large page walks due to misses in the STLB ๐ถโโ๏ธ.SSE_MEM_EXEC.NTAโ (Event4BH, Umask01H) counts SSE NTA prefetch / weakly-ordered instructions that missed the L1 data cache.SSE_MEM_EXEC.STREAMING_STORESโ (Event4BH, Umask08H) counts the number of SSE non temporal stores ๐.SFENCE_CYCLESโ (Event4DH, Umask01H) counts store fence cycles ๐ง.EPT.EPDE_MISSโ (Event4FH, Umask02H) counts Extended Page Directory Entry misses. The Extended Page Directory cache is used by Virtual Machine operating systems while the guest operating systems use the standard TLB caches ๐ฅ๏ธโจ.
continuing the event list, bestie โ every single one is here, no cap:
EPT.EPDPE_HITโEvent 4FH, Umask 04H. Counts Extended Page Directory Pointer Entry hits. โจEPT.EPDPE_MISSโEvent 4FH, Umask 08H. Counts Extended Page Directory Pointer Entry misses. ๐OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_DATAโEvent 60H, Umask 01H. Counts weighted cycles of offcore demand data read requests. Does not include L2 prefetch requests.counter 0. ๐ซถOFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODEโEvent 60H, Umask 02H. Counts weighted cycles of offcore demand code read requests. Does not include L2 prefetch requests.counter 0. ๐ซถOFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFOโEvent 60H, Umask 04H. Counts weighted cycles of offcore demand RFO requests. Does not include L2 prefetch requests.counter 0. ๐ซถOFFCORE_REQUESTS_OUTSTANDING.ANY.READโEvent 60H, Umask 08H. Counts weighted cycles of offcore read requests of any kind. Includes L2 prefetch requests.counter 0. ๐ซถIFU_IVC.FULLโEvent 81H, Umask 01H. The Instruction Fetch unit victim cache is full. ๐ญIFU_IVC.L1I_EVICTIONโEvent 81H, Umask 02H. L1 Instruction cache evictions. ๐ธL1I_OPPORTUNISTIC_HITSโEvent 83H, Umask 01H. Opportunistic hits in streaming. โญITLB_MISSES.WALK_CYCLESโEvent 85H, Umask 04H. Counts ITLB miss page walk cycles. ๐ฆITLB_MISSES.PMH_BUSY_CYCLESโEvent 85H, Umask 04H. Counts PMH busy cycles. ๐ฆITLB_MISSES.STLB_HITโEvent 85H, Umask 10H. Counts the number of ITLB misses that hit in the second level TLB. ๐ITLB_MISSES.PDE_MISSโEvent 85H, Umask 20H. Number of ITLB misses where the low part of the linear to physical address translation was missed. ๐ฅITLB_MISSES.PDP_MISSโEvent 85H, Umask 40H. Number of ITLB misses where the high part of the linear to physical address translation was missed. ๐ฅITLB_MISSES.LARGE_WALK_COMPLETEDโEvent 85H, Umask 80H. Counts the number of completed large page walks due to misses in the STLB. ๐ITLB_MISSES.LARGE_WALK_COMPLETEDโEvent 01H, Umask 80H. Counts the number of offcore demand data read requests. Does not count L2 prefetch requests. Yes bestie, the same name shows up twice with different event/umask numbers โ both stay. ๐OFFCORE_REQUESTS.DEMAND.READ_CODEโEvent B0H, Umask 02H. Counts the number of offcore demand code read requests. Does not count L2 prefetch requests. ๐OFFCORE_REQUESTS.DEMAND.RFOโEvent B0H, Umask 04H. Counts the number of offcore demand RFO requests. Does not count L2 prefetch requests. ๐OFFCORE_REQUESTS.ANY.READโEvent B0H, Umask 08H. Counts the number of offcore read requests. Includes L2 prefetch requests. ๐OFFCORE_REQUESTS.ANY.RFOโEvent B0H, Umask 10H. Counts the number of offcore RFO requests. Includes L2 prefetch requests. ๐OFFCORE_REQUESTS.UNCACHED_MEMโEvent B0H, Umask 20H. Counts the number of offcore uncached memory requests. ๐งOFFCORE_REQUESTS.ANYโEvent B0H, Umask 80H. Counts all offcore requests. ๐ซSNOOPQ_REQUESTS_OUTSTANDING.DATAโEvent B3H, Umask 01H. Counts weighted cycles of snoopq requests for data. Counter 0 only; usecmask=1to count cycles that are not empty. ๐ซถSNOOPQ_REQUESTS_OUTSTANDING.INVALIDATEโEvent B3H, Umask 02H. Counts weighted cycles of snoopq invalidate requests. Counter 0 only; usecmask=1to count cycles that are not empty. ๐ซถSNOOPQ_REQUESTS_OUTSTANDING.CODEโEvent B3H, Umask 04H. Counts weighted cycles of snoopq requests for code. Counter 0 only; usecmask=1to count cycles that are not empty. ๐ซถSNOOPQ_REQUESTS_OUTSTANDING.CODEโEvent BAH, Umask 04H. Counts the number of TPR reads. Another same-name moment, different numbers โ iconic duplicate energy, both listed. ๐PIC_ACCESSES.TPR_WRITESโEvent BAH, Umask 02H. Counts the number of TPR writes that are one or two micro-ops. Some instructions are decoded into longer sequences. ๐ธMACHINE_CLEARS.FUSION_ASSISTโEvent C3H, Umask 10H. Counts the number of macro-fusion assists. Also counts retired SIMD packed single- precision floating point Uops. ๐ฅBOGUS_BRโEvent E4H, Umask 01H. Counts the number of bogus branches. ๐L2_HW_PREFETCH.HITโEvent F3H, Umask 01H. Counts L2 HW prefetcher detector hits. โจL2_HW_PREFETCH.ALLOCโEvent F3H, Umask 02H. Counts L2 HW prefetcher allocations. โจL2_HW_PREFETCH.DATA_TRIGGERโEvent F3H, Umask 04H. Counts L2 HW data prefetcher triggered. ๐ฆL2_HW_PREFETCH.CODE_TRIGGERโEvent F3H, Umask 08H. Counts L2 HW code prefetcher triggered. ๐ฆL2_HW_PREFETCH.DCA_TRIGGERโEvent F3H, Umask 10H. Counts L2 HW DCA prefetcher triggered. ๐ฆL2_HW_PREFETCH.KICK_STARTโEvent F3H, Umask 20H. Counts L2 HW prefetcher kick started. โญSQ_MISC.PROMOTIONโEvent F4H, Umask 01H. Counts the number of L2 secondary misses that hit the Super Queue. ๐SQ_MISC.PROMOTION_POST_GOโEvent F4H, Umask 02H. Counts the number of L2 secondary misses during the Super Queue filling L2. ๐SQ_MISC.LRU_HINTSโEvent F4H, Umask 04H. Counts the number of Super Queue LRU hints sent to L3. ๐SQ_MISC.FILL_DROPPEDโEvent F4H, Umask 08H. Counts the number of SQ L2 fills dropped due to L2 busy. ๐ญSEGMENT_REG_LOADSโEvent F8H, Umask 01H. Counts the number of segment register loads. ๐
๐ SEE ALSO ๐
pmc(3)pmc.amd(3)pmc.atom(3)pmc.core(3)pmc.corei7uc(3)pmc.iaf(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. โญ
๐ AUTHORS ๐
The Performance Counters Library (libpmc, -lpmc) library was written by Joseph Koshy <jkoshy@FreeBSD.org>. ๐
okay thatโs the end of the page โ footer vibe check: Debian, March 24, 2010, PMC.COREI7(3). iconic. ๐
๐ฆ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2010 Fabien Thomas. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms