pmu in use from error to warning#370
Merged
Merged
Conversation
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Contributor
There was a problem hiding this comment.
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))
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of reporting an error an exiting the program, we report a warning to stderr and the log then continue.