N2 r0p3 doesn't require the workaround [1], so gating on (#slots - 5) no
longer works because all N2s have 5 slots. Add a new expression builtin
that allows calling strcmp_cpuid_str() and comparing CPUIDs in metric
formulas.
In this case, the commented formula looks like this:
strcmp_cpuid_str(0x410fd493) # greater than or equal to N2 r0p3
| strcmp_cpuid_str(0x410fd490) ^ 1 # OR NOT any version of N2
[1]:https://urldefense.com/v3/__https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-n2-r0p3.json__;!!ACWV5N9M2RV99hQ!MaXDALyhn3HmfLdPUZRKTItKxg73C-qP4aTNAAdFwzjW5cFEBTHtD-VyqBzUTFbXMvABB-daDD01AfI7um_BtA$ Signed-off-by: James Clark<james.clark@xxxxxxx>
---
tools/perf/arch/arm64/util/pmu.c | 18 +-----------------
.../arch/arm64/arm/neoverse-n2-v2/metrics.json | 8 ++++----
tools/perf/pmu-events/metric.py | 17 +++++++++++++++--
tools/perf/util/expr.c | 18 ++++++++++++++++++
tools/perf/util/expr.h | 1 +
tools/perf/util/expr.l | 1 +
tools/perf/util/expr.y | 8 +++++++-
tools/perf/util/pmu.c | 17 +++++++++++++++++
tools/perf/util/pmu.h | 1 +
9 files changed, 65 insertions(+), 24 deletions(-)