Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf vendor events riscv: Add StarFive Dubhe-80 JSON file

StarFive's Dubhe-80 supports raw event id 0x00 - 0x22. The raw events
are enabled through PMU node of DT binding. Besides raw event, add
standard RISC-V firmware events to support monitoring of firmware event.

Example of PMU DT node:

pmu {
compatible = "riscv,pmu";
riscv,raw-event-to-mhpmcounters =
/* Event ID 1-31 */
<0x00 0x00 0xFFFFFFFF 0xFFFFFFE0 0x00007FF8>,
/* Event ID 32-33 */
<0x00 0x20 0xFFFFFFFF 0xFFFFFFFE 0x00007FF8>,
/* Event ID 34 */
<0x00 0x22 0xFFFFFFFF 0xFFFFFF22 0x00007FF8>;
};

Example of 'perf stat' output:

[root@user]# perf stat -a \
-e access_mmu_stlb \
-e miss_mmu_stlb \
-e access_mmu_pte_c \
-e rob_flush \
-e btb_prediction_miss \
-e itlb_miss \
-e sync_del_fetch_g \
-e icache_miss \
-e bpu_br_retire \
-e bpu_br_miss \
-e ret_ins_retire \
-e ret_ins_miss \
-- openssl speed rsa2048

Doing 2048 bits private rsa's for 10s: 39 2048 bits private RSA's in
10.14s
Doing 2048 bits public rsa's for 10s: 1563 2048 bits public RSA's in
10.00s
version: 3.0.11
built on: Tue Sep 19 13:02:31 2023 UTC
options: bn(64,64)
CPUINFO: N/A
sign verify sign/s verify/s
rsa 2048 bits 0.260000s 0.006398s 3.8 156.3

Performance counter stats for 'system wide':

1338350 access_mmu_stlb
1154025 miss_mmu_stlb
1162691 access_mmu_pte_c
34067 rob_flush
11212384 btb_prediction_miss
1256242 itlb_miss
652523491 sync_del_fetch_g
384465 icache_miss
64635789 bpu_br_retire
323440 bpu_br_miss
8785143 ret_ins_retire
31236 ret_ins_miss

20.760822480 seconds time elapsed

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nikita Shubin <n.shubin@yadro.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-riscv@lists.infradead.org
Link: https://lore.kernel.org/r/20231103082441.1389842-1-jisheng.teoh@starfivetech.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ji Sheng Teoh and committed by
Arnaldo Carvalho de Melo
acbf6de6 b539deaf

+241
+1
tools/perf/pmu-events/arch/riscv/mapfile.csv
··· 15 15 # 16 16 #MVENDORID-MARCHID-MIMPID,Version,Filename,EventType 17 17 0x489-0x8000000000000007-0x[[:xdigit:]]+,v1,sifive/u74,core 18 + 0x67e-0x80000000db000080-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core
+172
tools/perf/pmu-events/arch/riscv/starfive/dubhe-80/common.json
··· 1 + [ 2 + { 3 + "EventName": "ACCESS_MMU_STLB", 4 + "EventCode": "0x1", 5 + "BriefDescription": "access MMU STLB" 6 + }, 7 + { 8 + "EventName": "MISS_MMU_STLB", 9 + "EventCode": "0x2", 10 + "BriefDescription": "miss MMU STLB" 11 + }, 12 + { 13 + "EventName": "ACCESS_MMU_PTE_C", 14 + "EventCode": "0x3", 15 + "BriefDescription": "access MMU PTE-Cache" 16 + }, 17 + { 18 + "EventName": "MISS_MMU_PTE_C", 19 + "EventCode": "0x4", 20 + "BriefDescription": "miss MMU PTE-Cache" 21 + }, 22 + { 23 + "EventName": "ROB_FLUSH", 24 + "EventCode": "0x5", 25 + "BriefDescription": "ROB flush (all kinds of exceptions)" 26 + }, 27 + { 28 + "EventName": "BTB_PREDICTION_MISS", 29 + "EventCode": "0x6", 30 + "BriefDescription": "BTB prediction miss" 31 + }, 32 + { 33 + "EventName": "ITLB_MISS", 34 + "EventCode": "0x7", 35 + "BriefDescription": "ITLB miss" 36 + }, 37 + { 38 + "EventName": "SYNC_DEL_FETCH_G", 39 + "EventCode": "0x8", 40 + "BriefDescription": "SYNC delivery a fetch-group" 41 + }, 42 + { 43 + "EventName": "ICACHE_MISS", 44 + "EventCode": "0x9", 45 + "BriefDescription": "ICache miss" 46 + }, 47 + { 48 + "EventName": "BPU_BR_RETIRE", 49 + "EventCode": "0xA", 50 + "BriefDescription": "condition branch instruction retire" 51 + }, 52 + { 53 + "EventName": "BPU_BR_MISS", 54 + "EventCode": "0xB", 55 + "BriefDescription": "condition branch instruction miss" 56 + }, 57 + { 58 + "EventName": "RET_INS_RETIRE", 59 + "EventCode": "0xC", 60 + "BriefDescription": "return instruction retire" 61 + }, 62 + { 63 + "EventName": "RET_INS_MISS", 64 + "EventCode": "0xD", 65 + "BriefDescription": "return instruction miss" 66 + }, 67 + { 68 + "EventName": "INDIRECT_JR_MISS", 69 + "EventCode": "0xE", 70 + "BriefDescription": "indirect JR instruction miss (inlcude without target)" 71 + }, 72 + { 73 + "EventName": "IBUF_VAL_ID_NORDY", 74 + "EventCode": "0xF", 75 + "BriefDescription": "IBUF valid while ID not ready" 76 + }, 77 + { 78 + "EventName": "IBUF_NOVAL_ID_RDY", 79 + "EventCode": "0x10", 80 + "BriefDescription": "IBUF not valid while ID ready" 81 + }, 82 + { 83 + "EventName": "REN_INT_PHY_REG_NORDY", 84 + "EventCode": "0x11", 85 + "BriefDescription": "REN integer physical register file is not ready" 86 + }, 87 + { 88 + "EventName": "REN_FP_PHY_REG_NORDY", 89 + "EventCode": "0x12", 90 + "BriefDescription": "REN floating point physical register file is not ready" 91 + }, 92 + { 93 + "EventName": "REN_CP_NORDY", 94 + "EventCode": "0x13", 95 + "BriefDescription": "REN checkpoint is not ready" 96 + }, 97 + { 98 + "EventName": "DEC_VAL_ROB_NORDY", 99 + "EventCode": "0x14", 100 + "BriefDescription": "DEC is valid and ROB is not ready" 101 + }, 102 + { 103 + "EventName": "OOD_FLUSH_LS_DEP", 104 + "EventCode": "0x15", 105 + "BriefDescription": "out of order flush due to load/store dependency" 106 + }, 107 + { 108 + "EventName": "BRU_RET_IJR_INS", 109 + "EventCode": "0x16", 110 + "BriefDescription": "BRU retire an IJR instruction" 111 + }, 112 + { 113 + "EventName": "ACCESS_DTLB", 114 + "EventCode": "0x17", 115 + "BriefDescription": "access DTLB" 116 + }, 117 + { 118 + "EventName": "MISS_DTLB", 119 + "EventCode": "0x18", 120 + "BriefDescription": "miss DTLB" 121 + }, 122 + { 123 + "EventName": "LOAD_INS_DCACHE", 124 + "EventCode": "0x19", 125 + "BriefDescription": "load instruction access DCache" 126 + }, 127 + { 128 + "EventName": "LOAD_INS_MISS_DCACHE", 129 + "EventCode": "0x1A", 130 + "BriefDescription": "load instruction miss DCache" 131 + }, 132 + { 133 + "EventName": "STORE_INS_DCACHE", 134 + "EventCode": "0x1B", 135 + "BriefDescription": "store/amo instruction access DCache" 136 + }, 137 + { 138 + "EventName": "STORE_INS_MISS_DCACHE", 139 + "EventCode": "0x1C", 140 + "BriefDescription": "store/amo instruction miss DCache" 141 + }, 142 + { 143 + "EventName": "LOAD_SCACHE", 144 + "EventCode": "0x1D", 145 + "BriefDescription": "load access SCache" 146 + }, 147 + { 148 + "EventName": "STORE_SCACHE", 149 + "EventCode": "0x1E", 150 + "BriefDescription": "store access SCache" 151 + }, 152 + { 153 + "EventName": "LOAD_MISS_SCACHE", 154 + "EventCode": "0x1F", 155 + "BriefDescription": "load miss SCache" 156 + }, 157 + { 158 + "EventName": "STORE_MISS_SCACHE", 159 + "EventCode": "0x20", 160 + "BriefDescription": "store miss SCache" 161 + }, 162 + { 163 + "EventName": "L2C_PF_REQ", 164 + "EventCode": "0x21", 165 + "BriefDescription": "L2C data-prefetcher request" 166 + }, 167 + { 168 + "EventName": "L2C_PF_HIT", 169 + "EventCode": "0x22", 170 + "BriefDescription": "L2C data-prefetcher hit" 171 + } 172 + ]
+68
tools/perf/pmu-events/arch/riscv/starfive/dubhe-80/firmware.json
··· 1 + [ 2 + { 3 + "ArchStdEvent": "FW_MISALIGNED_LOAD" 4 + }, 5 + { 6 + "ArchStdEvent": "FW_MISALIGNED_STORE" 7 + }, 8 + { 9 + "ArchStdEvent": "FW_ACCESS_LOAD" 10 + }, 11 + { 12 + "ArchStdEvent": "FW_ACCESS_STORE" 13 + }, 14 + { 15 + "ArchStdEvent": "FW_ILLEGAL_INSN" 16 + }, 17 + { 18 + "ArchStdEvent": "FW_SET_TIMER" 19 + }, 20 + { 21 + "ArchStdEvent": "FW_IPI_SENT" 22 + }, 23 + { 24 + "ArchStdEvent": "FW_IPI_RECEIVED" 25 + }, 26 + { 27 + "ArchStdEvent": "FW_FENCE_I_SENT" 28 + }, 29 + { 30 + "ArchStdEvent": "FW_FENCE_I_RECEIVED" 31 + }, 32 + { 33 + "ArchStdEvent": "FW_SFENCE_VMA_SENT" 34 + }, 35 + { 36 + "ArchStdEvent": "FW_SFENCE_VMA_RECEIVED" 37 + }, 38 + { 39 + "ArchStdEvent": "FW_SFENCE_VMA_RECEIVED" 40 + }, 41 + { 42 + "ArchStdEvent": "FW_SFENCE_VMA_ASID_RECEIVED" 43 + }, 44 + { 45 + "ArchStdEvent": "FW_HFENCE_GVMA_SENT" 46 + }, 47 + { 48 + "ArchStdEvent": "FW_HFENCE_GVMA_RECEIVED" 49 + }, 50 + { 51 + "ArchStdEvent": "FW_HFENCE_GVMA_VMID_SENT" 52 + }, 53 + { 54 + "ArchStdEvent": "FW_HFENCE_GVMA_VMID_RECEIVED" 55 + }, 56 + { 57 + "ArchStdEvent": "FW_HFENCE_VVMA_SENT" 58 + }, 59 + { 60 + "ArchStdEvent": "FW_HFENCE_VVMA_RECEIVED" 61 + }, 62 + { 63 + "ArchStdEvent": "FW_HFENCE_VVMA_ASID_SENT" 64 + }, 65 + { 66 + "ArchStdEvent": "FW_HFENCE_VVMA_ASID_RECEIVED" 67 + } 68 + ]