linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / sleep: Add pm_debug_messages boot command control
@ 2020-03-27 11:11 Chen Yu
  2020-03-27 15:39 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Yu @ 2020-03-27 11:11 UTC (permalink / raw)
  To: linux-pm
  Cc: Pavel Machek, linux-kernel, Chen Yu, Rafael J. Wysocki,
	Len Brown, Andy Shevchenko

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" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
---
 kernel/power/main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/power/main.c b/kernel/power/main.c
index 69b7a8aeca3b..1da3d7c15e03 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -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.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / sleep: Add pm_debug_messages boot command control
  2020-03-27 11:11 [PATCH] PM / sleep: Add pm_debug_messages boot command control Chen Yu
@ 2020-03-27 15:39 ` Randy Dunlap
  2020-03-28 10:39   ` Chen Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2020-03-27 15:39 UTC (permalink / raw)
  To: Chen Yu, linux-pm
  Cc: Pavel Machek, linux-kernel, Rafael J. Wysocki, Len Brown,
	Andy Shevchenko

On 3/27/20 4:11 AM, Chen Yu wrote:
> 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.

> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> ---
>  kernel/power/main.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/power/main.c b/kernel/power/main.c
> index 69b7a8aeca3b..1da3d7c15e03 100644
> --- a/kernel/power/main.c
> +++ b/kernel/power/main.c
> @@ -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.
> 


-- 
~Randy
Reported-by: Randy Dunlap <rdunlap@infradead.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / sleep: Add pm_debug_messages boot command control
  2020-03-27 15:39 ` Randy Dunlap
@ 2020-03-28 10:39   ` Chen Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Yu @ 2020-03-28 10:39 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-pm, Pavel Machek, linux-kernel, Rafael J. Wysocki,
	Len Brown, Andy Shevchenko

Hi Randy,
On Fri, Mar 27, 2020 at 08:39:44AM -0700, Randy Dunlap wrote:
> On 3/27/20 4:11 AM, Chen Yu wrote:
> > 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.
> 
Thanks for pointing it out, I'll add it in the v2 patch.
Thanks,
Chenyu
> ~Randy
> Reported-by: Randy Dunlap <rdunlap@infradead.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-28 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 11:11 [PATCH] PM / sleep: Add pm_debug_messages boot command control Chen Yu
2020-03-27 15:39 ` Randy Dunlap
2020-03-28 10:39   ` Chen Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).