#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/mm.h>
+#include <linux/rtc.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/suspend.h>
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.
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
return -EINVAL;
- pr_info("suspend entry (%s)\n", mem_sleep_labels[state]);
+ pm_suspend_marker("entry");
error = enter_state(state);
if (error) {
suspend_stats.fail++;
} else {
suspend_stats.success++;
}
- pr_info("suspend exit\n");
+ pm_suspend_marker("exit");
return error;
}
EXPORT_SYMBOL(pm_suspend);