From: srinivas srinivas.kalaga@arm.com
The following patches add power events in /debug/tracing/events/power.
These patches have been tested and applied only on the latest OMAP pm branch. The first diff set is for cpufreq and second one for cpuidle framework. The first diff patch applies only if OPP layer is included in the OMAP kernel.
Review comments are welcome.
srinivas (1): Ftrace: Timestamp of entry into low power states and performance states
arch/arm/plat-omap/cpu-omap.c | 2 ++ drivers/cpuidle/cpuidle.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletions(-)
From: srinivas srinivas.kalaga@arm.com
--- arch/arm/plat-omap/cpu-omap.c | 2 ++ drivers/cpuidle/cpuidle.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index f9b480d..afa03aa 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c @@ -25,6 +25,7 @@ #include <linux/err.h> #include <linux/clk.h> #include <linux/io.h> +#include <trace/events/power.h>
#include <mach/hardware.h> #include <plat/clock.h> @@ -119,6 +120,7 @@ static int omap_target(struct cpufreq_policy *policy, break; } } + trace_power_frequency(POWER_PSTATE, ind); } #endif return ret; diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 12fdd39..15dc70a 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -85,7 +85,9 @@ 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->last_residency = target_state->enter(dev, target_state); + trace_power_end(0); if (dev->last_state) target_state = dev->last_state;
@@ -95,7 +97,6 @@ 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(0); }
/**