Skip to content

Commit 64f9a1e

Browse files
osimarrJarkko Sakkinen
authored andcommitted
PM: sleep: Narrow down -DDEBUG on kernel/power/ files
The macro -DDEBUG is broadly enabled on kernel/power/ directory if CONFIG_DYNAMIC_DEBUG is enabled. As side effect all debug messages using pr_debug() and dev_dbg() are enabled by default on dynamic debug. We're reworking pm_pr_dbg() to support dynamic debug, where pm_pr_dbg() will print message if either pm_debug_messages_on flag is set or if it's explicitly enabled on dynamic debug's control. That means if we let -DDEBUG broadly set, the pm_debug_messages_on flag will be bypassed by default on pm_pr_dbg() if dynamic debug is also enabled. The files that directly use pr_debug() and dev_dbg() on kernel/power/ are: - swap.c - snapshot.c - energy_model.c And those files do not use pm_pr_dbg(). So if we limit -DDEBUG to them, we keep the same functional behavior while allowing the pm_pr_dbg() refactor. Signed-off-by: David Cohen <dacohen@pm.me> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c26dd98 commit 64f9a1e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

kernel/power/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
ccflags-$(CONFIG_PM_DEBUG) := -DDEBUG
3+
ifeq ($(CONFIG_DYNAMIC_DEBUG), y)
4+
CFLAGS_swap.o := -DDEBUG
5+
CFLAGS_snapshot.o := -DDEBUG
6+
CFLAGS_energy_model.o := -DDEBUG
7+
endif
48

59
KASAN_SANITIZE_snapshot.o := n
610

kernel/power/process.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* Originally from swsusp.
77
*/
88

9-
10-
#undef DEBUG
11-
129
#include <linux/interrupt.h>
1310
#include <linux/oom.h>
1411
#include <linux/suspend.h>

0 commit comments

Comments
 (0)