From bb6628b182402adcfa7db76a8a5eca97e03ab1e5 Mon Sep 17 00:00:00 2001 From: paris_yeh Date: Fri, 28 Dec 2012 15:33:34 +0800 Subject: [PATCH] apq8064: pm: debug: print out time spent in suspend using sleep clk Change-Id: I80c03a00f84d100a8a89ec196dbb64eaf6875235 Signed-off-by: paris_yeh Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/65017 Reviewed-by: Sam hblee Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/68032 Reviewed-by: Jive Hwang Tested-by: Jive Hwang --- arch/arm/mach-msm/pm-8x60.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/mach-msm/pm-8x60.c b/arch/arm/mach-msm/pm-8x60.c index d545016b3fa..0ae2a81630e 100644 --- a/arch/arm/mach-msm/pm-8x60.c +++ b/arch/arm/mach-msm/pm-8x60.c @@ -959,6 +959,17 @@ void msm_pm_cpu_enter_lowpower(unsigned int cpu) msm_pm_swfi(); } +#ifdef CONFIG_PM_DEBUG +static void msm_show_suspend_time(int64_t time) +{ + struct timespec suspend_time = {0, 0}; + + timespec_add_ns(&suspend_time, time); + pr_info("Suspended for %lu.%03lu seconds\n", suspend_time.tv_sec, + suspend_time.tv_nsec / NSEC_PER_MSEC); +} +#endif + static int msm_pm_enter(suspend_state_t state) { bool allow[MSM_PM_SLEEP_MODE_NR]; @@ -1027,6 +1038,9 @@ static int msm_pm_enter(suspend_state_t state) } time = msm_pm_timer_exit_suspend(time, period); msm_pm_add_stat(MSM_PM_STAT_SUSPEND, time); +#ifdef CONFIG_PM_DEBUG + msm_show_suspend_time(time); +#endif } else if (allow[MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE]) { if (MSM_PM_DEBUG_SUSPEND & msm_pm_debug_mask) pr_info("%s: standalone power collapse\n", __func__);