Skip to content
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

feat: add k10temp cpu temperature support to fetch service #187

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

Anomalocaridid
Copy link
Contributor

Currently FetchService.cpu_temp() only works for CPUs that use the x86_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.

Copy link
Owner

@linkfrg linkfrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I tested it on my Intel (x86_pkg_temp_thermal) machine and it works as usual.

@linkfrg linkfrg merged commit e3964fd into linkfrg:main Mar 9, 2025
3 checks passed
@Anomalocaridid Anomalocaridid deleted the k10temp-support branch March 9, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants