intel_idle: Show correct S & C states in pytimechart
authorJohn Mathew <john.mathew@intel.com>
Mon, 20 Feb 2012 14:29:07 +0000 (16:29 +0200)
committerbuildbot <buildbot@intel.com>
Wed, 7 Mar 2012 02:28:51 +0000 (18:28 -0800)
BZ: 5160

Move the trace_cpu_idle from cpuidle.c to intel_idle.c
where the demotion may happen. Remove trace_power_start
and trace_power_end apis and they are deprecated.

Change-Id: Ia755bbe9559b92b60b5d0deef8193bfa33d7fb3b
Signed-off-by: John Mathew <john.mathew@intel.com>
Reviewed-on: http://android.intel.com:8080/35296
Reviewed-by: Monroy, German <german.monroy@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Cuesta, FernandX <fernandx.cuesta@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/cpuidle/cpuidle.c
drivers/idle/intel_idle.c

index bf50924..b9a0a55 100644 (file)
@@ -97,12 +97,8 @@ static void cpuidle_idle_call(void)
        /* enter the state and update stats */
        dev->last_state = target_state;
 
-       trace_power_start(POWER_CSTATE, next_state, dev->cpu);
-       trace_cpu_idle(next_state, dev->cpu);
-
        dev->last_residency = target_state->enter(dev, target_state);
 
-       trace_power_end(dev->cpu);
        trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
 
        if (dev->last_state)
index c4ce7ac..8d24934 100644 (file)
@@ -445,14 +445,20 @@ static int soc_s0ix_idle(struct cpuidle_device *dev,
 
        /* In case of demotion to S0i1/lpmp3 update last_state */
        if (s0ix_entered) {
-               if (s0ix_state == MID_S0I1_STATE)
+               if (s0ix_state == MID_S0I1_STATE) {
                        dev->last_state = &dev->states[S0I1_STATE_IDX];
-               else if (s0ix_state == MID_LPMP3_STATE)
+                       trace_cpu_idle(S0I1_STATE_IDX, dev->cpu);
+               } else if (s0ix_state == MID_LPMP3_STATE) {
                        dev->last_state = &dev->states[LPMP3_STATE_IDX];
-       } else if (eax == C4_HINT)
+                       trace_cpu_idle(LPMP3_STATE_IDX, dev->cpu);
+               }
+       } else if (eax == C4_HINT) {
                dev->last_state = &dev->states[C4_STATE_IDX];
-       else
+               trace_cpu_idle(C4_STATE_IDX, dev->cpu);
+       } else {
                dev->last_state = &dev->states[C6_STATE_IDX];
+               trace_cpu_idle(C6_STATE_IDX, dev->cpu);
+       }
 
        return usec_delta;
 }
@@ -490,7 +496,9 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
        kt_before = ktime_get_real();
 
        stop_critical_timings();
-
+#ifndef MODULE
+       trace_cpu_idle((eax >> 4) + 1, dev->cpu);
+#endif
        if (!need_resched()) {
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                smp_mb();