Commit 4111c913 authored by Patrick Mochel's avatar Patrick Mochel

[Power Mgmt] Add CONFIG_PM_DEBUG option

- If enabled, add -DDEBUG to command line for kernel/power/ files.
- Fixup redefinitions of DEBUG in main.c and disk.c
- Kill useless DEBUG_* cruft in swsusp.c
- Change printk()s in dump_info() to pr_debug().
parent 40bac04d
......@@ -18,6 +18,13 @@ config PM
will issue the hlt instruction if nothing is to be done, thereby
sending the processor to sleep and saving power.
config PM_DEBUG
bool "Power Management Debug Support"
---help---
This option enables verbose debugging support in the Power Management
code. This is helpful when debugging and reporting various PM bugs,
like suspend support.
config SOFTWARE_SUSPEND
bool "Software Suspend (EXPERIMENTAL)"
depends on EXPERIMENTAL && PM && SWAP
......
ifeq ($(CONFIG_PM_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
swsusp-smp-$(CONFIG_SMP) += smp.o
obj-y := main.o process.o console.o pm.o
......
......@@ -8,9 +8,6 @@
*
*/
#define DEBUG
#include <linux/suspend.h>
#include <linux/syscalls.h>
#include <linux/reboot.h>
......
......@@ -8,8 +8,6 @@
*
*/
#define DEBUG
#include <linux/suspend.h>
#include <linux/kobject.h>
#include <linux/string.h>
......
......@@ -122,26 +122,6 @@ struct swsusp_info swsusp_info;
static const char name_suspend[] = "Suspend Machine: ";
static const char name_resume[] = "Resume Machine: ";
/*
* Debug
*/
#define DEBUG_DEFAULT
#undef DEBUG_PROCESS
#undef DEBUG_SLOW
#define TEST_SWSUSP 0 /* Set to 1 to reboot instead of halt machine after suspension */
#ifdef DEBUG_DEFAULT
# define PRINTK(f, a...) printk(f, ## a)
#else
# define PRINTK(f, a...) do { } while(0)
#endif
#ifdef DEBUG_SLOW
#define MDELAY(a) mdelay(a)
#else
#define MDELAY(a) do { } while(0)
#endif
/*
* Saving part...
*/
......@@ -328,27 +308,20 @@ static int data_write(void)
return error;
}
#ifdef DEBUG
static void dump_info(void)
{
printk(" swsusp: Version: %u\n",swsusp_info.version_code);
printk(" swsusp: Num Pages: %ld\n",swsusp_info.num_physpages);
printk(" swsusp: UTS Sys: %s\n",swsusp_info.uts.sysname);
printk(" swsusp: UTS Node: %s\n",swsusp_info.uts.nodename);
printk(" swsusp: UTS Release: %s\n",swsusp_info.uts.release);
printk(" swsusp: UTS Version: %s\n",swsusp_info.uts.version);
printk(" swsusp: UTS Machine: %s\n",swsusp_info.uts.machine);
printk(" swsusp: UTS Domain: %s\n",swsusp_info.uts.domainname);
printk(" swsusp: CPUs: %d\n",swsusp_info.cpus);
printk(" swsusp: Image: %ld Pages\n",swsusp_info.image_pages);
printk(" swsusp: Pagedir: %ld Pages\n",swsusp_info.pagedir_pages);
pr_debug(" swsusp: Version: %u\n",swsusp_info.version_code);
pr_debug(" swsusp: Num Pages: %ld\n",swsusp_info.num_physpages);
pr_debug(" swsusp: UTS Sys: %s\n",swsusp_info.uts.sysname);
pr_debug(" swsusp: UTS Node: %s\n",swsusp_info.uts.nodename);
pr_debug(" swsusp: UTS Release: %s\n",swsusp_info.uts.release);
pr_debug(" swsusp: UTS Version: %s\n",swsusp_info.uts.version);
pr_debug(" swsusp: UTS Machine: %s\n",swsusp_info.uts.machine);
pr_debug(" swsusp: UTS Domain: %s\n",swsusp_info.uts.domainname);
pr_debug(" swsusp: CPUs: %d\n",swsusp_info.cpus);
pr_debug(" swsusp: Image: %ld Pages\n",swsusp_info.image_pages);
pr_debug(" swsusp: Pagedir: %ld Pages\n",swsusp_info.pagedir_pages);
}
#else
static void dump_info(void)
{
}
#endif
static void init_header(void)
{
......@@ -574,7 +547,7 @@ static int saveable(struct zone * zone, unsigned long * zone_pfn)
if (PageNosave(page))
return 0;
if (PageReserved(page) && pfn_is_nosave(pfn)) {
PRINTK("[nosave pfn 0x%lx]", pfn);
pr_debug("[nosave pfn 0x%lx]", pfn);
return 0;
}
if ((chunk_size = is_head_of_free_region(page))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment