diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c index 4c4e8ed6bc88..f4028b2b62d8 100644 --- a/drivers/cpuidle/lpm-levels.c +++ b/drivers/cpuidle/lpm-levels.c @@ -1418,6 +1418,7 @@ void update_ipi_history(int cpu) if (history->current_ptr >= MAXSAMPLES) history->current_ptr = 0; history->cpu_idle_resched_ts = now; + trace_ipi_wakeup_time(ktime_to_us(now)); } #endif @@ -1474,7 +1475,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev, trace_cpu_idle_enter(idx); lpm_stats_cpu_enter(idx, start_time); - if (need_resched()) + if (need_resched() || is_IPI_pending(cpumask_of(dev->cpu))) goto exit; if (idx == cpu->nlevels - 1) diff --git a/include/trace/events/trace_msm_low_power.h b/include/trace/events/trace_msm_low_power.h index 3a4aceadafed..9210583e8f87 100644 --- a/include/trace/events/trace_msm_low_power.h +++ b/include/trace/events/trace_msm_low_power.h @@ -244,6 +244,23 @@ TRACE_EVENT(cluster_pred_hist, __entry->sample, __entry->tmr) ); +TRACE_EVENT(ipi_wakeup_time, + + TP_PROTO(u64 wakeup), + + TP_ARGS(wakeup), + + TP_STRUCT__entry( + __field(u64, wakeup) + ), + + TP_fast_assign( + __entry->wakeup = wakeup; + ), + + TP_printk("wakeup:%llu", __entry->wakeup) +); + #endif #define TRACE_INCLUDE_FILE trace_msm_low_power #include