linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: rjw@rjwysocki.net, lenb@kernel.org
Cc: linux-pm@vger.kernel.org, mario.limonciello@dell.com,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	lukas@wunner.de,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 1/2] PM / sleep: Export the setting of pm_debug_messages_on
Date: Tue,  8 Aug 2017 15:41:14 -0700	[thread overview]
Message-ID: <1502232075-23832-2-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1502232075-23832-1-git-send-email-srinivas.pandruvada@linux.intel.com>

Added a function to export the value of pm_debug_messages_on, so that
other parts of the system can use this flag to enable/disable executing
PM debug code.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 include/linux/suspend.h | 6 ++++++
 kernel/power/main.c     | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 8c3b0b1..5d4b3a3 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -496,6 +496,10 @@ static inline void unlock_system_sleep(void) {}
 #ifdef CONFIG_PM_SLEEP_DEBUG
 extern bool pm_print_times_enabled;
 extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...);
+
+/* Return the value of pm_debug_messages_on */
+bool pm_debug_messages_enabled(void);
+
 #else
 #define pm_print_times_enabled	(false)
 
@@ -503,6 +507,8 @@ extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...);
 
 #define __pm_pr_dbg(defer, fmt, ...) \
 	no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
+
+static inline bool pm_debug_messages_enabled(void) { return false; }
 #endif
 
 #define pm_pr_dbg(fmt, ...) \
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 3074ea4..afb7f00 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -363,6 +363,11 @@ power_attr_ro(pm_wakeup_irq);
 
 static bool pm_debug_messages_on __read_mostly;
 
+bool pm_debug_messages_enabled(void)
+{
+	return pm_debug_messages_on;
+}
+
 static ssize_t pm_debug_messages_show(struct kobject *kobj,
 				      struct kobj_attribute *attr, char *buf)
 {
-- 
2.7.5

  reply	other threads:[~2017-08-08 22:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 22:41 [PATCH v2 0/2] ACPI: Low power idle constraints check Srinivas Pandruvada
2017-08-08 22:41 ` Srinivas Pandruvada [this message]
2017-08-08 22:41 ` [PATCH v2 2/2] ACPI / Sleep: Check low power idle constraints for debug only Srinivas Pandruvada
2017-08-09 23:17   ` Rafael J. Wysocki
2017-08-10  0:50     ` Srinivas Pandruvada
2017-08-10 22:07   ` Mario.Limonciello
2017-08-10 22:54     ` Srinivas Pandruvada
2017-08-11 14:43       ` Mario.Limonciello
2017-08-11 16:18         ` Srinivas Pandruvada
2017-08-12 14:07           ` Rafael J. Wysocki

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=1502232075-23832-2-git-send-email-srinivas.pandruvada@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mario.limonciello@dell.com \
    --cc=rjw@rjwysocki.net \
    /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 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).