aboutsummaryrefslogtreecommitdiff
path: root/goodfile
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-04-02 00:08:16 -0700
committeriximeow <me@iximeow.net>2024-04-02 00:20:11 -0700
commiteb4718a1f01bdecea9afed0ae5129491ef1b247c (patch)
treebdd50f1d072691b743227f95ecc1ef1323ab656e /goodfile
parent9dd2f26670a706db6227e3aa5301f383bf603419 (diff)
the name for instructions and cycles metrics from perf vary by kernel version
on midgard there is no :u suffix, so try both
Diffstat (limited to 'goodfile')
-rw-r--r--goodfile15
1 files changed, 11 insertions, 4 deletions
diff --git a/goodfile b/goodfile
index f0031af..1b23c52 100644
--- a/goodfile
+++ b/goodfile
@@ -84,9 +84,16 @@ if Build.environment.has("perf") then
measurements["decoded"] = tonumber(insts)
measurements["elapsed_ms"] = tonumber(ms)
- ipc = measurements["instructions:u"] / measurements["cycles:u"]
+ local instructions_name = "instructions:u"
+ local cycles_name = "cycles:u"
+ if measurements[instructions_name] == nil then
+ instructions_name = "instructions"
+ cycles_name = "cycles"
+ end
+
+ ipc = measurements[instructions_name] / measurements[cycles_name]
Build.metric("no-fmt IPC", string.format("%.3f", ipc))
- inst_per_decode = measurements["instructions:u"] / measurements["decoded"]
+ inst_per_decode = measurements[instructions_name] / measurements["decoded"]
Build.metric("no-fmt instructions/decode", string.format("%.1f", inst_per_decode))
ms_per_decode = measurements["elapsed_ms"] / measurements["decoded"]
Build.metric("no-fmt ns/decode", string.format("%.2f", ms_per_decode * 1000000))
@@ -105,9 +112,9 @@ if Build.environment.has("perf") then
measurements["decoded"] = tonumber(insts)
measurements["elapsed_ms"] = tonumber(ms)
- ipc = measurements["instructions:u"] / measurements["cycles:u"]
+ ipc = measurements[instructions_name] / measurements[cycles_name]
Build.metric("fmt IPC", string.format("%.3f", ipc))
- inst_per_decode = measurements["instructions:u"] / measurements["decoded"]
+ inst_per_decode = measurements[instructions_name] / measurements["decoded"]
Build.metric("fmt instructions/decode", string.format("%.1f", inst_per_decode))
ms_per_decode = measurements["elapsed_ms"] / measurements["decoded"]
Build.metric("fmt ns/decode", string.format("%.2f", ms_per_decode * 1000000))