dmesg查cpu过热降频需聚焦thermal、throttle、cpufreq、mce、acpi等关键词,实时监听用dmesg -w | grep -i“thermal|throttle|cpufreq”,结合sensors和/sys/devices/system/cpu/验证温度与频率变化。

直接用 dmesg 查 CPU 过热降频,关键不是“有没有日志”,而是“怎么抓到那几行真正有用的信号”——内核通常不会写“CPU 温度过高,已降频”,而是通过温度告警、thermal throttling、频率切换、ACPI 事件等间接线索体现。
CPU 过热降频的典型内核日志特征
先认准几个高频关键词和子系统标识:
-
thermal:如
thermal thermal_zone0: critical temperature reached或thermal_zone1: trip point 0 threshold reached -
acpi_thermal_rel 或
acpi-thermal:ACPI 温控策略触发日志 -
cpufreq:如
cpufreq: transition from 3600 MHz to 1200 MHz、cpufreq: policy: frequency limits changed -
intel_powerclamp 或
processor_idle:Intel 平台常见节流机制,出现powerclamp: activated或idle state C10可能关联深度降频 -
hardware error / mce:机器检查异常(MCE)中若含
temperature、thermal trip,说明已触发硬件级保护
精准捕获实时过热事件
降频是瞬态行为,翻历史日志容易漏掉关键帧。推荐实时监听:
- 运行:
dmesg -w | grep -i "thermal\|throttle\|cpufreq\|mce\|acpi.*temp" - 插拔散热器、满载 stress-ng 后立即观察输出;若看到连续多行
thermal_zone警告 + 紧接着cpufreq频率跳变,基本可确认过热干预 - 加
-T显示本地时间:dmesg -w -T | grep -i "thermal\|throttle",方便与监控工具(如 sensors)时间对齐
回溯排查已发生的降频
如果问题已过去,优先过滤高优先级日志:
- 只看错误与警告:
dmesg -l err,warn | grep -i "thermal\|throttle\|cpufreq" - 结合时间范围(如最近 5 分钟):
dmesg -T | awk -F' ' '$1" "$2" "$3 > "Jul 29 13:40:00" {print}' | grep -i thermal(需按实际日期调整) - 查完整 thermal 相关上下文:
dmesg | sed -n '/thermal/,/^$/p'(提取包含 thermal 的段落,避开干扰)
辅助验证是否真由温度引起
dmesg 日志只是线索,需交叉验证:
- 运行
sensors(需安装 lm-sensors),看核心温度是否接近 Tjmax(如 Intel 常为 100°C) - 查当前频率:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq,对比标称最大频率 - 看节流状态:
cat /sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count(非所有平台支持) - 注意:某些厂商固件(如部分笔记本 BIOS)可能静默降频而不记 dmesg,此时需依赖
turbostat或intel-rdt工具观测实际频率波动











