feat: add k10temp cpu temperature support to fetch service #187
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.
Currently
FetchService.cpu_temp()
only works for CPUs that use thex86_pkg_temp_thermal
driver, which is used by various Intel CPUs.This adds support for CPUs that rely on the
k10temp
driver, namely, various AMD CPUS.I also factored the code for checking both kinds into their own private functions that get called by
cpu_temp()
so the distinction is clearer and for ease of maintenance if support for other temperature drivers is added.The practical difference as far as I am aware is pretty much just that they expose temperature information in files in different system directories, which have different structures.
I do not own any machines that use the
x86_pkg_temp_thermal
driver, so I cannot verify that I did not accidentally break that code, but as far as I can tell, I have not changed that part of the code other than to extract it into its own function.