Skip to content

Conversation

@harp-intel
Copy link
Contributor

This pull request updates the logic in the prepareTarget function in cmd/metrics/metrics.go to ensure that certain configuration steps are only performed when root access is available. The changes improve the robustness of target configuration by properly gating PMU-related checks and actions behind the flagNoRoot condition.

Target configuration logic improvements:

  • Wrapped the PMU usage check and related script execution in a conditional block that only runs if root access is available (!flagNoRoot), preventing unnecessary or failing operations on targets without root access.
  • Ensured that the conditional block for disabling the NMI watchdog is properly separated from the PMU check, maintaining clear and correct flow for root-dependent actions.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel changed the title don't check for PMUs in use if noroot flag given fix: don't check for PMUs in use if noroot flag given Nov 5, 2025
@harp-intel harp-intel merged commit 5103271 into main Nov 5, 2025
5 checks passed
@harp-intel harp-intel deleted the pmusinusenoroot branch November 5, 2025 23:28
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.

2 participants