Skip to content

fix determination of availability of fixed counters#367

Merged
harp-intel merged 1 commit into
mainfrom
fixedcounters
Jun 5, 2025
Merged

fix determination of availability of fixed counters#367
harp-intel merged 1 commit into
mainfrom
fixedcounters

Conversation

@harp-intel
Copy link
Copy Markdown
Contributor

need to overflow the GP counters to determine if the fixed counter is supported

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adjusts the loop bounds when generating the fixed counter event lists so that the general-purpose counters are overflowed one extra time to confirm support for fixed counters.

  • Increase iterations by one for both instructions and cpu-cycles event lists.
  • Update script templates to use the extended event lists.
Comments suppressed due to low confidence (2)

cmd/metrics/metadata.go:311

  • The expression for range numGPCounters + 1 is invalid in Go because range requires a slice, array, string, map, or channel. Replace it with a standard integer loop, e.g. for i := 0; i < numGPCounters+1; i++.
for range numGPCounters + 1 {

cmd/metrics/metadata.go:317

  • Similarly, for range numGPCounters + 1 will not compile. Use an index-based loop (for i := 0; i < numGPCounters+1; i++) or construct a slice of the correct length before ranging.
for range numGPCounters + 1 {

@harp-intel harp-intel merged commit 7ba9d32 into main Jun 5, 2025
4 checks passed
@harp-intel harp-intel deleted the fixedcounters branch June 5, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checking for fixed counter should probably use numGPCounters+1 events instead of just numGPCounters

2 participants