cpu常用命令

1.平台信息

读节点

adb shell "cat proc/cpuinfo"

读属性

adb shell getprop ro.hardware

2.负载信息

负载信息

adb shell dumpsys cpuinfo

3.原生定频

频率档位

adb shell "cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies"

当前频率

adb shell "cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq"

固定频率

定最高频,设置为性能模式

4,4+4,4+3+1

adb shell "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" # 第0簇

adb shell "echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor" # 第1簇

adb shell "echo performance > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor" # 第2簇

2+6

adb shell "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" # 第0簇

adb shell "echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor" # 第1簇

定最低频,设置为省电模式

4,4+4,4+3+1

adb shell "echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" # 第0簇

adb shell "echo powersave > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor" # 第1簇

adb shell "echo powersave > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor" # 第2簇

2+6

adb shell "echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" # 第0簇

adb shell "echo powersave > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor" # 第1簇

指定频率

4,4+4,4+3+1

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq"

2+6

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq"

adb shell "echo [your freq] > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq"

4.mtk定频1簇

MT6739/MT6761

频率档位

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_oppidx"

当前频率

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_freq"

固定频率

指定频率

X = -1, 0 ~ 15,0 最大,-1无限制

adb shell "echo X > /proc/ppm/policy/ut_fix_freq_idx"

定最高频

adb shell "echo 0 > /proc/ppm/policy/ut_fix_freq_idx"

定最低频

adb shell "echo 15 > /proc/ppm/policy/ut_fix_freq_idx"

5.mtk定频2簇

MT6762/MT6877/MT6833...

频率档位

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_L/cpufreq_oppidx"

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_oppidx"

当前频率

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_L/cpufreq_freq"

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_freq"

固定频率

指定频率

X = -1, 0 ~ 15,0 最大,-1无限制

Y = -1, 0 ~ 15,0 最大,-1无限制

adb shell "echo X Y > /proc/ppm/policy/ut_fix_freq_idx"

定最高频

adb shell "echo 0 0 > /proc/ppm/policy/ut_fix_freq_idx"

定最低频

adb shell "echo 15 15 > /proc/ppm/policy/ut_fix_freq_idx"

5.mtk定频3簇

MT6893...

频率档位

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_B/cpufreq_oppidx" # 大核

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_L/cpufreq_oppidx" # 中核

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_oppidx" # 小核

当前频率

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_B/cpufreq_freq"

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_L/cpufreq_freq"

adb shell "cat /proc/cpufreq/MT_CPU_DVFS_LL/cpufreq_freq"

固定频率

指定频率

X = -1, 0 ~ 15,0 最大,-1无限制

Y = -1, 0 ~ 15,0 最大,-1无限制

Z = -1, 0 ~ 15,0 最大,-1无限制

adb shell "echo X Y Z > /proc/ppm/policy/ut_fix_freq_idx"

定最高频

adb shell "echo 0 0 0 > /proc/ppm/policy/ut_fix_freq_idx"

定最低频

adb shell "echo 15 15 15 > /proc/ppm/policy/ut_fix_freq_idx"


MT6983/MT6895...

频率档位

adb shell "cat /proc/cpuhvfs/C0_opp_idx" # 大核

adb shell "cat /proc/cpuhvfs/C1_opp_idx" # 中核

adb shell "cat /proc/cpuhvfs/C2_opp_idx" # 小核

查看频率和定频用原生的

6.MTK开核

root

adb root

开核,有多少簇,写几个数字

X = -1, 0 ~ 4. Core for cluster 0,-1 无限制

Y = -1, 0 ~ 4. Core fot cluster 1,-1 无限制

Z = -1, 0 ~ 4. Core fot cluster 2,-1 无限制

adb shell "echo X Y Z > /proc/ppm/policy/ut_fix_core_num"

adb shell "echo 4 > /proc/ppm/policy/ut_fix_core_num" # 1簇,4核

adb shell "echo 4 4 > /proc/ppm/policy/ut_fix_core_num" # 2簇,8核

adb shell "echo 2 6 > /proc/ppm/policy/ut_fix_core_num" # 2簇,8核

adb shell "echo 4 3 1 > /proc/ppm/policy/ut_fix_core_num" # 3簇,8核

7.MTK策略

root

adb root

关闭PPM,要开核或定频,需要关闭

adb shell "echo 0 > /proc/ppm/enabled"

打开PPM

adb shell "echo 1 > /proc/ppm/enabled"

验证是否生效,enabled是开,disable是关

adb shell "cat /proc/ppm/enabled"

关闭FPSGO

≥ Android 11(R)

adb shell "echo 0 > /sys/kernel/fpsgo/common/fpsgo_enable"

< Android 11

adb shell "echo 0 > /sys/kernel/debug/fpsgo/common/force_onoff"

关闭触摸提频

adb shell "echo 0 > /proc/perfmgr/tchbst/kernel/tb_enable"

参考:https://confluence.tclking.com/pages/viewpage.action?pageId=183437108

相关推荐
帅得不敢出门7 小时前
安卓设备adb执行AT指令控制电话卡
android·adb·sim卡·at指令·电话卡
我又来搬代码了9 小时前
【Android】使用productFlavors构建多个变体
android
德育处主任10 小时前
Mac和安卓手机互传文件(ADB)
android·macos
芦半山10 小时前
Android“引用们”的底层原理
android·java
迃-幵11 小时前
力扣:225 用队列实现栈
android·javascript·leetcode
大风起兮云飞扬丶11 小时前
Android——从相机/相册获取图片
android
Rverdoser11 小时前
Android Studio 多工程公用module引用
android·ide·android studio
aaajj12 小时前
[Android]从FLAG_SECURE禁止截屏看surface
android
@OuYang12 小时前
android10 蓝牙(二)配对源码解析
android
Liknana12 小时前
Android 网易游戏面经
android·面试