I failed to replicate this issue on my side.
But from my point of view, we didn't do anything wrong.
So, is the following patch acceptable for this bug?
======================================================
diff -r 2fb476052291 usr/src/cmd/powertop/display.c
--- a/usr/src/cmd/powertop/display.c    Tue Feb 12 11:55:53 2008 -0800
+++ b/usr/src/cmd/powertop/display.c    Tue Feb 19 23:08:25 2008 +0800
@@ -185,6 +185,9 @@ void show_cstates(double interval)
 
        for (i=0; i< g_ncpus; i++)
                total_c1 += cstate_info[i].total_time;
+
+       if (total_c1 > interval * g_ncpus)
+               total_c1 = interval * g_ncpus;
 
        print(cstate_window, 0, 0, "%s", "Cn\t\t\tAvg   residency\n");
        sprintf(c, "C0 (cpu running)\t\t(%.1f%%)\n",
=======================================================

Thanks,
-Aubrey

Reply via email to