Skip to content

Commit eb4718a

Browse files
committed
the name for instructions and cycles metrics from perf vary by kernel version
on midgard there is no :u suffix, so try both
1 parent 9dd2f26 commit eb4718a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

goodfile

+11-4
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,16 @@ if Build.environment.has("perf") then
8484
measurements["decoded"] = tonumber(insts)
8585
measurements["elapsed_ms"] = tonumber(ms)
8686

87-
ipc = measurements["instructions:u"] / measurements["cycles:u"]
87+
local instructions_name = "instructions:u"
88+
local cycles_name = "cycles:u"
89+
if measurements[instructions_name] == nil then
90+
instructions_name = "instructions"
91+
cycles_name = "cycles"
92+
end
93+
94+
ipc = measurements[instructions_name] / measurements[cycles_name]
8895
Build.metric("no-fmt IPC", string.format("%.3f", ipc))
89-
inst_per_decode = measurements["instructions:u"] / measurements["decoded"]
96+
inst_per_decode = measurements[instructions_name] / measurements["decoded"]
9097
Build.metric("no-fmt instructions/decode", string.format("%.1f", inst_per_decode))
9198
ms_per_decode = measurements["elapsed_ms"] / measurements["decoded"]
9299
Build.metric("no-fmt ns/decode", string.format("%.2f", ms_per_decode * 1000000))
@@ -105,9 +112,9 @@ if Build.environment.has("perf") then
105112
measurements["decoded"] = tonumber(insts)
106113
measurements["elapsed_ms"] = tonumber(ms)
107114

108-
ipc = measurements["instructions:u"] / measurements["cycles:u"]
115+
ipc = measurements[instructions_name] / measurements[cycles_name]
109116
Build.metric("fmt IPC", string.format("%.3f", ipc))
110-
inst_per_decode = measurements["instructions:u"] / measurements["decoded"]
117+
inst_per_decode = measurements[instructions_name] / measurements["decoded"]
111118
Build.metric("fmt instructions/decode", string.format("%.1f", inst_per_decode))
112119
ms_per_decode = measurements["elapsed_ms"] / measurements["decoded"]
113120
Build.metric("fmt ns/decode", string.format("%.2f", ms_per_decode * 1000000))

0 commit comments

Comments
 (0)