http://defect.opensolaris.org/bz/show_bug.cgi?id=8084





--- Comment #3 from Rafael Vanoni <rafael.vanoni at sun.com>  2009-04-10 
11:51:25 ---
cpuidle.c had code to zero the cstate information, which becomes redundant
after the first changeset for this issue. However, the memset(3C) call to zero
g_cstate_info needs to zero all possible states, not just the first two. The
following patch is on top of the first one.

diff -r c535a6cab975 usr/src/cmd/powertop/common/cpuidle.c
--- a/usr/src/cmd/powertop/common/cpuidle.c     Thu Apr 09 17:14:44 2009 -0700
+++ b/usr/src/cmd/powertop/common/cpuidle.c     Fri Apr 10 11:46:52 2009 -0700
@@ -163,15 +163,6 @@
        hrtime_t        t = 0;

        /*
-        * Zero out the interval time reported by DTrace for
-        * this interval
-        */
-       for (i = 0; i < NSTATES; i++) {
-               g_cstate_info[i].total_time = 0;
-               g_cstate_info[i].events = 0;
-       }
-
-       /*
         * Assume that all the time spent in this interval will
         * be the default "0" state. The DTrace walker will reallocate
         * time out of the default bucket as it processes aggregation
diff -r c535a6cab975 usr/src/cmd/powertop/common/powertop.c
--- a/usr/src/cmd/powertop/common/powertop.c    Thu Apr 09 17:14:44 2009 -0700
+++ b/usr/src/cmd/powertop/common/powertop.c    Fri Apr 10 11:46:52 2009 -0700
@@ -265,7 +265,8 @@

                (void) memset(g_event_info, 0,
                    EVENT_NUM_MAX * sizeof (event_info_t));
-               (void) memset(g_cstate_info, 0, 2 * sizeof (state_info_t));
+               (void) memset(g_cstate_info, 0,
+                   NSTATES * sizeof (state_info_t));

                /* Collect idle state transition stats */
                if (features & FEATURE_CSTATE &&

-- 
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to