ARM: tegra: pm: adding timestamp to suspend trace
Sivaram Nair [Fri, 26 Oct 2012 08:35:02 +0000 (11:35 +0300)]
Tegra RTC counter value is added to the suspend trace calls so that
wakeup latency can be measured.

Change-Id: Ibe97b50d89a843c6caffc02587f398ff5d2936a6
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/162302
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/timer.c
arch/arm/mach-tegra/timer.h
include/trace/events/power.h

index fab0c39..b0c3440 100644 (file)
@@ -926,7 +926,7 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
 
        local_fiq_disable();
 
-       trace_cpu_suspend(CPU_SUSPEND_START);
+       trace_cpu_suspend(CPU_SUSPEND_START, tegra_rtc_read_ms());
 
        if (mode == TEGRA_SUSPEND_LP0) {
 #ifdef CONFIG_TEGRA_CLUSTER_CONTROL
@@ -1010,7 +1010,7 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
        if (pdata && pdata->board_resume)
                pdata->board_resume(mode, TEGRA_RESUME_AFTER_CPU);
 
-       trace_cpu_suspend(CPU_SUSPEND_DONE);
+       trace_cpu_suspend(CPU_SUSPEND_DONE, tegra_rtc_read_ms());
 
        local_fiq_enable();
 
index 9f0597c..ccc79e8 100644 (file)
@@ -130,7 +130,7 @@ static u32 notrace tegra_read_sched_clock(void)
  * tegra_rtc driver could be executing to avoid race conditions
  * on the RTC shadow register
  */
-static u64 tegra_rtc_read_ms(void)
+u64 tegra_rtc_read_ms(void)
 {
        u32 ms = readl(rtc_base + RTC_MILLISECONDS);
        u32 s = readl(rtc_base + RTC_SHADOW_SECONDS);
index b4b8192..8bfe058 100644 (file)
@@ -85,4 +85,6 @@ static inline void tegra_tsc_wait_for_suspend(void) {};
 static inline void tegra_tsc_wait_for_resume(void) {};
 #endif
 
+u64 tegra_rtc_read_ms(void);
+
 #endif /* _MACH_TEGRA_TIMER_H_ */
index 7cf8fbe..d5c9c23 100644 (file)
@@ -71,19 +71,21 @@ enum {
 
 TRACE_EVENT(cpu_suspend,
 
-       TP_PROTO(unsigned int state),
+       TP_PROTO(unsigned int state, unsigned int ts),
 
-       TP_ARGS(state),
+       TP_ARGS(state, ts),
 
        TP_STRUCT__entry(
                __field(u32, state)
+               __field(u32, ts)
        ),
 
        TP_fast_assign(
                __entry->state = state;
+               __entry->ts = ts;
        ),
 
-       TP_printk("state=%lu", (unsigned long)__entry->state)
+       TP_printk("state %u, time %u", __entry->state, __entry->ts)
 );
 
 TRACE_EVENT(cpu_hotplug,