Skip to content

pmu in use from error to warning#370

Merged
harp-intel merged 2 commits into
mainfrom
pmugp
Jun 6, 2025
Merged

pmu in use from error to warning#370
harp-intel merged 2 commits into
mainfrom
pmugp

Conversation

@harp-intel
Copy link
Copy Markdown
Contributor

Instead of reporting an error an exiting the program, we report a warning to stderr and the log then continue.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel linked an issue Jun 6, 2025 that may be closed by this pull request
@harp-intel harp-intel requested a review from Copilot June 6, 2025 18:55
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 changes the PMU-in-use condition from an immediate error exit to logging a warning and continuing execution.

  • Replace fatal PMU busy error and exit with a warning log and status update
  • Preserve process flow instead of sending to channelError
  • Updated comments to reflect new behavior
Comments suppressed due to low confidence (3)

cmd/metrics/metrics.go:1045

  • [nitpick] Rephrase the comment as an imperative statement to match code style, e.g., // Check if PMUs are in use on the target.
// are PMUs being used on target?

cmd/metrics/metrics.go:1057

  • Extract the magic register ID "0x30a" into a named constant (e.g., const cpuCyclesRegister = "0x30a") for clarity and easier future updates.
if strings.Contains(line, "Active") && !strings.Contains(line, "0x30a") {

cmd/metrics/metrics.go:1058

  • Add a unit or integration test to cover the new PMU-in-use warning path, ensuring the code logs a warning rather than exiting.
slog.Warn("PMU is in use on target", slog.String("target", myTarget.GetName()), slog.String("line", line))

Comment thread cmd/metrics/metrics.go Outdated
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel merged commit c2e5096 into main Jun 6, 2025
4 checks passed
@harp-intel harp-intel deleted the pmugp branch June 6, 2025 20:52
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.

metrics collection failure with PMU active

2 participants