CpuTimeMetrics: Correct for idle times in approx time_in_state metric
As it turns out, the per-core time_in_state data from /sys/devices/system/cpu/cpuX/cpufreq/stats/time_in_state is wall time rather than CPU time and includes time the cores spend in idle states. Consequently, the data we currently report into Power.Approx* metrics isn't correct. We have to correct for the idle time when computing each core type + frequency state's proportional part of the execution. This patch adds a way to do so by polling per-core idle times from /sys/devices/system/cpu/cpuX/cpuidle/stateY/time (via a helper in base::CPU) and updates the CpuTimeMetrics code to account for idle time. Bug: 1081760 Change-Id: I7b8168b47b1e4d118bc7569aebb07952fa78693e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462088 Commit-Queue: Eric Seckler <eseckler@chromium.org> Reviewed-by:Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Bo <boliu@chromium.org> Reviewed-by:
Sami Kyöstilä <skyostil@chromium.org> Cr-Commit-Position: refs/heads/master@{#816509}
Showing
Please register or sign in to comment