"MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot ifYeah it looks like it could be done that way. Also, the way I added it,
(cpuid_less_than(410fd493)) else (stall_slot - cpu_cycles)) / (#slots *
cpu_cycles))"
I'm currently figuring out how cpuid_less_than() would be implemented
(I'm no great python wrangler), but it would be along the lines of what
Ian added for "has_event" in
https://urldefense.com/v3/__https://lore.kernel.org/linux-perf-users/20230623151016.4193660-1-irogers@xxxxxxxxxx/__;!!ACWV5N9M2RV99hQ!PlOppEWtIj9jDW2Zlon0zRZVpzPTzPvm5Ho5NnRIN0vD78iFcEzMEAtsrW_MrRPiW84XhWpbhc3seQcmLu-BfQ$
Thanks,
John
it doesn't have access to the PMU type, it just does a generic
pmu__find_core_pmu() so won't work very well for heterogeneous systems.
If we're going to do a deeper modification of the expression parser like
with has_event() it might be possible to pass in the actual CPU ID that
the metric is running on which would be better.
I'll have a look.