Skip to content
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

topdown: Created a component for interfacing with Intel's PERF_METRICS MSR #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

willowec
Copy link
Contributor

@willowec willowec commented Nov 17, 2024

Pull Request Description

This PR adds a component that reads the PERF_METRICS Model Specific Register (MSR) and extracts topdown micro-architecture analysis metrics from it, converting those metrics to percentages automatically for ease of use. For example:

$ ./utils/papi_command_line TOPDOWN_RETIRING_PERC TOPDOWN_BAD_SPEC_PERC \ 
    TOPDOWN_FE_BOUND_PERC TOPDOWN_BE_BOUND_PERC

Successfully added: TOPDOWN_RETIRING_PERC
Successfully added: TOPDOWN_BAD_SPEC_PERC
Successfully added: TOPDOWN_FE_BOUND_PERC
Successfully added: TOPDOWN_BE_BOUND_PERC

TOPDOWN_RETIRING_PERC : 	20.784 %
TOPDOWN_BAD_SPEC_PERC : 	0.000 %
TOPDOWN_FE_BOUND_PERC : 	1.961 %
TOPDOWN_BE_BOUND_PERC : 	76.863 %

----------------------------------

Tested systems:

System Name Family/Model/Stepping papi_native_avail papi_component_avail papi_command_line Topdown tests
Raptor Lake-S/HX B0 0x6/0xb7/0x1

While this PR only adds support for RaptorLake, all IA32 systems that support the PERF_METRICS Model Specific Register should be able to be added without much hassle.

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

…S MSR

Add a component that collects Intel's topdown metrics from the
PERF_METRICS MSR and automatically converts the raw metric values to
user-consumable percentages.

The intent of this component is to provide an intuitive interface for
accessing topdown metrics on the supported processors.

Tested on a RaptorLake-S/HX machine (family/model/stepping
0x6/0xb7/0x1). To add other supported architectures the switch statment
in _topdown_init_component() should be populated for the architecture's
model number, whether it supports level 2 topdown metrics, and in the
case of a heterogeneous processor what core type it must be run on.
@willowec
Copy link
Contributor Author

If desired, I can add entries for all of the models I am aware of that support the PERF_METRICS MSR, but I am only able to test on RaptorLake.

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