From: Chen Yu <yu.c.chen@intel.com>
To: linux-pm@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>, Pavel Machek <pavel@ucw.cz>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-doc@vger.kernel.org,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
linux-kernel@vger.kernel.org, Chen Yu <yu.c.chen@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control
Date: Thu, 2 Apr 2020 15:56:52 +0800 [thread overview]
Message-ID: <20200402075652.13289-1-yu.c.chen@intel.com> (raw)
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
next reply other threads:[~2020-04-02 7:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 7:56 Chen Yu [this message]
2020-04-02 13:33 ` [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control Rafael J. Wysocki
2020-04-06 9:18 ` Pavel Machek
2020-04-06 9:54 ` Chen Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200402075652.13289-1-yu.c.chen@intel.com \
--to=yu.c.chen@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=jpoimboe@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=pavel@ucw.cz \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=rdunlap@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.