From 38b2a0a1530ab8185a6fcdb410c0cdd1d367cbfe Mon Sep 17 00:00:00 2001 From: "Harper, Jason M" Date: Thu, 5 Jun 2025 09:39:39 -0700 Subject: [PATCH] fix determination of availability of fixed counters Signed-off-by: Harper, Jason M --- cmd/metrics/metadata.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/metrics/metadata.go b/cmd/metrics/metadata.go index a749af93..e29a99c2 100644 --- a/cmd/metrics/metadata.go +++ b/cmd/metrics/metadata.go @@ -308,13 +308,13 @@ func getMetadataScripts(noRoot bool, perfPath string, uarch string, noSystemSumm for _, scriptDef := range metadataScriptDefs { if scriptDef.Name == "perf stat fixed instructions" { var eventList []string - for range numGPCounters { + for range numGPCounters + 1 { eventList = append(eventList, "instructions") } scriptDef.ScriptTemplate = strings.Replace(scriptDef.ScriptTemplate, "{{.InstructionsList}}", strings.Join(eventList, ","), -1) } else if scriptDef.Name == "perf stat fixed cpu-cycles" { var eventList []string - for range numGPCounters { + for range numGPCounters + 1 { eventList = append(eventList, "cpu-cycles") } scriptDef.ScriptTemplate = strings.Replace(scriptDef.ScriptTemplate, "{{.CpuCyclesList}}", strings.Join(eventList, ","), -1)