参考内核文档
Supporting multiple CPU idle levels in kernel cpuidle sysfs System global cpuidle related information and tunables are under /sys/devices/system/cpu/cpuidle The current interfaces in this directory has self-explanatory names: * current_driver * current_governor_ro With cpuidle_sysfs_switch boot option (meant for developer testing) following objects are visible instead. * current_driver * available_governors * current_governor In this case users can switch the governor at run time by writing to current_governor. Per logical CPU specific cpuidle information are under /sys/devices/system/cpu/cpuX/cpuidle for each online cpu X -------------------------------------------------------------------------------- # ls -lR /sys/devices/system/cpu/cpu0/cpuidle/ /sys/devices/system/cpu/cpu0/cpuidle/: total 0 drwxr-xr-x 2 root root 0 Feb 8 10:42 state0 drwxr-xr-x 2 root root 0 Feb 8 10:42 state1 drwxr-xr-x 2 root root 0 Feb 8 10

本文探讨如何通过内核文档来计算每个CPU进入idle状态所花费的时间,详细解析了idle阶段时间的显示以及如何获取前后两次idle状态的时间差,以此来理解CPU在idle状态的行为。
最低0.47元/天 解锁文章
1583

被折叠的 条评论
为什么被折叠?



