-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
Linux/LibSensors: adjust data for k10temp #1249
base: main
Are you sure you want to change the base?
Conversation
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'm all for dropping the first (align macro definition) commit.
Re the |
Might get superseded by #1352. |
More than one digit of temperature precision is never printed and barely useful.
Store the driver used for temperature gathering for later adjustments.
Can be used for temperature sensor data assignments.
Adjust the temperature data gathered from the k10temp driver. Only a control value, an optional die value, and one value per CCD are provided. See https://www.kernel.org/doc/html/latest/hwmon/k10temp.html for details.
} | ||
|
||
DIR* dir = opendir("/sys/devices/system/cpu"); | ||
if (!dir) | ||
return; | ||
|
||
unsigned int currExisting = super->existingCPUs; | ||
unsigned short maxCoreId = 0; |
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 do we bother with the unsigned short
data type here (rather than unsigned int
)? There is no space constraint here (it's not an array) and short
data types typically process slower in most CPU architectures.
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.
To save two bytes in the CPUData
struct.
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.
@cgzones Not worth it when your other code becomes larger due to the instructions processing 16-bit registers. (At least in IA-32 & x86-64, instructions processing 16-bit registers need a prefix and each becomes one byte larger than 32-bit counterparts.)
Adjust the temperature data gathered from the k10temp driver.
Only a control value, an optional die value, and one value per CCD are provided.
See https://www.kernel.org/doc/html/latest/hwmon/k10temp.html for details.