PM: sleep: Add pm_debug_messages kernel command line option
authorChen Yu <yu.c.chen@intel.com>
Thu, 2 Apr 2020 07:56:52 +0000 (15:56 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Apr 2020 13:29:56 +0000 (15:29 +0200)
Debug messages from the system suspend/hibernation infrastructure
are disabled by default, and can only be enabled after the system
has boot up via /sys/power/pm_debug_messages.

This makes the hibernation resume hard to track as it involves system
boot up across hibernation.  There's no chance for software_resume()
to track the resume process, for example.

Add a kernel command line option to set pm_debug_messages during
boot up.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/admin-guide/kernel-parameters.txt
kernel/power/main.c

index 4e3885e381792d8dac4079440712352b287692a4..df2c2b97f417449ad7ea280b86d0276a11273e51 100644 (file)
                        Override pmtimer IOPort with a hex value.
                        e.g. pmtmr=0x508
 
+       pm_debug_messages       [SUSPEND,KNL]
+                       Enable suspend/resume debug messages during boot up.
+
        pnp.debug=1     [PNP]
                        Enable PNP debug messages (depends on the
                        CONFIG_PNP_DEBUG_MESSAGES option).  Change at run-time
index 69b7a8aeca3b9878006df6e16e564c60b0c9fdc0..40f86ec4ab30db2180301e9da80ef3e90b82cac4 100644 (file)
@@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj,
 
 power_attr(pm_debug_messages);
 
+static int __init pm_debug_messages_setup(char *str)
+{
+       pm_debug_messages_on = true;
+       return 1;
+}
+__setup("pm_debug_messages", pm_debug_messages_setup);
+
 /**
  * __pm_pr_dbg - Print a suspend debug message to the kernel log.
  * @defer: Whether or not to use printk_deferred() to print the message.