返回社区案例

用一行命令快速查看高通平台CPU各核心温度

发布时间:2026/6/16浏览量:474

【最近实战】

我有一台运行Linux的设备,想快速查看一下CPU的温度情况。我直接对AI助手说:“帮我看一下CPU的温度”。

它首先尝试用sensors命令获取温度,但设备上没有安装lm-sensors,于是fallback到读取/sys/class/thermal/thermal_zone*/temp,拿到了5个原始温度值:53900、43500、42200、42200、44100。这些数值单位是毫摄氏度,但当时只显示了前5个thermal zone,还不清楚哪个对应CPU。

接着它又执行了一条命令,读取所有thermal zone的type文件,列出了一份完整的传感器清单:m4m-thermal、mem-thermal、modemtx-thermal、gpu-top-thermal、gpu-bottom-thermal、qcom-battery、l3-or-venus-thermal、cpu0-thermal、cpu1-thermal、cluster0-l2-thermal、cpu2-thermal、cpu3-thermal、cluster1-l2-thermal、camera-thermal、q6-dsp-thermal。从命名可以清楚看出,这是一台高通骁龙平台的设备(实际上是一台小米5手机),CPU相关传感器有cpu0、cpu1、cpu2、cpu3以及两个cluster的L2缓存温度。

为了更直观地展示所有温度,它用了一个shell循环,遍历thermal_zone0到thermal_zone14,读取每个zone的type和temp,并将毫摄氏度转换为摄氏度输出。最终结果如下:

  • m4m-thermal: 54°C
  • l3-or-venus-thermal: 50°C
  • cpu0-thermal: 55°C
  • cpu1-thermal: 55°C
  • cluster0-l2-thermal: 55°C
  • cpu2-thermal: 61°C
  • cpu3-thermal: 62°C
  • cluster1-l2-thermal: 58°C
  • camera-thermal: 49°C
  • q6-dsp-thermal: 50°C
  • mem-thermal: 43°C
  • modemtx-thermal: 42°C
  • gpu-top-thermal: 42°C
  • gpu-bottom-thermal: 44°C
  • qcom-battery: 31°C

从结果可以看出,CPU分为两个集群:小核集群(cpu0/cpu1)温度约55°C,大核集群(cpu2/cpu3)温度约61-62°C,对应的L2缓存温度分别为55°C和58°C。整体温度处于正常范围,设备处于轻度负载状态。其他组件如GPU约42-44°C、内存43°C、基带42°C、电池仅31°C,也都正常。

整个过程中,所有命令都是通过Wisdom SSH在远程设备上执行的。Wisdom SSH的AI辅助功能让我不需要手动敲任何命令,只需用自然语言描述需求,它就能自动选择合适的工具、处理命令失败的情况(sensors不可用时自动fallback到sysfs)、并以人类可读的格式整理输出结果。对于不熟悉Linux thermal子系统或者懒得记sysfs路径的用户来说,这种交互方式非常高效。

本文由用户分享,展示了Wisdom SSH在AI运维中的实际应用

推荐社区案例

点击阅读真实AI运维案例