From 6b401a5b2d2acf56ec902f96f6381982457ab339 Mon Sep 17 00:00:00 2001 From: Kaushlendra Kumar Date: Tue, 2 Dec 2025 10:10:12 +0530 Subject: [PATCH] cpupower: idle_monitor: fix incorrect value logged after stop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The cpuidle sysfs monitor printed the previous sample’s counter value in cpuidle_stop() instead of the freshly read one. The dprint line used previous_count[cpu][state] while current_count[cpu][state] had just been populated. This caused misleading debug output. Switch the logging to current_count so the post-interval snapshot matches the displayed value. Link: https://lore.kernel.org/r/20251202044012.3844790-1-kaushlendra.kumar@intel.com Signed-off-by: Kaushlendra Kumar Signed-off-by: Shuah Khan --- tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c index 8b42c2f0a5b0f..4225eff9833d9 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c @@ -70,7 +70,7 @@ static int cpuidle_stop(void) current_count[cpu][state] = cpuidle_state_time(cpu, state); dprint("CPU %d - State: %d - Val: %llu\n", - cpu, state, previous_count[cpu][state]); + cpu, state, current_count[cpu][state]); } } return 0; -- 2.47.3