===================================================================
@@ -375,7 +375,10 @@ static inline int hlt_use_halt(void)
void default_idle(void)
{
if (hlt_use_halt()) {
+ /* trace_power_start is deprecated, remove it after a while */
trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+ trace_power_switch_state(POWER_CSTATE, 1, smp_processor_id());
+
current_thread_info()->status &= ~TS_POLLING;
/*
* TS_POLLING-cleared state must be visible before we
@@ -446,6 +449,8 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait);
void mwait_idle_with_hints(unsigned long ax, unsigned long cx)
{
trace_power_start(POWER_CSTATE, (ax>>4)+1, smp_processor_id());
+ trace_power_switch_state(POWER_CSTATE, (ax>>4)+1, smp_processor_id());
+
if (!need_resched()) {
if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR))
clflush((void *)¤t_thread_info()->flags);
@@ -462,6 +467,8 @@ static void mwait_idle(void)
{
if (!need_resched()) {
trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+ trace_power_switch_state(POWER_CSTATE, 1, smp_processor_id());
+
if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR))
clflush((void *)¤t_thread_info()->flags);
@@ -482,11 +489,9 @@ static void mwait_idle(void)
*/
static void poll_idle(void)
{
- trace_power_start(POWER_CSTATE, 0, smp_processor_id());
local_irq_enable();
while (!need_resched())
cpu_relax();
- trace_power_end(0);
}
/*
===================================================================
@@ -106,7 +106,10 @@ static void cpuidle_idle_call(void)
/* give the governor an opportunity to reflect on the outcome */
if (cpuidle_curr_governor->reflect)
cpuidle_curr_governor->reflect(dev);
+
+ /* trace_power_end is deprecated, remove it after a while */
trace_power_end(smp_processor_id());
+ trace_power_switch_state(POWER_CSTATE, 0, smp_processor_id());
}
/**
===================================================================
@@ -192,8 +192,11 @@ static int intel_idle(struct cpuidle_dev
stop_critical_timings();
#ifndef MODULE
+ /* trace_power_start is deprecated, remove it after a while */
trace_power_start(POWER_CSTATE, (eax >> 4) + 1, cpu);
#endif
+ trace_power_switch_state(POWER_CSTATE, (eax >> 4) + 1, smp_processor_id());
+
if (!need_resched()) {
__monitor((void *)¤t_thread_info()->flags, 0, 0);
===================================================================
@@ -13,4 +13,4 @@
#define CREATE_TRACE_POINTS
#include <trace/events/power.h>
-
+EXPORT_TRACEPOINT_SYMBOL_GPL(power_switch_state);