diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-19 03:38:44 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-22 03:31:27 +0300 |
commit | 8d8b2441db9647890251538f60b75a4e45fdef8d (patch) | |
tree | 57f0acb27062c75ece6982231b81d67f7909f834 /include/linux/suspend.h | |
parent | bd8c9ba3b1e2037af5af4e48aea1087212838179 (diff) | |
download | linux-8d8b2441db9647890251538f60b75a4e45fdef8d.tar.xz |
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.h | 6 |
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 |