# File format:
# File consists of one or more groups of PMUs and the events that go with them
# ["PMU identification string"]
#   EVENT_NAME [CPU OPTION]
# where the optional CPU OPTION can be:
#    cpu to add the counter to all cpus in the system 
#    cpu_rr to add to one of the cpus in a round-robin allocation strategy
#    node to add the counter to the first cpu in each numa node
#    node_rr to add the counter to the cpus in each numa node in a round-robin allocation strategy
#    [N] where N is the numerical digit of the CPU index
#
# if the CPU option is absent it defaults to all cpus.
#

[amd64_fam10h_barcelona amd64_fam10h_shanghai amd64_fam10h_istanbul]

DATA_CACHE_REFILLS:SYSTEM
RETIRED_SSE_OPERATIONS:ALL
CPU_CLK_UNHALTED:u

HYPERTRANSPORT_LINK2:COMMAND_DWORD_SENT:DATA_DWORD_SENT:BUFFER_RELEASE_DWORD_SENT:ADDRESS_EXT_DWORD_SENT:PER_PACKET_CRC_SENT node_rr
HYPERTRANSPORT_LINK1:COMMAND_DWORD_SENT:DATA_DWORD_SENT:BUFFER_RELEASE_DWORD_SENT:ADDRESS_EXT_DWORD_SENT:PER_PACKET_CRC_SENT node_rr
HYPERTRANSPORT_LINK0:COMMAND_DWORD_SENT:DATA_DWORD_SENT:BUFFER_RELEASE_DWORD_SENT:ADDRESS_EXT_DWORD_SENT:PER_PACKET_CRC_SENT node_rr
DRAM_ACCESSES_PAGE:HIT:MISS:CONFLICT node_rr

[amd64_fam15h_interlagos]

CPU_CLK_UNHALTED:u
RETIRED_SSE_OPERATIONS:ALL
DATA_CACHE_REFILLS_FROM_NORTHBRIDGE 

RETIRED_INSTRUCTIONS
RETIRED_UOPS

[wsm_unc]

# Fixed counters
# UNHALTED_CORE_CYCLES - uncomment if the nmi_watchdog is disabled
INSTRUCTIONS_RETIRED

# Generic counters
MEM_LOAD_RETIRED:L1D_HIT
FP_COMP_OPS_EXE:SSE_FP
MEM_UNCORE_RETIRED:OTHER_LLC_MISS
MEM_UNCORE_RETIRED:REMOTE_DRAM

# Uncore counters
UNC_CLK_UNHALTED      node

UNC_LLC_LINES_OUT:ANY node
UNC_LLC_LINES_IN:ANY  node
UNC_LLC_MISS:PROBE    node
UNC_LLC_MISS:WRITE    node
UNC_LLC_MISS:READ     node
UNC_LLC_HITS:PROBE    node
UNC_LLC_HITS:WRITE    node
UNC_LLC_HITS:READ     node

[wsm_dp]

# Fixed counters
# UNHALTED_CORE_CYCLES - uncomment if the nmi_watchdog is disabled
INSTRUCTIONS_RETIRED

# Generic counters
MEM_LOAD_RETIRED:L1D_HIT
FP_COMP_OPS_EXE:SSE_FP
MEM_UNCORE_RETIRED:OTHER_LLC_MISS
MEM_UNCORE_RETIRED:REMOTE_DRAM

[nhm_unc]

# Fixed counters
# UNHALTED_CORE_CYCLES - uncomment if the nmi_watchdog is disabled
INSTRUCTIONS_RETIRED

# Generic counters
MEM_LOAD_RETIRED:L1D_HIT
FP_COMP_OPS_EXE:SSE_FP
MEM_UNCORE_RETIRED:LOCAL_DRAM
MEM_UNCORE_RETIRED:REMOTE_DRAM

# Uncore counters
UNC_CLK_UNHALTED      node

UNC_LLC_LINES_OUT:ANY node
UNC_LLC_LINES_IN:ANY  node
UNC_LLC_MISS:PROBE    node
UNC_LLC_MISS:WRITE    node
UNC_LLC_MISS:READ     node
UNC_LLC_HITS:PROBE    node
UNC_LLC_HITS:WRITE    node
UNC_LLC_HITS:READ     node

[nhm_ex nhm]

# Fixed counters
# UNHALTED_CORE_CYCLES - uncomment if the nmi_watchdog is disabled
INSTRUCTIONS_RETIRED

# Generic counters
MEM_LOAD_RETIRED:L1D_HIT
FP_COMP_OPS_EXE:SSE_FP
MEM_UNCORE_RETIRED:LOCAL_DRAM
MEM_UNCORE_RETIRED:REMOTE_DRAM

[snb_ep]
# Fixed Counters
CPU_CLK_UNHALTED:THREAD_P
#CPU_CLK_UNHALTED:REF_P
INST_RETIRED:ANY_P

# UOPS issued and retired give approx idea of how much useful work the processor is doing. It is possible
# for the processor to be 100% busy according to top but most of the time is spent in stalled cycles
UOPS_ISSUED:ANY
UOPS_ISSUED:STALL_CYCLES
UOPS_RETIRED:ANY
UOPS_RETIRED:STALL_CYCLES

# Programmable counters
FP_COMP_OPS_EXE:X87
MEM_LOAD_UOPS_RETIRED:L1_HIT
FP_COMP_OPS_EXE:SSE_SCALAR_DOUBLE
FP_COMP_OPS_EXE:SSE_FP_PACKED_DOUBLE
SIMD_FP_256:PACKED_DOUBLE

# Uncore counters
snbep_unc_cbo0::UNC_C_CLOCKTICKS node
snbep_unc_cbo0::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo0::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo0::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo1::UNC_C_CLOCKTICKS node
snbep_unc_cbo1::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo1::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo1::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo2::UNC_C_CLOCKTICKS node
snbep_unc_cbo2::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo2::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo2::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo3::UNC_C_CLOCKTICKS node
snbep_unc_cbo3::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo3::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo3::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo4::UNC_C_CLOCKTICKS node
snbep_unc_cbo4::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo4::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo4::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo5::UNC_C_CLOCKTICKS node
snbep_unc_cbo5::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo5::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo5::UNC_C_RXR_OCCUPANCY:IRQ node

# Note that C-Box 6 and 7 are only present on the 8-core chip variant

snbep_unc_cbo6::UNC_C_CLOCKTICKS node
snbep_unc_cbo6::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo6::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo6::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_cbo7::UNC_C_CLOCKTICKS node
snbep_unc_cbo7::UNC_C_RXR_INSERTS:IRQ node
snbep_unc_cbo7::UNC_C_COUNTER0_OCCUPANCY:e:t=1 node
snbep_unc_cbo7::UNC_C_RXR_OCCUPANCY:IRQ node

snbep_unc_ha::UNC_H_CLOCKTICKS node
snbep_unc_ha::UNC_H_TXR_BL_CYCLES_FULL:ALL node
snbep_unc_ha::UNC_H_REQUESTS:READS node
snbep_unc_ha::UNC_H_REQUESTS:WRITES node

# Up to 4 integrated memory controllers. The number of active memory controllers
# will depend on the physical memory present in the system.

snbep_unc_imc0::UNC_M_ACT_COUNT node
snbep_unc_imc0::UNC_M_PRE_COUNT:PAGE_MISS node
snbep_unc_imc0::UNC_M_CAS_COUNT:RD node # == read bandwidth / 64
snbep_unc_imc0::UNC_M_CAS_COUNT:WR node # == write bandwidth / 64

snbep_unc_imc1::UNC_M_ACT_COUNT node
snbep_unc_imc1::UNC_M_PRE_COUNT:PAGE_MISS node
snbep_unc_imc1::UNC_M_CAS_COUNT:RD node # == read bandwidth / 64
snbep_unc_imc1::UNC_M_CAS_COUNT:WR node # == write bandwidth / 64

snbep_unc_imc2::UNC_M_ACT_COUNT node
snbep_unc_imc2::UNC_M_PRE_COUNT:PAGE_MISS node
snbep_unc_imc2::UNC_M_CAS_COUNT:RD node # == read bandwidth / 64
snbep_unc_imc2::UNC_M_CAS_COUNT:WR node # == write bandwidth / 64

snbep_unc_imc3::UNC_M_ACT_COUNT node
snbep_unc_imc3::UNC_M_PRE_COUNT:PAGE_MISS node
snbep_unc_imc3::UNC_M_CAS_COUNT:RD node # == read bandwidth / 64
snbep_unc_imc3::UNC_M_CAS_COUNT:WR node # == write bandwidth / 64

snbep_unc_pcu::UNC_P_CLOCKTICKS node
snbep_unc_pcu::UNC_P_FREQ_MAX_CURRENT_CYCLES node # cycles the max frequency is limited by current
snbep_unc_pcu::UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES node # cycles the max frequency is limited by temperature
snbep_unc_pcu::UNC_P_FREQ_MAX_POWER_CYCLES node # cycles the max frequency is limited by power

snbep_unc_r2pcie::UNC_R2_RING_BL_USED:CCW_EVEN node
snbep_unc_r2pcie::UNC_R2_RING_BL_USED:CCW_ODD node
snbep_unc_r2pcie::UNC_R2_RING_BL_USED:CW_EVEN node
snbep_unc_r2pcie::UNC_R2_RING_BL_USED:CW_ODD node

snbep_unc_r3qpi0::UNC_R3_CLOCKTICKS node
snbep_unc_r3qpi0::UNC_R3_TXR_INSERTS node
snbep_unc_r3qpi0::UNC_R3_TXR_CYCLES_FULL node

snbep_unc_r3qpi1::UNC_R3_CLOCKTICKS node
snbep_unc_r3qpi1::UNC_R3_TXR_INSERTS node
snbep_unc_r3qpi1::UNC_R3_TXR_CYCLES_FULL node

# RAPL power counters
RAPL:PACKAGE_ENERGY node
RAPL:PP0_ENERGY node
RAPL:DRAM_ENERGY node
RAPL:THERMAL_SPEC node
RAPL:MINIMUM_POWER node
RAPL:MAXIMUM_POWER node

[core]

FP_COMP_OPS_EXE:u
UNHALTED_CORE_CYCLES
INSTRUCTIONS_RETIRED
UNHALTED_REFERENCE_CYCLES
BACLEARS

[ix86arch]

UNHALTED_CORE_CYCLES
INSTRUCTION_RETIRED
UNHALTED_REFERENCE_CYCLES
LLC_MISSES

# Fallthough case: the perf PMU is the generic one that is likely to be always
# present.  The cycles and instructions counters likewise should be there
[perf]
cycles
instructions
