Skip to contentSkip to conversation

PM / sleep: Add pm_debug_messages boot command control

PATCH Superseded Chen Yu 2 participants 3 messages Mar 27, 2020 – Mar 28, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chen Yu

author
#0 lore raw

PATCH 1/1 PM / sleep: Add pm_debug_messages boot command control

Debug messages from the system suspend/hibernation infrastructure is 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, eg.

Turning on the pm_debug_messages during boot up by appending 'pm_debug_message'.

Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 kernel/power/main.c | 7 +++++++
 1 file changed, 7 insertions(+)
kernel/power/main.c +7 -0
index 69b7a8aeca3b..1da3d7c15e03 100644
@@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj,
 
 power_attr(pm_debug_messages);
 
+static int __init pm_debug_message_setup(char *str)
+{
+	pm_debug_messages_on = true;
+	return 1;
+}
+__setup("pm_debug_message", pm_debug_message_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.
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Chen Yu

Debug messages from the system suspend/hibernation infrastructure is 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, eg.

Turning on the pm_debug_messages during boot up by appending 'pm_debug_message'.

Please add that command line option to
Documentation/admin-guide/kernel-parameters.txt.
Thanks.

Quoted 27 lines
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 kernel/power/main.c | 7 +++++++
 1 file changed, 7 insertions(+)
kernel/power/main.c +7 -0
index 69b7a8aeca3b..1da3d7c15e03 100644
@@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj,
 
 power_attr(pm_debug_messages);
 
+static int __init pm_debug_message_setup(char *str)
+{
+	pm_debug_messages_on = true;
+	return 1;
+}
+__setup("pm_debug_message", pm_debug_message_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.
Signature · 2 lines
~Randy
Reported-by: Randy Dunlap <[email protected]>
author
#2 lore raw

Hi Randy,

Quoted 8 lines · Randy Dunlap
Quoted 7 lines · Chen Yu

Debug messages from the system suspend/hibernation infrastructure is 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, eg.

Quoted 7 lines
Quoted 2 lines

Turning on the pm_debug_messages during boot up by appending 'pm_debug_message'.

Please add that command line option to
Documentation/admin-guide/kernel-parameters.txt.
Thanks.

Thanks for pointing it out, I'll add it in the v2 patch. Thanks,
Chenyu

Quoted 2 lines

~Randy