Andriod查看CPU信息()

  • 查看CPU是几核
cat /proc/cpuinfo | grep ^processor | wc -l
  • 查看CPU有几个核在运行
cat /sys/devices/system/cpu/online    
  • 查看系统支持多少个核:
cat /sys/devices/system/cpu/present 
  • 开启某个CPU核
cho 1 > /sys/devices/system/cpu/cpu#/online
注: #为数字,标识哪个CPU核,如八核CPU, 则#取值为0~7
  • 查看CPU核的运行频率
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 
  • 查看CPU核动态调频的Governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  • 查看当前CPU核的温度
cat /sys/class/thermal/thermal_zone9/temp
42或者42000,代表约42度等
注: SoC系统往往有多个thermal sensor, 需要分辨监测CPU核温度的是哪些sensor,Qualcomm平台可参考/system/etc/thermal-engine.conf文件.
  • 查看CPU类型
cat /sys/class/thermal/thermal_zone7/type
  • mtktscpu注: MTK的CPU名称类似为mtktscpu,Qualcomm的CPU名称类似为tsens_tz_sensor
————————
  • 查看CPU是几核
cat /proc/cpuinfo | grep ^processor | wc -l
  • 查看CPU有几个核在运行
cat /sys/devices/system/cpu/online    
  • 查看系统支持多少个核:
cat /sys/devices/system/cpu/present 
  • 开启某个CPU核
cho 1 > /sys/devices/system/cpu/cpu#/online
注: #为数字,标识哪个CPU核,如八核CPU, 则#取值为0~7
  • 查看CPU核的运行频率
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 
  • 查看CPU核动态调频的Governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  • 查看当前CPU核的温度
cat /sys/class/thermal/thermal_zone9/temp
42或者42000,代表约42度等
注: SoC系统往往有多个thermal sensor, 需要分辨监测CPU核温度的是哪些sensor,Qualcomm平台可参考/system/etc/thermal-engine.conf文件.
  • 查看CPU类型
cat /sys/class/thermal/thermal_zone7/type
  • mtktscpu注: MTK的CPU名称类似为mtktscpu,Qualcomm的CPU名称类似为tsens_tz_sensor