summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2012-05-29 17:33:56 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2012-07-18 14:42:08 +0530
commit30e17e3937ca947475adaa9fafdabbb588abd163 (patch)
tree30fa46e871fb1c71ebd9ad9245c05f4b095f1f84 /kernel/power
parent245097f65bff51756991bbfc8951ef7fd135d062 (diff)
PM / Suspend: Print wall time at suspend entry and exit
Change-Id: I92f252414c013b018b9a392eae1ee039aa0e89dc Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/suspend.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 74eb3de0a657..384730264515 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -24,6 +24,7 @@
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/syscore_ops.h>
+#include <linux/rtc.h>
#include <trace/events/power.h>
#include "power.h"
@@ -303,6 +304,18 @@ int enter_state(suspend_state_t state)
return error;
}
+static void pm_suspend_marker(char *annotation)
+{
+ struct timespec ts;
+ struct rtc_time tm;
+
+ getnstimeofday(&ts);
+ rtc_time_to_tm(ts.tv_sec, &tm);
+ pr_info("PM: suspend %s %d-%02d-%02d %02d:%02d:%02d.%09lu UTC\n",
+ annotation, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec);
+}
+
/**
* pm_suspend - Externally visible function for suspending the system.
* @state: System sleep state to enter.
@@ -317,6 +330,7 @@ int pm_suspend(suspend_state_t state)
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
return -EINVAL;
+ pm_suspend_marker("entry");
error = enter_state(state);
if (error) {
suspend_stats.fail++;
@@ -324,6 +338,7 @@ int pm_suspend(suspend_state_t state)
} else {
suspend_stats.success++;
}
+ pm_suspend_marker("exit");
return error;
}
EXPORT_SYMBOL(pm_suspend);