锁定Android上的CPU进行应用性能测试性能测试、Android、CPU

2023-09-06 08:00:08 作者:你折梅下酒

我想在不同CPU状态来测试应用程序的Andr​​oid上的表现。所以,我会想锁定在1000MHz的说CPU和采取的读数,然后超载CPU,并采取读数。我的问题是:反正是有锁定在特定的锁定/冻结利率的CPU以及可能的RAM?任何一个环节的单证,这将是非常美联社preciated。

I'm trying to test an app's performance on android at different CPU states. So i will like to lock the CPU at say 1000Mhz and take readings and then overload the CPU and take readings. My question is: Is there anyway to lock the CPU and possibly the RAM at certain lock/freeze rates?? Any link to documentations on this will be highly appreciated.

推荐答案

按照以下步骤(以root权限的所有步骤):结果1. 停止mpdecision 结果2.在 / SYS /设备/系统/ CPU 你可以看到多少个核心在你的设备上,如果双核心,你会看到 CPU0 CPU1 两个文件夹。结果3.写 0 1 关闭或开核

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 close or open core

echo "0" > /sys/devices/system/cpu/cpu1/online # close core
echo "1" > /sys/devices/system/cpu/cpu1/online # open core

4。改变CPU的总督

4. change governor of CPU

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

5。设定频率

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

记得检查 / SYS /设备/系统/ CPU / CPU0 / CPU频率/ scaling_cur_freq 来看看你能在设置什么频率步骤5中。

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

有关的步骤4和5,您可以通过此设定频率应用(需要root权限)。

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

有关详细信息,你可以看到这个。

For more details, you can see this.