cpuidle: move idle traces to cpuidle_enter_state()

idle_exit event is the first event after a core exits
idle state. So this should be traced before local irq
is ebabled. Likewise idle_entry is the last event before
a core enters idle state. This will ease visualising the
cpu idle state from kernel traces.

Signed-off-by: Sandeep Tripathy <[email protected]>
Acked-by: Daniel Lezcano <[email protected]>
[rjw: Subject, rebase]
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
Sandeep Tripathy 2014-07-02 15:00:58 +05:30 • committed by Rafael J. Wysocki
commit 30fe688402
2 changed files with 2 additions and 4 deletions

View file

@ -119,11 +119,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
ktime_t time_start, time_end;
s64 diff;
trace_cpu_idle_rcuidle(index, dev->cpu);
time_start = ktime_get();
entered_state = target_state->enter(dev, drv, index);
time_end = ktime_get();
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
if (!cpuidle_state_is_coupled(dev, drv, entered_state))
local_irq_enable();