打印

[ArmV8] [Cortex-A53] [PMU] PM_CCNTR to measure cpuload

[复制链接]
284|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
电员师|  楼主 | 2018-9-9 10:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Dear Experts
I am working on a target that contains quad A53 cores operating at 1GHz. The operating system idle loop contains WFI inline assembly instruction. I know that the Core Clock halts during the WFI instruction which can be seen on the PM_CCNTR counts.
I was thinking if I can utilize this fact to get some figures around the system cpu_load. The idea is if I am sampling the PM_CCNTR on a regular bases with time stamp. I can use these time stamps to calculate the diff time between to consecutive samples. do the PM_CCNTR diff value can be indicative to the cpuload?
example: if I am sampling every 10ms seconds I should expect 10,000,000 counts if the core utilization is 100%. If I got 7,000,000 this means that the core spent 30% of the time in the idle loop. hence, the cpu load should be 70%.
Note: there is no where else on the code where WFI is been used.
My question: Is this methodology make sense? Is there any thing that could alter the core clock other than the WFI instruction? What else should I take into account?

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

471

主题

480

帖子

0

粉丝