aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-19 02:38:44 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-22 02:31:27 +0200
commit8d8b2441db9647890251538f60b75a4e45fdef8d (patch)
tree57f0acb27062c75ece6982231b81d67f7909f834 /include/linux/suspend.h
parentPM / suspend: Export pm_suspend_target_state (diff)
downloadwireguard-linux-8d8b2441db9647890251538f60b75a4e45fdef8d.tar.xz
wireguard-linux-8d8b2441db9647890251538f60b75a4e45fdef8d.zip
PM / sleep: Do not print debug messages by default
Debug messages from the system suspend/hibernation infrastructure can fill up the entire kernel log buffer in some cases and anyway they are only useful for debugging. They depend on CONFIG_PM_DEBUG, but that is set as a rule as some generally useful diagnostic facilities depend on it too. For this reason, avoid printing those messages by default, but make it possible to turn them on as needed with the help of a new sysfs attribute under /sys/power/. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 2159f6841768..707e4cdf21c2 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -492,8 +492,14 @@ 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, ...);
#else
#define pm_print_times_enabled (false)
+
+#include <linux/printk.h>
+
+#define pm_pr_dbg(fmt, ...) \
+ no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
#endif
#ifdef CONFIG_PM_AUTOSLEEP