Signed-off-by: Thomas Renninger <trenn@xxxxxxx> CC: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx> CC: cpufreq@xxxxxxxxxxxxxxx --- utils/cpufreq-aperf.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/utils/cpufreq-aperf.c b/utils/cpufreq-aperf.c index c9461ae..ac5e3ac 100644 --- a/utils/cpufreq-aperf.c +++ b/utils/cpufreq-aperf.c @@ -153,7 +153,10 @@ static int get_C_state_time(struct timeval time_diff, uint64_t mperf_diff, expected_ticks = max_freq * overall_msecs; *percent = (mperf_diff * 100) / expected_ticks; - cx_time = (expected_ticks - mperf_diff) / max_freq; + if (mperf_diff > expected_ticks) + cx_time = c0_time; + else + cx_time = (expected_ticks - mperf_diff) / max_freq; c0_time = mperf_diff / max_freq; CX_time->tv_sec = cx_time / 1000; -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe cpufreq" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html