`/sys/class/thermal/` 中内核数量和热区之间的差异

Mar*_*tus 7 ubuntu temperature

我有一个带有 8 个内核的 Ubuntu 14.04 系统:

$ cat /proc/cpuinfo | grep ^processor | wc -l
8
Run Code Online (Sandbox Code Playgroud)

然而,我看到了 11 个热区/sys/classes/thermal

ls /sys/class/thermal/thermal_zone* | wc -l
11
Run Code Online (Sandbox Code Playgroud)

热区被命名thermal_zone0thermal_zone10

为什么会出现这种差异,有没有办法获得单个温度指标(例如最热核心的温度)?我需要一个指标,因为我想在i3wm状态栏上显示它。显示 11 个温度会很麻烦,而且我不确定这些与 8 个内核的对应关系。

更新

十一 (11) 个热区的类型报告如下:

$ cat /sys/class/thermal/thermal_zone0/type 
acpitz
$ cat /sys/class/thermal/thermal_zone1/type 
acpitz
$ cat /sys/class/thermal/thermal_zone2/type 
INT3400 Thermal
$ cat /sys/class/thermal/thermal_zone3/type 
TMEM
$ cat /sys/class/thermal/thermal_zone4/type 
TAMB
$ cat /sys/class/thermal/thermal_zone5/type 
TAM2
$ cat /sys/class/thermal/thermal_zone5/type 
TAM2
$ cat /sys/class/thermal/thermal_zone6/type 
TNGF
$ cat /sys/class/thermal/thermal_zone7/type 
TEFN
$ cat /sys/class/thermal/thermal_zone8/type 
TSKN
$ cat /sys/class/thermal/thermal_zone9/type 
T_VR
$ cat /sys/class/thermal/thermal_zone10/type 
x86_pkg_temp
Run Code Online (Sandbox Code Playgroud)

这令人困惑而不是阐明,因为我现在无法分辨哪些热区对应于 8 个 CPU 内核。

小智 8

我可以确认Gilles 的评论:CPU 温度(最热的核心)由 x86_pkg_temp 给出。

因此,如果

$ cat /sys/class/thermal/thermal_zone10/type 
x86_pkg_temp
Run Code Online (Sandbox Code Playgroud)

然后/sys/class/thermal/thermal_zone10/temp是应该在 i3 状态栏中使用的文件。

附带说明一下,每个内核的温度都可以temp*_input/sys/devices/platform/coretemp.0/hwmon/hwmon*/. 关联temp*_label显示哪个文件与哪个内核相关(在我的例子中是 4 个内核):

.../hwmon*/$  grep "" temp*_label
temp1_label:Physical id 0
temp2_label:Core 0
temp3_label:Core 1
temp4_label:Core 2
temp5_label:Core 3
Run Code Online (Sandbox Code Playgroud)

该文件temp1_input对应于内核的最热值。