1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 234922527SMadhavan Srinivasan /* 334922527SMadhavan Srinivasan * Performance counter support for POWER9 processors. 434922527SMadhavan Srinivasan * 534922527SMadhavan Srinivasan * Copyright 2016 Madhavan Srinivasan, IBM Corporation. 634922527SMadhavan Srinivasan */ 734922527SMadhavan Srinivasan 834922527SMadhavan Srinivasan /* 934922527SMadhavan Srinivasan * Power9 event codes. 1034922527SMadhavan Srinivasan */ 1134922527SMadhavan Srinivasan EVENT(PM_CYC, 0x0001e) 1234922527SMadhavan Srinivasan EVENT(PM_ICT_NOSLOT_CYC, 0x100f8) 1334922527SMadhavan Srinivasan EVENT(PM_CMPLU_STALL, 0x1e054) 1434922527SMadhavan Srinivasan EVENT(PM_INST_CMPL, 0x00002) 1593fc5ca9SMadhavan Srinivasan EVENT(PM_BR_CMPL, 0x4d05e) 1634922527SMadhavan Srinivasan EVENT(PM_BR_MPRED_CMPL, 0x400f6) 1734922527SMadhavan Srinivasan 1834922527SMadhavan Srinivasan /* All L1 D cache load references counted at finish, gated by reject */ 1934922527SMadhavan Srinivasan EVENT(PM_LD_REF_L1, 0x100fc) 2034922527SMadhavan Srinivasan /* Load Missed L1 */ 2134922527SMadhavan Srinivasan EVENT(PM_LD_MISS_L1_FIN, 0x2c04e) 2291e0bd1eSMadhavan Srinivasan EVENT(PM_LD_MISS_L1, 0x3e054) 2391e0bd1eSMadhavan Srinivasan /* Alternate event code for PM_LD_MISS_L1 */ 2491e0bd1eSMadhavan Srinivasan EVENT(PM_LD_MISS_L1_ALT, 0x400f0) 2534922527SMadhavan Srinivasan /* Store Missed L1 */ 2634922527SMadhavan Srinivasan EVENT(PM_ST_MISS_L1, 0x300f0) 2734922527SMadhavan Srinivasan /* L1 cache data prefetches */ 2834922527SMadhavan Srinivasan EVENT(PM_L1_PREF, 0x20054) 2934922527SMadhavan Srinivasan /* Instruction fetches from L1 */ 3034922527SMadhavan Srinivasan EVENT(PM_INST_FROM_L1, 0x04080) 3134922527SMadhavan Srinivasan /* Demand iCache Miss */ 3234922527SMadhavan Srinivasan EVENT(PM_L1_ICACHE_MISS, 0x200fd) 3334922527SMadhavan Srinivasan /* Instruction Demand sectors wriittent into IL1 */ 3434922527SMadhavan Srinivasan EVENT(PM_L1_DEMAND_WRITE, 0x0408c) 3534922527SMadhavan Srinivasan /* Instruction prefetch written into IL1 */ 361a058f16SMadhavan Srinivasan EVENT(PM_IC_PREF_WRITE, 0x0488c) 3734922527SMadhavan Srinivasan /* The data cache was reloaded from local core's L3 due to a demand load */ 3834922527SMadhavan Srinivasan EVENT(PM_DATA_FROM_L3, 0x4c042) 3934922527SMadhavan Srinivasan /* Demand LD - L3 Miss (not L2 hit and not L3 hit) */ 4034922527SMadhavan Srinivasan EVENT(PM_DATA_FROM_L3MISS, 0x300fe) 4134922527SMadhavan Srinivasan /* All successful D-side store dispatches for this thread */ 421a058f16SMadhavan Srinivasan EVENT(PM_L2_ST, 0x16880) 4334922527SMadhavan Srinivasan /* All successful D-side store dispatches for this thread that were L2 Miss */ 441a058f16SMadhavan Srinivasan EVENT(PM_L2_ST_MISS, 0x26880) 4534922527SMadhavan Srinivasan /* Total HW L3 prefetches(Load+store) */ 4634922527SMadhavan Srinivasan EVENT(PM_L3_PREF_ALL, 0x4e052) 4734922527SMadhavan Srinivasan /* Data PTEG reload */ 4834922527SMadhavan Srinivasan EVENT(PM_DTLB_MISS, 0x300fc) 4934922527SMadhavan Srinivasan /* ITLB Reloaded */ 5034922527SMadhavan Srinivasan EVENT(PM_ITLB_MISS, 0x400fc) 5134922527SMadhavan Srinivasan /* Run_Instructions */ 5234922527SMadhavan Srinivasan EVENT(PM_RUN_INST_CMPL, 0x500fa) 533f0bd8daSAnton Blanchard /* Alternate event code for PM_RUN_INST_CMPL */ 543f0bd8daSAnton Blanchard EVENT(PM_RUN_INST_CMPL_ALT, 0x400fa) 5534922527SMadhavan Srinivasan /* Run_cycles */ 5634922527SMadhavan Srinivasan EVENT(PM_RUN_CYC, 0x600f4) 573f0bd8daSAnton Blanchard /* Alternate event code for Run_cycles */ 583f0bd8daSAnton Blanchard EVENT(PM_RUN_CYC_ALT, 0x200f4) 59ac19670eSMadhavan Srinivasan /* Instruction Dispatched */ 60ac19670eSMadhavan Srinivasan EVENT(PM_INST_DISP, 0x200f2) 61ac19670eSMadhavan Srinivasan EVENT(PM_INST_DISP_ALT, 0x300f2) 6291e0bd1eSMadhavan Srinivasan /* Branch event that are not strongly biased */ 6391e0bd1eSMadhavan Srinivasan EVENT(PM_BR_2PATH, 0x20036) 6491e0bd1eSMadhavan Srinivasan /* ALternate branch event that are not strongly biased */ 6591e0bd1eSMadhavan Srinivasan EVENT(PM_BR_2PATH_ALT, 0x40036) 6664acab4eSMadhavan Srinivasan 6764acab4eSMadhavan Srinivasan /* Blacklisted events */ 6864acab4eSMadhavan Srinivasan EVENT(PM_MRK_ST_DONE_L2, 0x10134) 6964acab4eSMadhavan Srinivasan EVENT(PM_RADIX_PWC_L1_HIT, 0x1f056) 7064acab4eSMadhavan Srinivasan EVENT(PM_FLOP_CMPL, 0x100f4) 7164acab4eSMadhavan Srinivasan EVENT(PM_MRK_NTF_FIN, 0x20112) 7264acab4eSMadhavan Srinivasan EVENT(PM_RADIX_PWC_L2_HIT, 0x2d024) 7364acab4eSMadhavan Srinivasan EVENT(PM_IFETCH_THROTTLE, 0x3405e) 7464acab4eSMadhavan Srinivasan EVENT(PM_MRK_L2_TM_ST_ABORT_SISTER, 0x3e15c) 7564acab4eSMadhavan Srinivasan EVENT(PM_RADIX_PWC_L3_HIT, 0x3f056) 7664acab4eSMadhavan Srinivasan EVENT(PM_RUN_CYC_SMT2_MODE, 0x3006c) 7764acab4eSMadhavan Srinivasan EVENT(PM_TM_TX_PASS_RUN_INST, 0x4e014) 7864acab4eSMadhavan Srinivasan EVENT(PM_DISP_HELD_SYNC_HOLD, 0x4003c) 79ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_16G, 0x1c058) 80ac96588dSMadhavan Srinivasan EVENT(PM_DERAT_MISS_2M, 0x1c05a) 81ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_2M, 0x1c05c) 82ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DTLB_MISS_1G, 0x1d15c) 83ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_4K, 0x2c056) 84ac96588dSMadhavan Srinivasan EVENT(PM_DERAT_MISS_1G, 0x2c05a) 85ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DERAT_MISS_2M, 0x2d152) 86ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DTLB_MISS_4K, 0x2d156) 87ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DTLB_MISS_16G, 0x2d15e) 88ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_64K, 0x3c056) 89ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DERAT_MISS_1G, 0x3d152) 90ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DTLB_MISS_64K, 0x3d156) 91ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_16M, 0x4c056) 92ac96588dSMadhavan Srinivasan EVENT(PM_DTLB_MISS_1G, 0x4c05a) 93ac96588dSMadhavan Srinivasan EVENT(PM_MRK_DTLB_MISS_16M, 0x4c15e) 94ab4510e9SMadhavan Srinivasan 95ab4510e9SMadhavan Srinivasan /* 96ab4510e9SMadhavan Srinivasan * Memory Access Events 97ab4510e9SMadhavan Srinivasan * 98ab4510e9SMadhavan Srinivasan * Primary PMU event used here is PM_MRK_INST_CMPL (0x401e0) 99ab4510e9SMadhavan Srinivasan * To enable capturing of memory profiling, these MMCRA bits 100ab4510e9SMadhavan Srinivasan * needs to be programmed and corresponding raw event format 101ab4510e9SMadhavan Srinivasan * encoding. 102ab4510e9SMadhavan Srinivasan * 103ab4510e9SMadhavan Srinivasan * MMCRA bits encoding needed are 104ab4510e9SMadhavan Srinivasan * SM (Sampling Mode) 105ab4510e9SMadhavan Srinivasan * EM (Eligibility for Random Sampling) 106ab4510e9SMadhavan Srinivasan * TECE (Threshold Event Counter Event) 107ab4510e9SMadhavan Srinivasan * TS (Threshold Start Event) 108ab4510e9SMadhavan Srinivasan * TE (Threshold End Event) 109ab4510e9SMadhavan Srinivasan * 110ab4510e9SMadhavan Srinivasan * Corresponding Raw Encoding bits: 111ab4510e9SMadhavan Srinivasan * sample [EM,SM] 112ab4510e9SMadhavan Srinivasan * thresh_sel (TECE) 113ab4510e9SMadhavan Srinivasan * thresh start (TS) 114ab4510e9SMadhavan Srinivasan * thresh end (TE) 115ab4510e9SMadhavan Srinivasan */ 116ab4510e9SMadhavan Srinivasan EVENT(MEM_LOADS, 0x34340401e0) 117ab4510e9SMadhavan Srinivasan EVENT(MEM_STORES, 0x343c0401e0) 118