aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-23 00:03:43 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-23 00:03:43 +0200
commitcb08e0353c249a27aed10c6f60a13871ae449d33 (patch)
tree1f0a5ea686df33423b364a98cc692d94b86676ab /include/linux/suspend.h
parentPM / sleep: Mark suspend/hibernation start and finish (diff)
downloadlinux-dev-cb08e0353c249a27aed10c6f60a13871ae449d33.tar.xz
linux-dev-cb08e0353c249a27aed10c6f60a13871ae449d33.zip
PM / timekeeping: Print debug messages when requested
The messages printed by tk_debug_account_sleep_time() are basically useful for system sleep debugging, so print them only when the other debug messages from the core suspend/hibernate code are enabled. While at it, make it clear that the messages from tk_debug_account_sleep_time() are about timekeeping suspend duration, because in general timekeeping may be suspeded and resumed for multiple times during one system suspend-resume cycle. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 707e4cdf21c2..97e394feabdb 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -492,16 +492,22 @@ static inline void unlock_system_sleep(void) {}
#ifdef CONFIG_PM_SLEEP_DEBUG
extern bool pm_print_times_enabled;
-extern __printf(1, 2) void pm_pr_dbg(const char *fmt, ...);
+extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...);
#else
#define pm_print_times_enabled (false)
#include <linux/printk.h>
-#define pm_pr_dbg(fmt, ...) \
+#define __pm_pr_dbg(defer, fmt, ...) \
no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
#endif
+#define pm_pr_dbg(fmt, ...) \
+ __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
+
+#define pm_deferred_pr_dbg(fmt, ...) \
+ __pm_pr_dbg(true, fmt, ##__VA_ARGS__)
+
#ifdef CONFIG_PM_AUTOSLEEP
/* kernel/power/autosleep.c */