博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android系统 固定住CPU频率
阅读量:4147 次
发布时间:2019-05-25

本文共 6064 字,大约阅读时间需要 20 分钟。

1. 切换 CPU 策略为 userspcace

adb shell “echo userspace > /sys/devices/system/cpu/cpu【Index】/cpufreq/scaling_governor”

这里起到固定频率的作用

userspace 最早的 cpufreq 子系统通过 userspace governor 为用户提供了这种灵活性。系统将变频策略的决策权交给了用户态应用程序,并提供了相应的接口供用户态应用程序调节CPU 运行频率使用。(可以使用 Dominik 等人开发了 cpufrequtils 工具包 )

示例================================================================================设置前查看当前支持的策略D:\PythonProject\python3-webapp-Su\www>adb shell cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"schedZ91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_available_governorscat scaling_available_governorsondemand userspace powersave interactive performance sched================================================================================设置- userspcace 策略D:\PythonProject\python3-webapp-Su\www>adb shell "echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"================================================================================设置后查看D:\PythonProject\python3-webapp-Su\www>adb shell cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"userspace

2. 设置频率

adb shell “echo [频率档位] > /sys/devices/system/cpu/cpu【Index】/cpufreq/scaling_setspeed”

adb shell “echo 910000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed”

示例================================================================================设置前查看频率档次Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_available_frequenciescat scaling_available_frequencies1274000 1235000 1196000 1170000 1105000 1053000 1001000 962000 910000 845000 702000 624000 546000 416000 338000 299000D:\PythonProject\python3-webapp-Su\www>adb shell "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"1274000================================================================================设置频率D:\PythonProject\python3-webapp-Su\www>adb shell "echo 910000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"================================================================================设置后查看D:\PythonProject\python3-webapp-Su\www>adb shell "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"910000

3.验证

查看当前频率

adb shell “cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq”

Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000Z91:/sys/devices/system/cpu/cpu0/cpufreq # cat scaling_cur_freqcat scaling_cur_freq910000

adb shell “cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table”

Z91:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat trans_tablecat trans_table   From  :    To         :   1274000   1235000   1196000   1170000   1105000   1053000   1001000    962000    910000    845000    702000    624000    546000    416000    338000    299000  1274000:         0     72086     30152     45166     26802     22756     12876     14665     15069     19964      9916      7919      9179      5340      2574     40418  1235000:    157400         0      5901      4770      2327      2112      2596      2698      2500      3182      1094       688       505       364       127      3543  1196000:     34936     67770         0      6519      1791      1316       955      1945      1560      2324       899       526       380       201        86      1778  1170000:     40951     26632     67810         0      7262      3694      2242      4277      5075      6946      2082      1148       936       583       204      3856  1105000:     16596      8787      9777     75941         0      5691      2241      2475      5080      7311      2249      1169       856       480       201      3011  1053000:     12324      2572      3135     22246     71408         0      5509      4314      3505     11277      3786      1989      1446       625       266      2640  1001000:      7200      1604       908      5496     14872     67595         0      5141      3611      7775      4061      2273      1492       512       198      2607   962000:      8339      1831      1061      3513      7956     25683     68943         0      7431     14108      9196      5912      4174      1179       490      3578   910000:      7886      1503       956      2602      3442      9306     16914     78332         0     15817      8116      6036      4673      1071       414      4904   845000:     12534      1354       928      2215      2172      5106      9893     44259    102265         0     20634     27991     44054     11631      2671     19834   702000:      8385       698       453       929       602       789      1002      2361     10980    129393         0     12538     37133     17373      4490     22439   624000:      5710       464       254       695       772       971       776       874      1531     34078     93861         0     20684     19690      5655     35303   546000:      5514       361       205       439       378       380       248       420       763     46006     66027     30107         0     22667      9997     41643   416000:      3629       494       379      1233      1080       735       407       536       827      3219     22281    113398     28840         0     12555    131669   338000:       610       119        50        86        47        65        49        63       136       521       582      3063     34551     11133         0     16250   299000:     12868      3532      1017      1848       954       843       694      1033      1640      5620      4781      6561     36252    228433     27397         0Z91:/sys/devices/system/cpu/cpu0/cpufreq/stats #

转载地址:http://iocti.baihongyu.com/

你可能感兴趣的文章
6种方式实现JavaScript数组扁平化(flat)方法的总结
查看>>
49个在工作中常用且容易遗忘的CSS样式清单整理
查看>>
20种在学习编程的同时也可以在线赚钱的方法
查看>>
隐藏搜索框:CSS 动画正反向序列
查看>>
127个超级实用的JavaScript 代码片段,你千万要收藏好(上)
查看>>
【视频教程】Javascript ES6 教程27—ES6 构建一个Promise
查看>>
【5分钟代码练习】01—导航栏鼠标悬停效果的实现
查看>>
127个超级实用的JavaScript 代码片段,你千万要收藏好(中)
查看>>
127个超级实用的JavaScript 代码片段,你千万要收藏好(下)
查看>>
【web素材】03-24款后台管理系统网站模板
查看>>
Flex 布局教程:语法篇
查看>>
年薪50万+的90后程序员都经历了什么?
查看>>
2019年哪些外快收入可达到2万以上?
查看>>
【JavaScript 教程】标准库—Date 对象
查看>>
前阿里手淘前端负责人@winter:前端人如何保持竞争力?
查看>>
【JavaScript 教程】面向对象编程——实例对象与 new 命令
查看>>
我在网易做了6年前端,想给求职者4条建议
查看>>
SQL1015N The database is in an inconsistent state. SQLSTATE=55025
查看>>
RQP-DEF-0177
查看>>
MySQL字段类型的选择与MySQL的查询效率
查看>>