-
Notifications
You must be signed in to change notification settings - Fork 229
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
Fix lots of bugs and cleanup code in sysFeatures #637
Merged
Merged
Conversation
This file contains 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
field{32,64}set update a value within a bitfield. The extractBitField function is deprecated as it is already covered by field{32/64}.
Also update uint64-string conversion functions to realloc the result buffer passed via argument. This way one can simply call the function repeatedly using the same buffer without having to manually free the buffer.
Also cleanup the respective getter and setter functions to use bitfield functions instead of manually shifting around.
Apparently just the wrong bit was tested previously?
Not sure how this was ever supposed to function correctly. Certainly always showing an error in the debug log in case of the supposed success does not make any sense.
This commit also distributes header and body code file to be more in line with the Intel RAPL code. AMD RAPL code is not yet checked for semantic bugs.
There is still a lot of redundant code for both Intel and AMD. This should be merged later.
The strings were incorrectly copied when their length exceeded HWFEATURES_MAX_STR_LENGTH. To solve this we just use strndup, as it is te perfect fit for correctly copying strings at a maximum size. In addition adding a feature to an internal feature list used to ignore the 'tester' and 'unit' field. This would cause corruption later on.
The bounds checking for valid core IDs was wrong, hence why device creation sometimes failed or succeeded erroneously.
Lots of code tends to iterate over sockets and its available threads. This commit rewrites the code such that is only done in one place and if necessary a callback function is used to test for a custom MSR condition.
ipatix
force-pushed
the
sysfeature-fixes
branch
from
October 14, 2024 12:37
54fcf5e
to
646dd43
Compare
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.
This PR fixes many small bugs in the sysFeatures module, some of which prevented certain features from working entirely.
In addition, a lot of duplicate code is removed and cleaned up.