Which file system to use for displaying temperature sensor readings / limits

I am currently experiencing problems with overheating equipment. Looking through the Linux kernel, I found that thermal sensors are currently fully supported, but the pre-configured limits seem too high. Currently I want to change the kernel module, but I'm not sure what would be the best way to change it. I would like to:

  • Is there a file somewhere where I can read the current temperature
  • There are several files that I can use from user space to change the current restrictions.

Now I'm not sure which virtual file interface I should use for this. So far I see the following options:

  • Export all data through the file system /dev/, use ioctl()to change limits
  • Add files to sysfs
  • Add files to debugfs

I'm not sure what the pros and cons of each of these methods will be. So far I have looked at sysfs, and it seems that this is not the right way. The number of sensors depends on the hardware, and I will need to add different hacks to get one file per sensor (or one directory per sensor), possibly adding another kobject for each sensor so that I can add files to the resulting directory. Previously, the sensor data seemed to be available through /sys/class/hwmon/hwmon0/device/temp1_input, however it was deleted there.

debugfs also doesn't seem to be the right way, since I'm not very interested in debugging the kernel, but rather provides a more convenient way to configure and read sensors.

devfs, , , .

?

+1
1

Documentation/hwmon/sysfs-interface, temp[1-*]_max temp[1-*]_crit -, , , , .

+2

Source: https://habr.com/ru/post/1618885/


All Articles