-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
src/linux-memory.c
Outdated
@@ -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")) { |
There was a problem hiding this 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" and "Instruction", etc. are.
src/linux-memory.c
Outdated
type=PAPI_MH_TYPE_DATA; | ||
} | ||
if (!strcmp(type_string,"Instruction")) { | ||
if (!strcmp(type_string,"Instruction") || !strcmp(type_string,"Instruction\n")) { |
There was a problem hiding this comment.
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.
src/linux-memory.c
Outdated
type=PAPI_MH_TYPE_INST; | ||
} | ||
if (!strcmp(type_string,"Unified")) { | ||
if (!strcmp(type_string,"Unified") || !strcmp(type_string,"Unified\n")) { |
There was a problem hiding this comment.
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.
7606e94
to
a6d275b
Compare
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.
a6d275b
to
047590b
Compare
Pull Request Description
Support for ARM Neoverse V2 and bug fixes.
These changes have been tested on the ARM Neoverse V2 architecture.
Author Checklist
Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
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
The PR needs to pass all the tests