# =======================================================================================
#
#      Filename:  perfmon_zen3_events.txt
#
#      Description:  Event list for AMD Zen (Gen3)
#
#      Version:   <VERSION>
#      Released:  <DATE>
#
#      Author:   Thomas Gruber (tr), thomas.roehl@googlemail.com
#      Project:  likwid
#
#      Copyright (C) 2017 RRZE, University Erlangen-Nuremberg
#
#      This program is free software: you can redistribute it and/or modify it under
#      the terms of the GNU General Public License as published by the Free Software
#      Foundation, either version 3 of the License, or (at your option) any later
#      version.
#
#      This program is distributed in the hope that it will be useful, but WITHOUT ANY
#      WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
#      PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
#      You should have received a copy of the GNU General Public License along with
#      this program.  If not, see <http://www.gnu.org/licenses/>.
#
# =======================================================================================

# Fixed Events
# Not working well. With accessdaemon the counts are off. With perf_event, the
# event always returns zero
#EVENT_INST_RETIRED_ANY                      0x06 FIXC0
#UMASK_INST_RETIRED_ANY                      0x00

EVENT_ACTUAL_CPU_CLOCK                      0x01 FIXC1
UMASK_ACTUAL_CPU_CLOCK                      0x00

EVENT_APERF                                 0x01 FIXC1
UMASK_APERF                                 0x00

EVENT_MAX_CPU_CLOCK                         0x02 FIXC2
UMASK_MAX_CPU_CLOCK                         0x00

EVENT_MPERF                                 0x02 FIXC2
UMASK_MPERF                                 0x00

# Core-local Events

EVENT_MERGE                                            0xFFF PMC
UMASK_MERGE                                            0x00

# FP events

# Must be used with MERGE event
EVENT_RETIRED_SSE_AVX_FLOPS                     0x03    PMC
UMASK_RETIRED_SSE_AVX_FLOPS_ADD_SUB      0x01
UMASK_RETIRED_SSE_AVX_FLOPS_MULT         0x02
UMASK_RETIRED_SSE_AVX_FLOPS_DIV          0x04
UMASK_RETIRED_SSE_AVX_FLOPS_ADD_MULT_DIV 0x07
UMASK_RETIRED_SSE_AVX_FLOPS_MAC          0x08
UMASK_RETIRED_SSE_AVX_FLOPS_FMA          0x08
UMASK_RETIRED_SSE_AVX_FLOPS_ALL          0x0F

EVENT_RETIRED_SERIALIZING_OPS                       0x05    PMC
UMASK_RETIRED_SERIALIZING_OPS_SSE_BOTTOM            0x08
UMASK_RETIRED_SERIALIZING_OPS_SSE_CONTROL           0x04
UMASK_RETIRED_SERIALIZING_OPS_X87_BOTTOM            0x02
UMASK_RETIRED_SERIALIZING_OPS_X87_CONTROL           0x01

EVENT_FP_DISPATCH_FAULTS                0x0E PMC
UMASK_FP_DISPATCH_FAULTS_X87_FILL       0x01
UMASK_FP_DISPATCH_FAULTS_XMM_FILL       0x02
UMASK_FP_DISPATCH_FAULTS_YMM_FILL       0x04
UMASK_FP_DISPATCH_FAULTS_YMM_SPILL      0x08
UMASK_FP_DISPATCH_FAULTS_SSE_AVX_STALL  0x0E


# LS Events

EVENT_BAD_STATUS2                       0x24 PMC
UMASK_BAD_STATUS2_STLI_NO_STATE         0x01
UMASK_BAD_STATUS2_STLI_OTHER            0x02
UMASK_BAD_STATUS2_STLF_NO_DATA          0x03

EVENT_RETIRED_LOCK_INSTR                0x25 PMC
UMASK_RETIRED_LOCK_INSTR_BUS_LOCK       0x01
UMASK_RETIRED_LOCK_INSTR_NON_SPEC_LOCK  0x02
UMASK_RETIRED_LOCK_INSTR_SPEC_LOCK_LO_SPEC 0x04
UMASK_RETIRED_LOCK_INSTR_SPEC_LOCK_HI_SPEC 0x08

EVENT_RETIRED_CLFLUSH                   0x26 PMC
UMASK_RETIRED_CLFLUSH                   0x00

EVENT_RETIRED_CPUID                     0x27 PMC
UMASK_RETIRED_CPUID                     0x00

EVENT_LS_DISPATCH                      0x29 PMC
UMASK_LS_DISPATCH_LOADS                0x01
UMASK_LS_DISPATCH_STORES               0x02
UMASK_LS_DISPATCH_LOAD_OP_STORES       0x04
UMASK_LS_DISPATCH_ALL                  0x07

EVENT_SMIS_RECEIVED                    0x2B PMC
UMASK_SMIS_RECEIVED                    0x00

EVENT_INTERRUPTS_TAKEN                 0x2C PMC
UMASK_INTERRUPTS_TAKEN                 0x00

EVENT_TSC_READS                         0x2D PMC
UMASK_TSC_READS                         0x00

EVENT_ST_TO_LD_FWD                     0x35 PMC
UMASK_ST_TO_LD_FWD                     0x00

EVENT_ST_COMMIT_CANCELS                0x37 PMC
UMASK_ST_COMMIT_CANCELS_ST_COMMIT_CANCEL_WCB_FULL 0x01

EVENT_DATA_CACHE_ACCESSES              0x40 PMC
UMASK_DATA_CACHE_ACCESSES              0x00

EVENT_DATA_CACHE_REFILLS                            0x43 PMC
UMASK_DATA_CACHE_REFILLS_LOCAL_L2                   0x01
UMASK_DATA_CACHE_REFILLS_INT_CACHE                  0x02
UMASK_DATA_CACHE_REFILLS_EXT_CACHE_LOCAL            0x04
UMASK_DATA_CACHE_REFILLS_LOCAL_DRAM                 0x08
UMASK_DATA_CACHE_REFILLS_LOCAL_ALL                  0x0F
UMASK_DATA_CACHE_REFILLS_EXT_REMOTE_CACHE           0x10
UMASK_DATA_CACHE_REFILLS_REMOTE_DRAM                0x40
UMASK_DATA_CACHE_REFILLS_REMOTE_ALL                 0x50
UMASK_DATA_CACHE_REFILLS_ALL                        0xFF
UMASK_DATA_CACHE_REFILLS_FROM_MEMORY                0x48
UMASK_DATA_CACHE_REFILLS_FROM_REMOTE_NODE           0x50
UMASK_DATA_CACHE_REFILLS_FROM_SAME_CCX              0x03
UMASK_DATA_CACHE_REFILLS_FROM_EXTERNAL_CCX_CACHE    0x14

EVENT_L1_DC_REFILLS                             0x44 PMC
UMASK_L1_DC_REFILLS_LOCAL_L2                    0x01
UMASK_L1_DC_REFILLS_INT_CACHE                   0x02
UMASK_L1_DC_REFILLS_EXT_CACHE_LOCAL             0x04
UMASK_L1_DC_REFILLS_LOCAL_DRAM                  0x08
UMASK_L1_DC_REFILLS_LOCAL_ALL                   0x0F
UMASK_L1_DC_REFILLS_EXT_CACHE_REMOTE            0x10
UMASK_L1_DC_REFILLS_REMOTE_DRAM                 0x40
UMASK_L1_DC_REFILLS_REMOTE_ALL                  0x50
UMASK_L1_DC_REFILLS_ALL                         0x5F
UMASK_L1_DC_REFILLS_EXT_CACHE                   0x14
UMASK_L1_DC_REFILLS_LOCAL_CACHE_L2_L3           0x03
UMASK_L1_DC_REFILLS_DRAM                        0x48

EVENT_L1_DTLB_MISS                     0x45 PMC
UMASK_L1_DTLB_MISS_4K_L2_HIT           0x01
UMASK_L1_DTLB_MISS_2M_L2_HIT           0x04
UMASK_L1_DTLB_MISS_1G_L2_HIT           0x08
UMASK_L1_DTLB_MISS_ANY_L2_HIT          0x0F
UMASK_L1_DTLB_MISS_4K_L2_MISS          0x10
UMASK_L1_DTLB_MISS_2M_L2_MISS          0x40
UMASK_L1_DTLB_MISS_1G_L2_MISS          0x80
UMASK_L1_DTLB_MISS_ANY_L2_MISS         0xF0
UMASK_L1_DTLB_MISS_ANY_MISS            0xFF

EVENT_PAGE_TABLE_WALKS                 0x46 PMC
UMASK_PAGE_TABLE_WALKS_WALK_DSIDE      0x01
UMASK_PAGE_TABLE_WALKS_WALK_ISIDE      0x02
UMASK_PAGE_TABLE_WALKS_MAB_ALLOC_DSIDE 0x04
UMASK_PAGE_TABLE_WALKS_MAB_ALLOC_ISIDE 0x08

EVENT_MISALIGNED_LOADS                      0x47    PMC
UMASK_MISALIGNED_LOADS_COUNT_MA_64B         0x01
UMASK_MISALIGNED_LOADS_COUNT_MA_4K          0x02
UMASK_MISALIGNED_LOADS_ANY                  0x03

EVENT_PREF_INSTR_DISPATCHED                 0x4B    PMC
UMASK_PREF_INSTR_DISPATCHED_PREFETCH        0x01
UMASK_PREF_INSTR_DISPATCHED_PREFETCHW       0x02
UMASK_PREF_INSTR_DISPATCHED_PREFETCHNTA     0x04

EVENT_HWPF_ENTRIES_ALLOC                    0x4C PMC
UMASK_HWPF_ENTRIES_ALLOC_STREAM_ALLOC       0x01
UMASK_HWPF_ENTRIES_ALLOC_STRIDE_ALLOC       0x02
UMASK_HWPF_ENTRIES_ALLOC_REGION_ALLOC       0x04

EVENT_HWPF_ENTRIES_HIT                      0x4D PMC
UMASK_HWPF_ENTRIES_HIT_STREAM_HIT           0x01
UMASK_HWPF_ENTRIES_HIT_STRIDE_HIT           0x02
UMASK_HWPF_ENTRIES_HIT_REGION_HIT           0x04

EVENT_TABLEWALKER_LATENCY                   0x4E PMC
UMASK_TABLEWALKER_LATENCY_MAB0_DSIDE_WALKS  0x41
UMASK_TABLEWALKER_LATENCY_MAB1_DSIDE_WALKS  0x42
UMASK_TABLEWALKER_LATENCY_MAB2_DSIDE_WALKS  0x44
UMASK_TABLEWALKER_LATENCY_MAB3_DSIDE_WALKS  0x48
UMASK_TABLEWALKER_LATENCY_MAB4_DSIDE_WALKS  0x50
UMASK_TABLEWALKER_LATENCY_MAB5_DSIDE_WALKS  0x60
UMASK_TABLEWALKER_LATENCY_MAB0_ISIDE_WALKS  0x81
UMASK_TABLEWALKER_LATENCY_MAB1_ISIDE_WALKS  0x82
UMASK_TABLEWALKER_LATENCY_MAB2_ISIDE_WALKS  0x84
UMASK_TABLEWALKER_LATENCY_MAB3_ISIDE_WALKS  0x88
UMASK_TABLEWALKER_LATENCY_MAB4_ISIDE_WALKS  0x90
UMASK_TABLEWALKER_LATENCY_MAB5_ISIDE_WALKS  0xA0


EVENT_WC_BUFFER_CLOSE_FLUSH                 0x50 PMC
UMASK_WC_BUFFER_CLOSE_FLUSH_FULL_LINE_64B   0x01
UMASK_WC_BUFFER_CLOSE_FLUSH_NEED_SBEX       0x02
UMASK_WC_BUFFER_CLOSE_FLUSH_WFQ_VIRT_CR_BUS_LOCK 0x04
UMASK_WC_BUFFER_CLOSE_FLUSH_BARRIER         0x08
UMASK_WC_BUFFER_CLOSE_FLUSH_WCB_FULL        0x10
UMASK_WC_BUFFER_CLOSE_FLUSH_TIMER           0x20
UMASK_WC_BUFFER_CLOSE_FLUSH_SMC_HIT         0x40
UMASK_WC_BUFFER_CLOSE_FLUSH_LD_HIT          0x80

EVENT_INEFFECTIVE_SW_PREF                    0x52    PMC
UMASK_INEFFECTIVE_SW_PREF_DATA_PIPE_SW_PF_DC_HIT     0x01
UMASK_INEFFECTIVE_SW_PREF_MAB_MCH_CNT        0x02
UMASK_INEFFECTIVE_SW_PREF_ANY               0x03

EVENT_MAB_MATCH                             0x55 PMC
UMASK_MAB_MATCH                             0x00

EVENT_HWPF_MAB_ALLOC                        0x57 PMC
UMASK_HWPF_MAB_ALLOC_STREAM                 0x01
UMASK_HWPF_MAB_ALLOC_L1_STRIDE              0x02
UMASK_HWPF_MAB_ALLOC_REGION                 0x04
UMASK_HWPF_MAB_ALLOC_L2_STRIDE              0x08

EVENT_HWPF_MAB_MATCH                        0x58 PMC
UMASK_HWPF_MAB_MATCH_STREAM                 0x01
UMASK_HWPF_MAB_MATCH_L1_STRIDE              0x02
UMASK_HWPF_MAB_MATCH_REGION                 0x04
UMASK_HWPF_MAB_MATCH_L2_STRIDE              0x08

EVENT_SWPREF_DATA_CACHE_FILLS                   0x59 PMC
UMASK_SWPREF_DATA_CACHE_FILLS_LOCAL_L2          0x01
UMASK_SWPREF_DATA_CACHE_FILLS_INT_CACHE         0x02
UMASK_SWPREF_DATA_CACHE_FILLS_EXT_CACHE_LOCAL   0x04
UMASK_SWPREF_DATA_CACHE_FILLS_LOCAL_DRAM        0x08
UMASK_SWPREF_DATA_CACHE_FILLS_LOCAL_ALL         0x0F
UMASK_SWPREF_DATA_CACHE_FILLS_EXT_CACHE_REMOTE  0x10
UMASK_SWPREF_DATA_CACHE_FILLS_REMOTE_DRAM       0x40
UMASK_SWPREF_DATA_CACHE_FILLS_REMOTE_ALL        0x50
UMASK_SWPREF_DATA_CACHE_FILLS_ALL               0x5F

EVENT_HWPREF_DATA_CACHE_FILLS                   0x5A PMC
UMASK_HWPREF_DATA_CACHE_FILLS_LOCAL_L2          0x01
UMASK_HWPREF_DATA_CACHE_FILLS_INT_CACHE         0x02
UMASK_HWPREF_DATA_CACHE_FILLS_EXT_CACHE_LOCAL   0x04
UMASK_HWPREF_DATA_CACHE_FILLS_LOCAL_DRAM        0x08
UMASK_HWPREF_DATA_CACHE_FILLS_LOCAL_ALL         0x0F
UMASK_HWPREF_DATA_CACHE_FILLS_EXT_CACHE_REMOTE  0x10
UMASK_HWPREF_DATA_CACHE_FILLS_REMOTE_DRAM       0x40
UMASK_HWPREF_DATA_CACHE_FILLS_REMOTE_ALL        0x50
UMASK_HWPREF_DATA_CACHE_FILLS_ALL               0x5F

EVENT_TABLEWALKER_DATA_CACHE_FILLS                   0x5B PMC
UMASK_TABLEWALKER_DATA_CACHE_FILLS_LOCAL_L2          0x01
UMASK_TABLEWALKER_DATA_CACHE_FILLS_LOCAL_CACHE       0x02
UMASK_TABLEWALKER_DATA_CACHE_FILLS_LOCAL_DRAM        0x08
UMASK_TABLEWALKER_DATA_CACHE_FILLS_REMOTE_NEAR_CACHE  0x04
UMASK_TABLEWALKER_DATA_CACHE_FILLS_REMOTE_FAR_CACHE  0x10
UMASK_TABLEWALKER_DATA_CACHE_FILLS_REMOTE_DRAM       0x40
UMASK_TABLEWALKER_DATA_CACHE_FILLS_LOCAL             0x0B
UMASK_TABLEWALKER_DATA_CACHE_FILLS_REMOTE            0x54
UMASK_TABLEWALKER_DATA_CACHE_FILLS_ALL               0x5F

# Use MERGE event
EVENT_COUNT_OF_ALLOC_MABS                   0x5F PMC
UMASK_COUNT_OF_ALLOC_MABS                   0x00

EVENT_TABLEWALKER_INIT_LEVEL                0x6E PMC
UMASK_TABLEWALKER_INIT_LEVEL_HIT_LEAF       0x01
UMASK_TABLEWALKER_INIT_LEVEL_RD_PTE         0x02
UMASK_TABLEWALKER_INIT_LEVEL_RD_PDE         0x04
UMASK_TABLEWALKER_INIT_LEVEL_RD_PDPE        0x08
UMASK_TABLEWALKER_INIT_LEVEL_RD_PML4E       0x10
UMASK_TABLEWALKER_INIT_LEVEL_RD_PML5E       0x20
UMASK_TABLEWALKER_INIT_LEVEL_COUNT_GUEST_HOST 0x40
UMASK_TABLEWALKER_INIT_LEVEL_COUNT_NESTED   0x80

EVENT_CPU_CLOCKS_UNHALTED                    0x76 PMC
UMASK_CPU_CLOCKS_UNHALTED                    0x00

EVENT_TLB_FLUSHES                            0x78 PMC
UMASK_TLB_FLUSHES                            0xFF

EVENT_TABLEWALKER_RETURN_TYPES                          0x170 PMC
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_VAL_DSIDE           0x41
UMASK_TABLEWALKER_RETURN_TYPES_RETRY_DSIDE              0x42
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_FAULT_DSIDE         0x44
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_ADBIT_NEEDED_DSIDE  0x48
UMASK_TABLEWALKER_RETURN_TYPES_SBEX_VAL_DSIDE           0x50
UMASK_TABLEWALKER_RETURN_TYPES_SBEX_FAULT_DSIDE         0x60
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_VAL_ISIDE           0x81
UMASK_TABLEWALKER_RETURN_TYPES_RETRY_ISIDE              0x82
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_FAULT_ISIDE         0x84
UMASK_TABLEWALKER_RETURN_TYPES_SPEC_ADBIT_NEEDED_ISIDE  0x88
UMASK_TABLEWALKER_RETURN_TYPES_SBEX_VAL_ISIDE           0x90
UMASK_TABLEWALKER_RETURN_TYPES_SBEX_FAULT_ISIDE         0xA0

# IC and BP events

EVENT_ICACHE_FETCHES                        0x80     PMC
UMASK_ICACHE_FETCHES                        0x00

EVENT_ICACHE_MISSES                         0x81     PMC
UMASK_ICACHE_MISSES                         0x00

EVENT_ICACHE_L2_REFILLS                     0x82     PMC
UMASK_ICACHE_L2_REFILLS                     0x00

EVENT_ICACHE_SYSTEM_REFILLS                 0x83     PMC
UMASK_ICACHE_SYSTEM_REFILLS                 0x00

EVENT_L1_ITLB_MISS_L2_ITLB_HIT              0x84     PMC
UMASK_L1_ITLB_MISS_L2_ITLB_HIT              0x00

EVENT_L1_ITLB_MISS_L2_ITLB_MISS                 0x85     PMC
UMASK_L1_ITLB_MISS_L2_ITLB_MISS_IF_4K           0x01
UMASK_L1_ITLB_MISS_L2_ITLB_MISS_IF_2M           0x02
UMASK_L1_ITLB_MISS_L2_ITLB_MISS_IF_1G           0x04
UMASK_L1_ITLB_MISS_L2_ITLB_MISS_COALESCED_4K    0x08
UMASK_L1_ITLB_MISS_L2_ITLB_MISS_ANY             0x0F

EVENT_STALLED_CYCLES                        0x87 PMC
UMASK_STALLED_CYCLES_BACKEND                0x01
UMASK_STALLED_CYCLES_FRONTEND               0x02

EVENT_L1_BTB_HIT                    0x8A PMC
UMASK_L1_BTB_HIT                    0x00

EVENT_L2_BTB_HIT                    0x8B PMC
UMASK_L2_BTB_HIT                    0x00

EVENT_L2_BTB_CORRECT_SPEC           0x8B PMC
UMASK_L2_BTB_CORRECT_SPEC           0x00

EVENT_ICACHE_LINES_INVALIDATED             0x8C PMC
UMASK_ICACHE_LINES_INVALIDATED_FILL        0x01
UMASK_ICACHE_LINES_INVALIDATED_L2_PROBE    0x02

EVENT_DYNAMIC_INDIRECT_PREDICTIONS          0x8E PMC
UMASK_DYNAMIC_INDIRECT_PREDICTIONS          0x00

EVENT_DEC_REDIRECTS                     0x91 PMC
UMASK_DEC_REDIRECTS                     0x00

EVENT_L1_TLB_FETCH_HIT                  0x94 PMC
UMASK_L1_TLB_FETCH_HIT_IF_4K            0x01
UMASK_L1_TLB_FETCH_HIT_IF_2M            0x04
UMASK_L1_TLB_FETCH_HIT_IF_1G            0x08

EVENT_ITLB_RELOADS                         0x99     PMC
UMASK_ITLB_RELOADS_ALL                     0x00
UMASK_ITLB_RELOADS_ITLB_INVALIDATION       0x02

EVENT_IC_TAG_HIT                            0x18E PMC
UMASK_IC_TAG_HIT                            0x07

EVENT_IC_TAG_MISS                            0x18E PMC
UMASK_IC_TAG_MISS                            0x18

EVENT_IC_TAG_ACCESSES                       0x18E PMC
UMASK_IC_TAG_ACCESSES                       0x1F

EVENT_OC_MODE_SWITCH                      0x28A PMC
UMASK_OC_MODE_SWITCH_IC_OC                0x01
UMASK_OC_MODE_SWITCH_OC_IC                0x02

# DE Events

EVENT_UOPS_QUEUE_EMTPY                  0xA9 PMC
UMASK_UOPS_QUEUE_EMTPY                  0x00

EVENT_UOPS_DISP                           0xAA PMC
UMASK_UOPS_DISP_FROM_DEC                  0x01
UMASK_UOPS_DISP_FROM_OPCACHE              0x02

EVENT_TYPE_UOPS_FROM_DECODER                0xAB PMC
UMASK_TYPE_UOPS_FROM_DECODER_FP             0x04
UMASK_TYPE_UOPS_FROM_DECODER_INT            0x08

EVENT_DISPATCH_RESOURCE_STALL_CYCLES_1                          0xAE PMC
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_INT_REGFILE              0x01
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_LOAD_QUEUE               0x02
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_STORE_QUEUE              0x04
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_TAKEN_BRANCH             0x10
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_FP_REGFILE               0x20
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_FP_SCHEDULER             0x40
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_1_FP_FLUSH                 0x80

EVENT_DISPATCH_RESOURCE_STALL_CYCLES_2                          0xAF PMC
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_2_INT_SCHEDULER_0_TOKENS   0x01
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_2_INT_SCHEDULER_1_TOKENS   0x02
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_2_INT_SCHEDULER_2_TOKENS   0x04
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_2_INT_SCHEDULER_3_TOKENS   0x08
UMASK_DISPATCH_RESOURCE_STALL_CYCLES_2_RETIRE_TOKEN_STALL       0x20


# EX (SC) Events

EVENT_RETIRED_INSTRUCTIONS                    0xC0     PMC
UMASK_RETIRED_INSTRUCTIONS                    0x00

EVENT_RETIRED_UOPS                            0xC1     PMC
UMASK_RETIRED_UOPS                            0x00

EVENT_RETIRED_BRANCH_INSTR                    0xC2     PMC
UMASK_RETIRED_BRANCH_INSTR                    0x00

EVENT_RETIRED_MISP_BRANCH_INSTR               0xC3     PMC
UMASK_RETIRED_MISP_BRANCH_INSTR               0x00

EVENT_RETIRED_TAKEN_BRANCH_INSTR              0xC4     PMC
UMASK_RETIRED_TAKEN_BRANCH_INSTR              0x00

EVENT_RETIRED_TAKEN_MISP_BRANCH_INSTR         0xC5     PMC
UMASK_RETIRED_TAKEN_MISP_BRANCH_INSTR         0x00

EVENT_RETIRED_FAR_CONTROL_TRANSFERS           0xC6     PMC
UMASK_RETIRED_FAR_CONTROL_TRANSFERS           0x00

EVENT_RETIRED_NEAR_RETURNS                    0xC8     PMC
UMASK_RETIRED_NEAR_RETURNS                    0x00

EVENT_RETIRED_NEAR_RETURNS_MISP               0xC9     PMC
UMASK_RETIRED_NEAR_RETURNS_MISP               0x00

EVENT_RETIRED_INDIRECT_BRANCHES_MISP          0xCA     PMC
UMASK_RETIRED_INDIRECT_BRANCHES_MISP          0x00

EVENT_RETIRED_MMX_FP_INSTR                    0xCB     PMC
UMASK_RETIRED_MMX_FP_INSTR_X87                0x01
UMASK_RETIRED_MMX_FP_INSTR_MMX                0x02
UMASK_RETIRED_MMX_FP_INSTR_SSE                0x04
UMASK_RETIRED_MMX_FP_INSTR_ALL                0x07

EVENT_RETIRED_INDIRECT_BRANCH_INSTR           0xCC     PMC
UMASK_RETIRED_INDIRECT_BRANCH_INSTR           0x00

EVENT_RETIRED_COND_BRANCH_INSTR               0xD1 PMC
UMASK_RETIRED_COND_BRANCH_INSTR               0x00

EVENT_DIV_BUSY_CYCLES                         0xD3 PMC
UMASK_DIV_BUSY_CYCLES                         0x00

EVENT_DIV_OP_COUNT                            0xD4 PMC
UMASK_DIV_OP_COUNT                            0x00

EVENT_RETIRED_MISP_BRANCH_INSTR_DIRECTION_MISMATCH  0x1C7 PMC
UMASK_RETIRED_MISP_BRANCH_INSTR_DIRECTION_MISMATCH  0x00

EVENT_TAGGED_IBS_OPS                          0x1CF PMC
UMASK_TAGGED_IBS_OPS_COUNT                    0x01
UMASK_TAGGED_IBS_OPS_COUNT_RETIRED            0x02
UMASK_TAGGED_IBS_OPS_COUNT_ROLLOVER           0x04

EVENT_RETIRED_FUSED_BRANCH_INSTR              0x1D0 PMC
UMASK_RETIRED_FUSED_BRANCH_INSTR              0x00

# L2 Cache Events

EVENT_REQUESTS_TO_L2_GRP1                     0x60 PMC
UMASK_REQUESTS_TO_L2_GRP1_GRP2                0x01
UMASK_REQUESTS_TO_L2_GRP1_L2_HW_PREF          0x02
UMASK_REQUESTS_TO_L2_GRP1_PREF_L2             0x04
UMASK_REQUESTS_TO_L2_GRP1_CHANGE_TO_X         0x08
UMASK_REQUESTS_TO_L2_GRP1_CACHEABLE_IC_READ   0x10
UMASK_REQUESTS_TO_L2_GRP1_LS_RD_BLOCK_C_S     0x20
UMASK_REQUESTS_TO_L2_GRP1_RD_BLOCK_X          0x40
UMASK_REQUESTS_TO_L2_GRP1_RD_BLOCK_L          0x80
UMASK_REQUESTS_TO_L2_GRP1_DATA_CACHE_MISSES   0xC8
UMASK_REQUESTS_TO_L2_GRP1_L1_CACHES_MISS      0x88
UMASK_REQUESTS_TO_L2_GRP1_ALL_NO_PF           0xF9
UMASK_REQUESTS_TO_L2_GRP1_ALL                 0xFF

EVENT_L2_CACHE_ACCESS_AFTER_L1I_MISS          0x60 PMC
UMASK_L2_CACHE_ACCESS_AFTER_L1I_MISS          0x10

EVENT_L2_CACHE_ACCESS_AFTER_L1D_MISS          0x60 PMC
UMASK_L2_CACHE_ACCESS_AFTER_L1D_MISS          0xE8

EVENT_REQUESTS_TO_L2_GRP2                     0x61 PMC
UMASK_REQUESTS_TO_L2_GRP2_BUS_LOCK_RESP       0x01
UMASK_REQUESTS_TO_L2_GRP2_BUS_LOCK_ORIG       0x02
UMASK_REQUESTS_TO_L2_GRP2_SMC_INVAL           0x04
UMASK_REQUESTS_TO_L2_GRP2_IC_READ_SIZED_NC    0x08
UMASK_REQUESTS_TO_L2_GRP2_IC_READ_SIZED       0x10
UMASK_REQUESTS_TO_L2_GRP2_IC_READ_ALL         0x18
UMASK_REQUESTS_TO_L2_GRP2_LS_READ_SIZED_NC    0x20
UMASK_REQUESTS_TO_L2_GRP2_LS_READ_SIZED       0x40
UMASK_REQUESTS_TO_L2_GRP2_LS_READ_ALL         0x60
UMASK_REQUESTS_TO_L2_GRP2_GRP1                0x80


EVENT_CORE_TO_L2_CACHE_REQUESTS                      0x64 PMC
UMASK_CORE_TO_L2_CACHE_REQUESTS_IC_FILL_MISS         0x01
UMASK_CORE_TO_L2_CACHE_REQUESTS_IC_FILL_HIT_S        0x02
UMASK_CORE_TO_L2_CACHE_REQUESTS_IC_FILL_HIT_X        0x04
UMASK_CORE_TO_L2_CACHE_REQUESTS_LD_READ_BLK_C        0x08
UMASK_CORE_TO_L2_CACHE_REQUESTS_LD_READ_BLK_X        0x10
UMASK_CORE_TO_L2_CACHE_REQUESTS_LD_READ_BLK_L_HIT_S  0x20
UMASK_CORE_TO_L2_CACHE_REQUESTS_LD_READ_BLK_L_HIT_X  0x40
UMASK_CORE_TO_L2_CACHE_REQUESTS_LD_READ_BLK_CS       0x80
UMASK_CORE_TO_L2_CACHE_REQUESTS_MISSES               0x09
UMASK_CORE_TO_L2_CACHE_REQUESTS_HITS                 0xF6

EVENT_L2_CACHE_MISS_AFTER_L1I_MISS          0x64 PMC
UMASK_L2_CACHE_MISS_AFTER_L1I_MISS          0x01

EVENT_L2_CACHE_HIT_AFTER_L1I_MISS          0x64 PMC
UMASK_L2_CACHE_HIT_AFTER_L1I_MISS          0x06

EVENT_L2_CACHE_MISS_AFTER_L1D_MISS          0x64 PMC
UMASK_L2_CACHE_MISS_AFTER_L1D_MISS          0x08

EVENT_L2_CACHE_HIT_AFTER_L1D_MISS          0x64 PMC
UMASK_L2_CACHE_HIT_AFTER_L1D_MISS          0xF0

EVENT_L2_CACHE_MISS_AFTER_L1_MISS         0x64 PMC
UMASK_L2_CACHE_MISS_AFTER_L1_MISS         0x09

EVENT_L2_PF_HIT_IN_L2                     0x70 PMC
UMASK_L2_PF_HIT_IN_L2                     0xFF

EVENT_L2_PF_HIT_IN_L3                     0x71 PMC
UMASK_L2_PF_HIT_IN_L3                     0xFF
UMASK_L2_PF_HIT_IN_L3_MISS_L2             0x1F

EVENT_L2_PF_MISS_IN_L3                    0x72 PMC
UMASK_L2_PF_MISS_IN_L3                    0xFF
UMASK_L2_PF_MISS_IN_L3_MISS_L2            0x1F

# L3 Cache Events

EVENT_L3_ACCESS                             0x04 CPMC
UMASK_L3_ACCESS_ALL_TYPES                   0xFF
UMASK_L3_ACCESS_HIT                         0xFE
UMASK_L3_ACCESS_MISS                        0x01

# Not working
#EVENT_L3_XI_SAMPLED_LATENCY                             0xAC CPMC
#UMASK_L3_XI_SAMPLED_LATENCY_DRAM_NEAR                   0x01
#UMASK_L3_XI_SAMPLED_LATENCY_DRAM_FAR                    0x02
#UMASK_L3_XI_SAMPLED_LATENCY_NEAR_CACHE_FAR_CACHE_NEAR   0x04
#UMASK_L3_XI_SAMPLED_LATENCY_NEAR_CACHE_FAR_CACHE_FAR    0x08
#UMASK_L3_XI_SAMPLED_LATENCY_EXT_NEAR                    0x10
#UMASK_L3_XI_SAMPLED_LATENCY_EXT_FAR                     0x20
#DEFAULT_OPTIONS_L3_XI_SAMPLED_LATENCY_ANY               EVENT_OPTION_TID=0x3,EVENT_OPTION_SLICE=0x3
#UMASK_L3_XI_SAMPLED_LATENCY_ANY                         0xFF

# Not working
#EVENT_L3_XI_SAMPLED_LATENCY_REQUESTS                             0xAD CPMC
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_DRAM_NEAR                   0x01
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_DRAM_FAR                    0x02
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_NEAR_CACHE_FAR_CACHE_NEAR   0x04
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_NEAR_CACHE_FAR_CACHE_FAR    0x08
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_EXT_NEAR                    0x10
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_EXT_FAR                     0x20
#DEFAULT_OPTIONS_L3_XI_SAMPLED_LATENCY_REQUESTS_ANY               EVENT_OPTION_TID=0x3,EVENT_OPTION_SLICE=0x3
#UMASK_L3_XI_SAMPLED_LATENCY_REQUESTS_ANY                         0xFF

# Energy Events

EVENT_RAPL_CORE_ENERGY                    0x01 PWR0
UMASK_RAPL_CORE_ENERGY                    0x00

EVENT_RAPL_PKG_ENERGY                     0x02 PWR1
UMASK_RAPL_PKG_ENERGY                     0x00

# Data fabric events

EVENT_DF_EVENT_REMOTE_1    0x7C7 DFC
UMASK_DF_EVENT_REMOTE_1    0x02

EVENT_DF_EVENT_REMOTE_2    0x807 DFC
UMASK_DF_EVENT_REMOTE_2    0x02

EVENT_DF_EVENT_REMOTE_3    0x847 DFC
UMASK_DF_EVENT_REMOTE_3    0x02

EVENT_DF_EVENT_REMOTE_4    0x887 DFC
UMASK_DF_EVENT_REMOTE_5    0x02

EVENT_DRAM_CHANNEL_0            0x07 DFC
UMASK_DRAM_CHANNEL_0            0x38

EVENT_DRAM_CHANNEL_1            0x47 DFC
UMASK_DRAM_CHANNEL_1            0x38

EVENT_DRAM_CHANNEL_2            0x87 DFC
UMASK_DRAM_CHANNEL_2            0x38

EVENT_DRAM_CHANNEL_3            0xC7 DFC
UMASK_DRAM_CHANNEL_3            0x38

EVENT_DRAM_CHANNEL_4            0x107 DFC
UMASK_DRAM_CHANNEL_4            0x38

EVENT_DRAM_CHANNEL_5            0x147 DFC
UMASK_DRAM_CHANNEL_5            0x38

EVENT_DRAM_CHANNEL_6            0x187 DFC
UMASK_DRAM_CHANNEL_6            0x38

EVENT_DRAM_CHANNEL_7            0x1C7 DFC
UMASK_DRAM_CHANNEL_7            0x38




