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>
This commit is contained in:
Rafael J. Wysocki
2017-07-19 02:38:44 +02:00
parent bd8c9ba3b1
commit 8d8b2441db
6 changed files with 91 additions and 25 deletions

View File

@@ -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