You are not logged in.

#1 2012-12-20 09:53:45

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

[SOLVED] [C]: CPU temperature: /sys and /proc files seem nonexistent

Hello

I'm trying to get information about my CPU (namely usage and temperature). Now all results I got on Google were either about using lm_sensors in the command line (which is not what I'm trying) or using files in '/proc/acpi/thermal_zone/' or '/sys/class/thermal/thermal_zone0' or something similar.

But on my machine neither of these directories exist.

The acpi package is installed on my system, and there doesn't seem to be any service that I could start up.

Furthermore, running sensors seems to give me correct temperature results:

[10:49:12] ayekat@ixh:~$ sensors
k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +78.0°C  (high = +70.0°C)
                       (crit = +115.0°C, hyst = +107.5°C)

radeon-pci-0008
Adapter: PCI adapter
temp1:        +79.0°C  

However I have no clue where lm_sensors gets these informations from.

Perhaps it's because AMD CPUs are a bit different, I don't know.

Could anyone give me a hint where I could find information about my CPU temperature (and maybe also CPU usage, but I haven't yet searched on that one).


Thanks in advance!

Last edited by ayekat (2012-12-20 11:20:48)


pkgshackscfgblag

Offline

#2 2012-12-20 10:04:28

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: [SOLVED] [C]: CPU temperature: /sys and /proc files seem nonexistent

I use the files in /sys/bus/platform/devices/coretemp.0/ for the cpu temp, /poc/stat has the info on cpu usage.

HTH smile


You're just jealous because the voices only talk to me.

Offline

#3 2012-12-20 10:41:49

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED] [C]: CPU temperature: /sys and /proc files seem nonexistent

Hi! Thanks for the answer.

'/proc/stat' seems do give me lots of information, I guess it's what I've been looking for. smile

However, on my machine, the only files existent in /sys/bus/platform/devices where:

[11:06:35] ayekat@ixh:~$ ls /sys/bus/platform/devices/
acer-wmi    i8042      pcspkr        serial8250
alarmtimer  microcode  regulatory.0  SP5100 TCO timer

And every directory more or less contained the same files, as seen in this example (serial8250):

[11:35:59] ayekat@ixh:~$ ls -F /sys/bus/platform/devices/serial8250/
driver@  modalias  power/  subsystem@  tty/  uevent

But none of them contained informations about the temperature... (in neither of the directories).
sad


pkgshackscfgblag

Offline

#4 2012-12-20 11:20:27

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED] [C]: CPU temperature: /sys and /proc files seem nonexistent

OK, I found it!

I simply strace'd the sensors command, and it actually gets its information from the files in /sys/class/hwmon/hwmon0/device/.

Happy smile


pkgshackscfgblag

Offline

Board footer

Powered by FluxBB