Locking the CPU on android for app performance testing

笑着哭i 提交于 2019-12-03 09:05:52

Follow these steps(all steps with root privilege):
1. stop mpdecision
2. In /sys/devices/system/cpu you can see how many cores in your device, if dual core, you will see cpu0 and cpu1 two folders.
3. write 0 or 1 to disable or enable core

echo "0" > /sys/devices/system/cpu/cpu1/online # disable core
echo "1" > /sys/devices/system/cpu/cpu1/online # enable core

4. change governor of CPU

echo "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

5. set frequency

echo "1000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

remember to check /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq to see what frequency you can set in step 5.

For step 4 and 5, you can set frequency through this app(need root privilege).

For more details, you can see this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!