Skip to content

Commit f5102e3

Browse files
Locus Wei-Han Chenpalmer-dabbelt
authored andcommitted
riscv: andes: Support specifying symbolic firmware and hardware raw events
Add the Andes AX45 JSON files that allows specifying symbolic event names for the raw PMU events. Signed-off-by: Locus Wei-Han Chen <locus84@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Charles Ci-Jyun Wu <dminus@andestech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Atish Patra <atishp@rivosinc.com> Acked-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20240222083946.3977135-11-peterlin@andestech.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 270fc77 commit f5102e3

File tree

5 files changed

+330
-0
lines changed

5 files changed

+330
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
]
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[
2+
{
3+
"EventCode": "0x10",
4+
"EventName": "cycle_count",
5+
"BriefDescription": "Cycle count"
6+
},
7+
{
8+
"EventCode": "0x20",
9+
"EventName": "inst_count",
10+
"BriefDescription": "Retired instruction count"
11+
},
12+
{
13+
"EventCode": "0x30",
14+
"EventName": "int_load_inst",
15+
"BriefDescription": "Integer load instruction count"
16+
},
17+
{
18+
"EventCode": "0x40",
19+
"EventName": "int_store_inst",
20+
"BriefDescription": "Integer store instruction count"
21+
},
22+
{
23+
"EventCode": "0x50",
24+
"EventName": "atomic_inst",
25+
"BriefDescription": "Atomic instruction count"
26+
},
27+
{
28+
"EventCode": "0x60",
29+
"EventName": "sys_inst",
30+
"BriefDescription": "System instruction count"
31+
},
32+
{
33+
"EventCode": "0x70",
34+
"EventName": "int_compute_inst",
35+
"BriefDescription": "Integer computational instruction count"
36+
},
37+
{
38+
"EventCode": "0x80",
39+
"EventName": "condition_br",
40+
"BriefDescription": "Conditional branch instruction count"
41+
},
42+
{
43+
"EventCode": "0x90",
44+
"EventName": "taken_condition_br",
45+
"BriefDescription": "Taken conditional branch instruction count"
46+
},
47+
{
48+
"EventCode": "0xA0",
49+
"EventName": "jal_inst",
50+
"BriefDescription": "JAL instruction count"
51+
},
52+
{
53+
"EventCode": "0xB0",
54+
"EventName": "jalr_inst",
55+
"BriefDescription": "JALR instruction count"
56+
},
57+
{
58+
"EventCode": "0xC0",
59+
"EventName": "ret_inst",
60+
"BriefDescription": "Return instruction count"
61+
},
62+
{
63+
"EventCode": "0xD0",
64+
"EventName": "control_trans_inst",
65+
"BriefDescription": "Control transfer instruction count"
66+
},
67+
{
68+
"EventCode": "0xE0",
69+
"EventName": "ex9_inst",
70+
"BriefDescription": "EXEC.IT instruction count"
71+
},
72+
{
73+
"EventCode": "0xF0",
74+
"EventName": "int_mul_inst",
75+
"BriefDescription": "Integer multiplication instruction count"
76+
},
77+
{
78+
"EventCode": "0x100",
79+
"EventName": "int_div_rem_inst",
80+
"BriefDescription": "Integer division/remainder instruction count"
81+
},
82+
{
83+
"EventCode": "0x110",
84+
"EventName": "float_load_inst",
85+
"BriefDescription": "Floating-point load instruction count"
86+
},
87+
{
88+
"EventCode": "0x120",
89+
"EventName": "float_store_inst",
90+
"BriefDescription": "Floating-point store instruction count"
91+
},
92+
{
93+
"EventCode": "0x130",
94+
"EventName": "float_add_sub_inst",
95+
"BriefDescription": "Floating-point addition/subtraction instruction count"
96+
},
97+
{
98+
"EventCode": "0x140",
99+
"EventName": "float_mul_inst",
100+
"BriefDescription": "Floating-point multiplication instruction count"
101+
},
102+
{
103+
"EventCode": "0x150",
104+
"EventName": "float_fused_muladd_inst",
105+
"BriefDescription": "Floating-point fused multiply-add instruction count"
106+
},
107+
{
108+
"EventCode": "0x160",
109+
"EventName": "float_div_sqrt_inst",
110+
"BriefDescription": "Floating-point division or square-root instruction count"
111+
},
112+
{
113+
"EventCode": "0x170",
114+
"EventName": "other_float_inst",
115+
"BriefDescription": "Other floating-point instruction count"
116+
},
117+
{
118+
"EventCode": "0x180",
119+
"EventName": "int_mul_add_sub_inst",
120+
"BriefDescription": "Integer multiplication and add/sub instruction count"
121+
},
122+
{
123+
"EventCode": "0x190",
124+
"EventName": "retired_ops",
125+
"BriefDescription": "Retired operation count"
126+
}
127+
]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[
2+
{
3+
"EventCode": "0x01",
4+
"EventName": "ilm_access",
5+
"BriefDescription": "ILM access"
6+
},
7+
{
8+
"EventCode": "0x11",
9+
"EventName": "dlm_access",
10+
"BriefDescription": "DLM access"
11+
},
12+
{
13+
"EventCode": "0x21",
14+
"EventName": "icache_access",
15+
"BriefDescription": "ICACHE access"
16+
},
17+
{
18+
"EventCode": "0x31",
19+
"EventName": "icache_miss",
20+
"BriefDescription": "ICACHE miss"
21+
},
22+
{
23+
"EventCode": "0x41",
24+
"EventName": "dcache_access",
25+
"BriefDescription": "DCACHE access"
26+
},
27+
{
28+
"EventCode": "0x51",
29+
"EventName": "dcache_miss",
30+
"BriefDescription": "DCACHE miss"
31+
},
32+
{
33+
"EventCode": "0x61",
34+
"EventName": "dcache_load_access",
35+
"BriefDescription": "DCACHE load access"
36+
},
37+
{
38+
"EventCode": "0x71",
39+
"EventName": "dcache_load_miss",
40+
"BriefDescription": "DCACHE load miss"
41+
},
42+
{
43+
"EventCode": "0x81",
44+
"EventName": "dcache_store_access",
45+
"BriefDescription": "DCACHE store access"
46+
},
47+
{
48+
"EventCode": "0x91",
49+
"EventName": "dcache_store_miss",
50+
"BriefDescription": "DCACHE store miss"
51+
},
52+
{
53+
"EventCode": "0xA1",
54+
"EventName": "dcache_wb",
55+
"BriefDescription": "DCACHE writeback"
56+
}
57+
]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[
2+
{
3+
"EventCode": "0xB1",
4+
"EventName": "cycle_wait_icache_fill",
5+
"BriefDescription": "Cycles waiting for ICACHE fill data"
6+
},
7+
{
8+
"EventCode": "0xC1",
9+
"EventName": "cycle_wait_dcache_fill",
10+
"BriefDescription": "Cycles waiting for DCACHE fill data"
11+
},
12+
{
13+
"EventCode": "0xD1",
14+
"EventName": "uncached_ifetch_from_bus",
15+
"BriefDescription": "Uncached ifetch data access from bus"
16+
},
17+
{
18+
"EventCode": "0xE1",
19+
"EventName": "uncached_load_from_bus",
20+
"BriefDescription": "Uncached load data access from bus"
21+
},
22+
{
23+
"EventCode": "0xF1",
24+
"EventName": "cycle_wait_uncached_ifetch",
25+
"BriefDescription": "Cycles waiting for uncached ifetch data from bus"
26+
},
27+
{
28+
"EventCode": "0x101",
29+
"EventName": "cycle_wait_uncached_load",
30+
"BriefDescription": "Cycles waiting for uncached load data from bus"
31+
},
32+
{
33+
"EventCode": "0x111",
34+
"EventName": "main_itlb_access",
35+
"BriefDescription": "Main ITLB access"
36+
},
37+
{
38+
"EventCode": "0x121",
39+
"EventName": "main_itlb_miss",
40+
"BriefDescription": "Main ITLB miss"
41+
},
42+
{
43+
"EventCode": "0x131",
44+
"EventName": "main_dtlb_access",
45+
"BriefDescription": "Main DTLB access"
46+
},
47+
{
48+
"EventCode": "0x141",
49+
"EventName": "main_dtlb_miss",
50+
"BriefDescription": "Main DTLB miss"
51+
},
52+
{
53+
"EventCode": "0x151",
54+
"EventName": "cycle_wait_itlb_fill",
55+
"BriefDescription": "Cycles waiting for Main ITLB fill data"
56+
},
57+
{
58+
"EventCode": "0x161",
59+
"EventName": "pipe_stall_cycle_dtlb_miss",
60+
"BriefDescription": "Pipeline stall cycles caused by Main DTLB miss"
61+
},
62+
{
63+
"EventCode": "0x02",
64+
"EventName": "mispredict_condition_br",
65+
"BriefDescription": "Misprediction of conditional branches"
66+
},
67+
{
68+
"EventCode": "0x12",
69+
"EventName": "mispredict_take_condition_br",
70+
"BriefDescription": "Misprediction of taken conditional branches"
71+
},
72+
{
73+
"EventCode": "0x22",
74+
"EventName": "mispredict_target_ret_inst",
75+
"BriefDescription": "Misprediction of targets of Return instructions"
76+
}
77+
]

tools/perf/pmu-events/arch/riscv/mapfile.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
0x489-0x8000000000000007-0x[[:xdigit:]]+,v1,sifive/u74,core
1818
0x5b7-0x0-0x0,v1,thead/c900-legacy,core
1919
0x67e-0x80000000db0000[89]0-0x[[:xdigit:]]+,v1,starfive/dubhe-80,core
20+
0x31e-0x8000000000008a45-0x[[:xdigit:]]+,v1,andes/ax45,core

0 commit comments

Comments
 (0)