amd_smi: Update CHECK_SNPRINTF to allow for truncation of descriptions#577
Open
Treece-Burgess wants to merge 1 commit intoicl-utk-edu:masterfrom
Open
amd_smi: Update CHECK_SNPRINTF to allow for truncation of descriptions#577Treece-Burgess wants to merge 1 commit intoicl-utk-edu:masterfrom
Treece-Burgess wants to merge 1 commit intoicl-utk-edu:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Currently on Instinct at Oregon (1 * MI100), the
amd_smicomponent will be disabled. This is caused by thedriver_version_hashdescription being larger thandescr[PAPI_MAX_STR_LEN]. On Instinct thedriver_version_hashis:One way to resolve this issue is by changing
descr[PAPI_MAX_STR_LEN]todescr[PAPI_HUGE_STR_LEN]. As thelong_descrcan take up toPAPI_HUGE_STR_LEN. This has been done in the PR. However, this does not account for cases where the vendor descriptions could be larger thanPAPI_HUGE_STR_LEN.To account for this possibility
CHECK_SNPRINTFhas been updated to take atruncationargument. This argument can be either:doNotAllowTruncation- Meaning if we cannot fully write the string to the buffer, we returnPAPI_EBUF.allowTruncation- Meaning if we cannot fully write the string to the buffer, we do not returnPAPI_EBUFand proceed on.error_stringvariable fall under this option.In both cases a
SUBDBGmessage will output.Testing
Testing was done on Instinct at Oregon with 1 * MI100 and ROCm 7.2.0, the results are:
* -
papi_component_avail,papi_native_avail,papi_command_line** -
amdsmi_energy_monotonicfails, but this does not appear to be due to this PR and I lack the permissions to runamdsmi_set_test.cAuthor 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 descriptionCommits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
The PR needs to pass all the tests