-
Notifications
You must be signed in to change notification settings - Fork 365
Add type and name to the DRM parser class #672
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
Merged
+28
−12
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4725d85
feat: add `devName` and `devType` to DRM GPU stats
Deezzir 301c97a
fix: don't export empty drm card stats
Deezzir 3242a36
chore: fail the parsing if name & type invalid
Deezzir 2371909
Merge branch 'master' into drm-hwmon-name
Deezzir 3f337ab
Merge branch 'master' into drm-hwmon-name
SuperQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Why?
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.
Please see #673
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.
Still don't get it. The function always returns ClassDRMCardAMDGPUStats{}
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.
The line checks if the struct is empty (zero-initialized) and only appends to the
statslist if it is not empty. I've also modified the test file for the module. Previously, the test would produce two struct instances: one valid and one with all elements zero-initialized. It doesn't make much sense to let the empty object be passed as a valid one.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.
I guess this comes from the logic in
parseClassDRMAMDGPUCard().The no match returns an empty card, but no error. Seems suspect.
But this workaround is probably fine for now. We would need to look over the history of the parser to find out why it's like that.
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.
Looking at the current test fixtures, we have two drm GPUs. One amdgpu and one i915.
It seems like this parser would return an empty card in the case of a non-amd GPU. That seems weird to me. I think this is probably better to return nothing for non-matching cards.