ARM: tegra: power: Trace LP2 entry and exit
Antti P Miettinen [Tue, 14 Aug 2012 10:14:00 +0000 (13:14 +0300)]
Add traces for measuring LP2 entry/exit times.

Bug 960304

Change-Id: I20bb0f8d55a7ed6f7e88e10d924871a3d09f2507
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/123313
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

arch/arm/mach-tegra/cpuidle.c

index 47d5996..9d36d0f 100644 (file)
@@ -45,6 +45,7 @@
 #include "cpuidle.h"
 #include "pm.h"
 #include "sleep.h"
+#include "timer.h"
 
 int tegra_lp2_exit_latency;
 static int tegra_lp2_power_off_time;
@@ -117,12 +118,20 @@ static int tegra_idle_enter_lp2(struct cpuidle_device *dev,
                return tegra_idle_enter_lp3(dev, state);
        }
 
+       trace_printk("LP2 entry at %lu us\n",
+                    (unsigned long)readl(IO_ADDRESS(TEGRA_TMR1_BASE)
+                                         + TIMERUS_CNTR_1US));
+
        local_irq_disable();
        enter = ktime_get();
 
        tegra_cpu_idle_stats_lp2_ready(dev->cpu);
        tegra_idle_lp2(dev, state);
 
+       trace_printk("LP2 exit at %lu us\n",
+                    (unsigned long)readl(IO_ADDRESS(TEGRA_TMR1_BASE)
+                                         + TIMERUS_CNTR_1US));
+
        exit = ktime_sub(ktime_get(), enter);
        us = ktime_to_us(exit);