Skip to content

Introduce Loader interface to support alternative event and metric initialization methods #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 80 commits into
base: main
Choose a base branch
from

Conversation

harp-intel
Copy link
Contributor

@harp-intel harp-intel commented Jul 23, 2025

The legacy (original) approach to loading events and metrics has been refactored under the new Loader interface and is found in loader_legacy.go.

A new approach that creates perf event groups dynamically at runtime from perfmon (https://github.com/intel/perfmon) event and metric definitions is in loader_perfmon*.go. This approach eliminates the need to manually create perf event groups found in the legacy approach.

The intent is for additional methods of loading events/metrics, e.g., for other architectures, to use the new Loader interface so as to avoid co-mingling the approaches in nested if/else code.

Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
…eplacements and removing unnecessary prefix handling

Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
…ndling for consistency

Signed-off-by: Harper, Jason M <[email protected]>
… improving configuration handling

Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
…g in new perfmon_util.go

Signed-off-by: Harper, Jason M <[email protected]>
…rom the metrics resource directory. This file contained various CPU performance metrics that are no longer needed or relevant.

Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
@harp-intel harp-intel requested a review from Copilot August 6, 2025 17:08
Copilot

This comment was marked as outdated.

@harp-intel harp-intel requested a review from Copilot August 6, 2025 17:40
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 introduces a Loader interface to support alternative event and metric initialization methods, transitioning from a monolithic legacy approach to a modular architecture that can accommodate different event/metric loading strategies.

  • Refactors legacy event/metric loading approach under new Loader interface
  • Introduces perfmon-based loader that dynamically creates perf event groups from Intel perfmon definitions
  • Adds comprehensive perfmon configuration files for Intel CPU architectures (Sierra Forest, Sapphire Rapids, Ice Lake)

Reviewed Changes

Copilot reviewed 40 out of 68 changed files in this pull request and generated 42 comments.

File Description
cmd/metrics/resources/perfmon/srf/srf.json Adds perfmon configuration for Intel Xeon 6 processors with E-cores (Sierra Forest)
cmd/metrics/resources/perfmon/spr/spr.json Adds perfmon configuration for Intel 4th Generation Xeon processors (Sapphire Rapids)
cmd/metrics/resources/perfmon/icx/icx.json Adds perfmon configuration for Intel 3rd Generation Xeon processors (Ice Lake)

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