linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control
@ 2020-04-02  7:56 Chen Yu
  2020-04-02 13:33 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Chen Yu @ 2020-04-02  7:56 UTC (permalink / raw)
  To: linux-pm
  Cc: Jonathan Corbet, Pavel Machek, Mauro Carvalho Chehab,
	Thomas Gleixner, Josh Poimboeuf, Andrew Morton, linux-doc,
	Pawan Gupta, linux-kernel, Chen Yu, Rafael J. Wysocki, Len Brown,
	Andy Shevchenko, Randy Dunlap

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_messages'.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
---
v2: According to Randy's suggestion, add the command line
    option to Documentation/admin-guide/kernel-parameters.txt

v3: According to Rafael's suggestion, rename the boot command
    to pm_debug_messages
---
 Documentation/admin-guide/kernel-parameters.txt | 3 +++
 kernel/power/main.c                             | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index ed73df5f1369..3fb9cbee8d28 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3720,6 +3720,9 @@
 			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
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 69b7a8aeca3b..40f86ec4ab30 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_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.
-- 
2.17.1


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

* Re: [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control
  2020-04-02  7:56 [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control Chen Yu
@ 2020-04-02 13:33 ` Rafael J. Wysocki
  2020-04-06  9:18   ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-04-02 13:33 UTC (permalink / raw)
  To: Chen Yu
  Cc: Linux PM, Jonathan Corbet, Pavel Machek, Mauro Carvalho Chehab,
	Thomas Gleixner, Josh Poimboeuf, Andrew Morton,
	open list:DOCUMENTATION, Pawan Gupta, Linux Kernel Mailing List,
	Rafael J. Wysocki, Len Brown, Andy Shevchenko, Randy Dunlap

On Thu, Apr 2, 2020 at 9:58 AM Chen Yu <yu.c.chen@intel.com> 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_messages'.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> ---
> v2: According to Randy's suggestion, add the command line
>     option to Documentation/admin-guide/kernel-parameters.txt
>
> v3: According to Rafael's suggestion, rename the boot command
>     to pm_debug_messages
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 3 +++
>  kernel/power/main.c                             | 7 +++++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index ed73df5f1369..3fb9cbee8d28 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3720,6 +3720,9 @@
>                         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
> diff --git a/kernel/power/main.c b/kernel/power/main.c
> index 69b7a8aeca3b..40f86ec4ab30 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_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.
> --

Applied (as 5.7-rc material) with modified subject and changelog, thanks!

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

* Re: [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control
  2020-04-02 13:33 ` Rafael J. Wysocki
@ 2020-04-06  9:18   ` Pavel Machek
  2020-04-06  9:54     ` Chen Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2020-04-06  9:18 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Chen Yu, Linux PM, Jonathan Corbet, Mauro Carvalho Chehab,
	Thomas Gleixner, Josh Poimboeuf, Andrew Morton,
	open list:DOCUMENTATION, Pawan Gupta, Linux Kernel Mailing List,
	Rafael J. Wysocki, Len Brown, Andy Shevchenko, Randy Dunlap

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

Hi!

> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index ed73df5f1369..3fb9cbee8d28 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -3720,6 +3720,9 @@
> >                         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

> Applied (as 5.7-rc material) with modified subject and changelog,
  thanks!

Please don't.

We have pnp.debug, i8042.debug, acpi.debug_*, lsm.debug... It makes
sense to do pm.debug... we want to have some consistency.

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control
  2020-04-06  9:18   ` Pavel Machek
@ 2020-04-06  9:54     ` Chen Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Yu @ 2020-04-06  9:54 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Rafael J. Wysocki, Linux PM, Jonathan Corbet,
	Mauro Carvalho Chehab, Thomas Gleixner, Josh Poimboeuf,
	Andrew Morton, open list:DOCUMENTATION, Pawan Gupta,
	Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown,
	Andy Shevchenko, Randy Dunlap

Hi Pavel,
thanks for review.
On Mon, Apr 06, 2020 at 11:18:13AM +0200, Pavel Machek wrote:
> Hi!
> 
> > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > > index ed73df5f1369..3fb9cbee8d28 100644
> > > --- a/Documentation/admin-guide/kernel-parameters.txt
> > > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > > @@ -3720,6 +3720,9 @@
> > >                         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
> 
> > Applied (as 5.7-rc material) with modified subject and changelog,
>   thanks!
> 
> Please don't.
> 
> We have pnp.debug, i8042.debug, acpi.debug_*, lsm.debug... It makes
> sense to do pm.debug... we want to have some consistency.
> 
We also have initcall_debug. It looks like the 'dot' indicates
that it is a module(or driver) parameter, and have multiple options
for user to choose from, but it looks like this is not the case for
pm_debug_messages.

Thanks,
Chenyu
> Thanks,
> 									Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



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

end of thread, other threads:[~2020-04-06  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02  7:56 [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control Chen Yu
2020-04-02 13:33 ` Rafael J. Wysocki
2020-04-06  9:18   ` Pavel Machek
2020-04-06  9:54     ` 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).