@@ -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, ...) \
@@ -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)
{
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(+)