Skip to content

Commit db96a75

Browse files
yu-chen-surfrafaeljw
authored andcommitted
PM: sleep: Add pm_debug_messages kernel command line option
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 <[email protected]> [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b5252a6 commit db96a75

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,6 +3719,9 @@
37193719
Override pmtimer IOPort with a hex value.
37203720
e.g. pmtmr=0x508
37213721

3722+
pm_debug_messages [SUSPEND,KNL]
3723+
Enable suspend/resume debug messages during boot up.
3724+
37223725
pnp.debug=1 [PNP]
37233726
Enable PNP debug messages (depends on the
37243727
CONFIG_PNP_DEBUG_MESSAGES option). Change at run-time

kernel/power/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj,
535535

536536
power_attr(pm_debug_messages);
537537

538+
static int __init pm_debug_messages_setup(char *str)
539+
{
540+
pm_debug_messages_on = true;
541+
return 1;
542+
}
543+
__setup("pm_debug_messages", pm_debug_messages_setup);
544+
538545
/**
539546
* __pm_pr_dbg - Print a suspend debug message to the kernel log.
540547
* @defer: Whether or not to use printk_deferred() to print the message.

0 commit comments

Comments
 (0)