Skip to content

Commit 19032ad

Browse files
author
Mamatha Inamdar
committed
tools/perf/pmu-events/powerpc: Add support for compat events in json
JIRA: https://issues.redhat.com/browse/RHEL-75636 commit 86f45d0 Author: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Date: Thu Oct 10 20:21:06 2024 +0530 tools/perf/pmu-events/powerpc: Add support for compat events in json perf list picks the events supported for specific platform from pmu-events/arch/powerpc/<platform>. Example power10 events are in pmu-events/arch/powerpc/power10, power9 events are part of pmu-events/arch/powerpc/power9. The decision of which platform to pick is determined based on PVR value in powerpc. The PVR value is matched from pmu-events/arch/powerpc/mapfile.csv Example: Format: PVR,Version,JSON/file/pathname,Type 0x004[bcd][[:xdigit:]]{4},1,power8,core 0x0066[[:xdigit:]]{4},1,power8,core 0x004e[[:xdigit:]]{4},1,power9,core 0x0080[[:xdigit:]]{4},1,power10,core 0x0082[[:xdigit:]]{4},1,power10,core The code gets the PVR from system using get_cpuid_str function in arch/powerpc/util/headers.c ( from SPRN_PVR ) and compares with value from mapfile.csv In case of compat mode, say when partition is booted in a power9 mode when the system is a power10, add an entry to pick the ISA architected events from "pmu-events/arch/powerpc/compat". Add json file generic-events.json which will contain these events which is supported in compat mode. Suggested-by: Madhavan Srinivasan <maddy@linux.ibm.com> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Tested-by: Disha Goel <disgoel@linux.ibm.com> Cc: akanksha@linux.ibm.com Cc: hbathini@linux.ibm.com Cc: kjain@linux.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20241010145107.51211-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
1 parent 446b16a commit 19032ad

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
[
2+
{
3+
"EventCode": "0x600F4",
4+
"EventName": "PM_CYC",
5+
"BriefDescription": "Processor cycles."
6+
},
7+
{
8+
"EventCode": "0x100F2",
9+
"EventName": "PM_CYC_INST_CMPL",
10+
"BriefDescription": "1 or more ppc insts finished"
11+
},
12+
{
13+
"EventCode": "0x100f4",
14+
"EventName": "PM_FLOP_CMPL",
15+
"BriefDescription": "Floating Point Operations Finished."
16+
},
17+
{
18+
"EventCode": "0x100F6",
19+
"EventName": "PM_L1_ITLB_MISS",
20+
"BriefDescription": "Number of I-ERAT reloads."
21+
},
22+
{
23+
"EventCode": "0x100F8",
24+
"EventName": "PM_NO_INST_AVAIL",
25+
"BriefDescription": "Number of cycles the ICT has no itags assigned to this thread."
26+
},
27+
{
28+
"EventCode": "0x100fc",
29+
"EventName": "PM_LD_CMPL",
30+
"BriefDescription": "Load instruction completed."
31+
},
32+
{
33+
"EventCode": "0x200F0",
34+
"EventName": "PM_ST_CMPL",
35+
"BriefDescription": "Stores completed from S2Q (2nd-level store queue)."
36+
},
37+
{
38+
"EventCode": "0x200F2",
39+
"EventName": "PM_INST_DISP",
40+
"BriefDescription": "PowerPC instruction dispatched."
41+
},
42+
{
43+
"EventCode": "0x200F4",
44+
"EventName": "PM_RUN_CYC",
45+
"BriefDescription": "Processor cycles gated by the run latch."
46+
},
47+
{
48+
"EventCode": "0x200F6",
49+
"EventName": "PM_L1_DTLB_RELOAD",
50+
"BriefDescription": "DERAT Reloaded due to a DERAT miss."
51+
},
52+
{
53+
"EventCode": "0x200FA",
54+
"EventName": "PM_BR_TAKEN_CMPL",
55+
"BriefDescription": "Branch Taken instruction completed."
56+
},
57+
{
58+
"EventCode": "0x200FC",
59+
"EventName": "PM_L1_ICACHE_MISS",
60+
"BriefDescription": "Demand instruction cache miss."
61+
},
62+
{
63+
"EventCode": "0x200FE",
64+
"EventName": "PM_L1_RELOAD_FROM_MEM",
65+
"BriefDescription": "L1 Dcache reload from memory"
66+
},
67+
{
68+
"EventCode": "0x300F0",
69+
"EventName": "PM_ST_MISS_L1",
70+
"BriefDescription": "Store Missed L1"
71+
},
72+
{
73+
"EventCode": "0x300FC",
74+
"EventName": "PM_DTLB_MISS",
75+
"BriefDescription": "Data PTEG reload"
76+
},
77+
{
78+
"EventCode": "0x300FE",
79+
"EventName": "PM_DATA_FROM_L3MISS",
80+
"BriefDescription": "Demand LD - L3 Miss (not L2 hit and not L3 hit)"
81+
},
82+
{
83+
"EventCode": "0x400F0",
84+
"EventName": "PM_LD_MISS_L1",
85+
"BriefDescription": "L1 Dcache load miss"
86+
},
87+
{
88+
"EventCode": "0x400F2",
89+
"EventName": "PM_CYC_INST_DISP",
90+
"BriefDescription": "Cycle when instruction(s) dispatched."
91+
},
92+
{
93+
"EventCode": "0x400F6",
94+
"EventName": "PM_BR_MPRED_CMPL",
95+
"BriefDescription": "A mispredicted branch completed. Includes direction and target."
96+
},
97+
{
98+
"EventCode": "0x400FA",
99+
"EventName": "PM_RUN_INST_CMPL",
100+
"BriefDescription": "PowerPC instruction completed while the run latch is set."
101+
},
102+
{
103+
"EventCode": "0x400FC",
104+
"EventName": "PM_ITLB_MISS",
105+
"BriefDescription": "Instruction TLB reload (after a miss), all page sizes. Includes only demand misses."
106+
},
107+
{
108+
"EventCode": "0x400fe",
109+
"EventName": "PM_LD_NOT_CACHED",
110+
"BriefDescription": "Load data not cached."
111+
},
112+
{
113+
"EventCode": "0x500fa",
114+
"EventName": "PM_INST_CMPL",
115+
"BriefDescription": "Instructions."
116+
}
117+
]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
0x004e[[:xdigit:]]{4},1,power9,core
1717
0x0080[[:xdigit:]]{4},1,power10,core
1818
0x0082[[:xdigit:]]{4},1,power10,core
19+
0x00ffffff,1,compat,core

0 commit comments

Comments
 (0)