- Update to 3.3-rc2.
[linux-flexiantxendom0-3.2.10.git] / tools / perf / builtin-timechart.c
index 3b75b2e..b8efcea 100644 (file)
@@ -675,8 +675,15 @@ static void draw_c_p_states(void)
         * two pass drawing so that the P state bars are on top of the C state blocks
         */
        while (pwr) {
-               if (pwr->type == CSTATE)
+               if (pwr->type == CSTATE) {
+                       /* If the first event is an _end event, start timestamp is zero
+                          -> ignore these */
+                       if (pwr->start_time == 0 || pwr->end_time == 0) {
+                               pwr = pwr->next;
+                               continue;
+                       }
                        svg_cstate(pwr->cpu, pwr->start_time, pwr->end_time, pwr->state);
+               }
                pwr = pwr->next;
        }