Skip to content

Conversation

harp-intel
Copy link
Contributor

@harp-intel harp-intel commented Oct 13, 2025

This pull request addresses improvements and bug fixes related to handling fixed reference cycles counters in perfmon metrics, particularly for Intel CPUs. The main changes ensure correct event name translation, add support for a missing event alias, and prevent invalid event groupings on platforms that do not support fixed reference cycles.

Event Name Handling and Translation:

  • Improved the logic in getExpression to only replace event names found within square brackets and present in the fixedCounterEventNameTranslation map, preventing accidental substring replacements and ensuring accurate metric formula translation.
  • Added a missing mapping for "CPU_CLK_UNHALTED.REF_TSC:SUP" to "ref-cycles:k" in the fixedCounterEventNameTranslation map, enabling proper translation for this event.

Validation and Error Handling:

  • Added a check in getExpression to return an error if a metric does not have a formula defined, improving robustness.
  • Updated the logic in CoreGroup.AddEvent to prevent grouping both "CPU_CLK_UNHALTED.REF_TSC" and "CPU_CLK_UNHALTED.REF_TSC_P:SUP" events when fixed reference cycles are not supported, avoiding invalid event combinations on certain platforms.

Resource File Correction:

  • Corrected the event name in icx_perfspect_metrics.json from "CPU_CLK_UNHALTED.REF_TSC_P:SUP" to "CPU_CLK_UNHALTED.REF_TSC:SUP" to match the new mapping and ensure consistency.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot October 13, 2025 22:20
Copy link
Contributor

@Copilot 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 adds compatibility safeguards for CPU performance monitoring on platforms with limited hardware support. It prevents invalid event groupings that can cause issues on specific EC2 instances and kernel versions.

  • Adds validation to prevent grouping multiple CPU_CLK_UNHALTED.REF_TSC events when the fixed reference cycles counter is unsupported
  • Includes detailed comments explaining the platform-specific limitation discovered on AWS m7i.8xlarge with Amazon Linux 2023 and kernel 6.1

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
…names with corresponding perf event names

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot October 14, 2025 04:26
Copy link
Contributor

@Copilot 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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot October 14, 2025 13:45
Copy link
Contributor

@Copilot 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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@harp-intel harp-intel merged commit ceeb9a9 into main Oct 14, 2025
5 checks passed
@harp-intel harp-intel deleted the kernelal2023 branch October 14, 2025 22:54
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.

1 participant