修改测试apk读出的CPU主频

修改系统在sys下面的频率显示,在/drivers/cpufreq/cpufreq.c
/**
 * cpufreq_per_cpu_attr_read() / show_##file_name() -
 * print out cpufreq information
 *
 * Write out information from cpufreq_driver->policy[cpu]; object must be
 * "unsigned int".
 */

#define show_one(file_name, object) \
static ssize_t show_##file_name \
(struct cpufreq_policy *policy, char *buf) \
{ \
return sprintf(buf, "%u\n", policy->object); \
}

#define show_change(file_name, object) \
static ssize_t show_##file_name \
(unsigned int val, char *buf) \
{ \
return sprintf(buf, "%u\n", 1200000); \
}

show_one(cpuinfo_min_freq, cpuinfo.min_freq);
//show_one(cpuinfo_max_freq, cpuinfo.max_freq);
show_change(cpuinfo_max_freq, cpuinfo.max_freq);  //change by azad  for change the freq
show_one(cpuinfo_transition_latency, cpuinfo.transition_latency);
show_one(scaling_min_freq, min);
show_one(scaling_max_freq, max);
//show_one(scaling_cur_freq, cur);
show_change(scaling_cur_freq, cur);


cpuinfo.max_freq  系统的最大频率

scaling_cur_freq     系统当前的频率

修改这两个频率的的接口,不从系统中读取,直接写死

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值