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

2024.02.15 Updates to papi_mem_info #161

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dbarry9
Copy link
Contributor

@dbarry9 dbarry9 commented Feb 16, 2024

Pull Request Description

Support for ARM Neoverse V2 and bug fixes.

These changes have been tested on the ARM Neoverse V2 architecture.

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

Copy link
Contributor

@jagode jagode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using multiple strcmp() calls for each IF, I would suggest using one strncmp() instead. You know how long "data", "Instruction", "Unified", etc. are.

@@ -1253,13 +1253,13 @@ generic_get_memory_info( PAPI_hw_info_t *hw_info )
MEMDBG("Could not read cache type\n");
goto unrecoverable_error;
}
if (!strcmp(type_string,"Data")) {
if (!strcmp(type_string,"Data") || !strcmp(type_string,"Data\n")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using multiple strcmp() calls for each IF, I would suggest using one strncmp() instead. You know how long "data" and "Instruction", etc. are.

type=PAPI_MH_TYPE_DATA;
}
if (!strcmp(type_string,"Instruction")) {
if (!strcmp(type_string,"Instruction") || !strcmp(type_string,"Instruction\n")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

Instead of using multiple strcmp() calls for each IF, I would suggest using one strncmp() instead. You know how long "data" and "Instruction", etc. are.

type=PAPI_MH_TYPE_INST;
}
if (!strcmp(type_string,"Unified")) {
if (!strcmp(type_string,"Unified") || !strcmp(type_string,"Unified\n")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

Instead of using multiple strcmp() calls for each IF, I would suggest using one strncmp() instead. You know how long "data", "Instruction", "Unified", etc. are.

This helps with readability.

These changes have been tested on the ARM Neoverse V2 architecture.
@dbarry9
Copy link
Contributor Author

dbarry9 commented Jun 28, 2024

Instead of using multiple strcmp() calls for each IF, I would suggest using one strncmp() instead. You know how long "data", "Instruction", "Unified", etc. are.

I have updated the PR to reflect your suggestions, and the changes have been tested successfully.

Some systems have a newline character at the end of the cache type file.
The newline character needs to be taken into account for proper string comparisons.

These changes have been tested on the ARM Neoverse V2 architecture.
Add TLB information for ARM Neoverse V2, per the Reference Manual:
https://developer.arm.com/documentation/102375/0002?lang=en

These changes have been tested on the ARM Neoverse V2 architecture.
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.

None yet

2 participants