[PATCH] enable DEBUG via config option
Olaf Hering
olh at suse.de
Fri Feb 11 21:54:53 EST 2005
Its always boring to edit each file and turn the #undef DEBUG into
#define DEBUG. This patch makes it a simple config option.
Now the question is, how verbose will the boot be when all the printk
are enabled? appears to be ok so far on a p620.
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/Kconfig.debug ./arch/ppc64/Kconfig.debug
--- ../linux-2.6.11-rc3.orig/arch/ppc64/Kconfig.debug 2005-02-03 02:56:48.000000000 +0100
+++ ./arch/ppc64/Kconfig.debug 2005-02-11 11:19:36.473018091 +0100
@@ -47,6 +47,10 @@ config PPCDBG
bool "Include PPCDBG realtime debugging"
depends on DEBUG_KERNEL
+config DEBUG_PPC64
+ bool "enable all the #define DEBUG in arch/ppc64/kernel"
+ depends on DEBUG_KERNEL
+
config IRQSTACKS
bool "Use separate kernel stacks when processing interrupts"
help
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/boot/main.c ./arch/ppc64/boot/main.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/boot/main.c 2005-02-03 02:57:04.000000000 +0100
+++ ./arch/ppc64/boot/main.c 2005-02-11 11:21:09.109714397 +0100
@@ -73,7 +73,6 @@ void *stdin;
void *stdout;
void *stderr;
-#undef DEBUG
static unsigned long claim_base = PROG_START;
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/Makefile ./arch/ppc64/kernel/Makefile
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/Makefile 2005-02-03 02:56:53.000000000 +0100
+++ ./arch/ppc64/kernel/Makefile 2005-02-11 11:18:23.755287408 +0100
@@ -65,3 +65,7 @@ obj-$(CONFIG_ALTIVEC) += vecemu.o vecto
obj-$(CONFIG_KPROBES) += kprobes.o
CFLAGS_ioctl32.o += -Ifs/
+
+ifeq ($(CONFIG_DEBUG_PPC64),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/eeh.c ./arch/ppc64/kernel/eeh.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/eeh.c 2005-02-03 02:56:11.000000000 +0100
+++ ./arch/ppc64/kernel/eeh.c 2005-02-11 11:21:28.519621514 +0100
@@ -35,7 +35,6 @@
#include <asm/systemcfg.h>
#include "pci.h"
-#undef DEBUG
/** Overview:
* EEH, or "Extended Error Handling" is a PCI bridge technology for
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/iSeries_setup.c ./arch/ppc64/kernel/iSeries_setup.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/iSeries_setup.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/iSeries_setup.c 2005-02-11 11:21:45.000000000 +0100
@@ -16,7 +16,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/init.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/iSeries_smp.c ./arch/ppc64/kernel/iSeries_smp.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/iSeries_smp.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/iSeries_smp.c 2005-02-11 11:21:23.000000000 +0100
@@ -12,7 +12,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/idle_power4.S ./arch/ppc64/kernel/idle_power4.S
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/idle_power4.S 2005-02-03 02:55:52.000000000 +0100
+++ ./arch/ppc64/kernel/idle_power4.S 2005-02-11 11:23:49.392135145 +0100
@@ -22,7 +22,6 @@
#include <asm/ppc_asm.h>
#include <asm/offsets.h>
-#undef DEBUG
.text
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/lmb.c ./arch/ppc64/kernel/lmb.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/lmb.c 2005-02-03 02:55:53.000000000 +0100
+++ ./arch/ppc64/kernel/lmb.c 2005-02-11 11:21:52.869560042 +0100
@@ -22,7 +22,6 @@
struct lmb lmb;
-#undef DEBUG
void lmb_dump_all(void)
{
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_pci.c ./arch/ppc64/kernel/maple_pci.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_pci.c 2005-02-03 02:56:49.000000000 +0100
+++ ./arch/ppc64/kernel/maple_pci.c 2005-02-11 11:34:14.593874496 +0100
@@ -8,7 +8,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#define DEBUG
#include <linux/kernel.h>
#include <linux/pci.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_setup.c ./arch/ppc64/kernel/maple_setup.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_setup.c 2005-02-03 02:55:14.000000000 +0100
+++ ./arch/ppc64/kernel/maple_setup.c 2005-02-11 11:34:05.545954836 +0100
@@ -11,7 +11,6 @@
*
*/
-#define DEBUG
#include <linux/config.h>
#include <linux/init.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_time.c ./arch/ppc64/kernel/maple_time.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/maple_time.c 2005-02-03 02:55:53.000000000 +0100
+++ ./arch/ppc64/kernel/maple_time.c 2005-02-11 11:22:33.000000000 +0100
@@ -11,7 +11,6 @@
*
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/errno.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/mpic.c ./arch/ppc64/kernel/mpic.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/mpic.c 2005-02-03 02:57:04.000000000 +0100
+++ ./arch/ppc64/kernel/mpic.c 2005-02-11 11:22:39.300391150 +0100
@@ -12,7 +12,6 @@
* for more details.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/types.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_lpar.c ./arch/ppc64/kernel/pSeries_lpar.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_lpar.c 2005-02-03 02:57:04.000000000 +0100
+++ ./arch/ppc64/kernel/pSeries_lpar.c 2005-02-11 11:33:34.111057904 +0100
@@ -19,7 +19,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_setup.c ./arch/ppc64/kernel/pSeries_setup.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_setup.c 2005-02-03 02:55:08.000000000 +0100
+++ ./arch/ppc64/kernel/pSeries_setup.c 2005-02-11 11:21:15.471911174 +0100
@@ -16,7 +16,6 @@
* bootup setup stuff..
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/errno.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_smp.c ./arch/ppc64/kernel/pSeries_smp.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pSeries_smp.c 2005-02-03 02:55:53.000000000 +0100
+++ ./arch/ppc64/kernel/pSeries_smp.c 2005-02-11 11:23:01.739361206 +0100
@@ -12,7 +12,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pci.c ./arch/ppc64/kernel/pci.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pci.c 2005-02-03 02:56:35.000000000 +0100
+++ ./arch/ppc64/kernel/pci.c 2005-02-11 11:21:57.105567991 +0100
@@ -11,7 +11,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_low_i2c.c ./arch/ppc64/kernel/pmac_low_i2c.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_low_i2c.c 2005-02-03 02:55:36.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_low_i2c.c 2005-02-11 11:22:44.241420717 +0100
@@ -16,7 +16,6 @@
* properties parser
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/types.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_nvram.c ./arch/ppc64/kernel/pmac_nvram.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_nvram.c 2005-02-03 02:57:17.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_nvram.c 2005-02-11 11:34:19.703878621 +0100
@@ -29,7 +29,6 @@
#include <asm/machdep.h>
#include <asm/nvram.h>
-#define DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_pci.c ./arch/ppc64/kernel/pmac_pci.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_pci.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_pci.c 2005-02-11 11:32:15.799407889 +0100
@@ -31,7 +31,6 @@
#include "pci.h"
#include "pmac.h"
-#define DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_setup.c ./arch/ppc64/kernel/pmac_setup.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_setup.c 2005-02-03 02:55:07.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_setup.c 2005-02-11 11:22:29.300484590 +0100
@@ -23,7 +23,6 @@
* bootup setup stuff..
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/init.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_smp.c ./arch/ppc64/kernel/pmac_smp.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_smp.c 2005-02-03 02:55:07.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_smp.c 2005-02-11 11:22:24.578418622 +0100
@@ -22,7 +22,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_time.c ./arch/ppc64/kernel/pmac_time.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/pmac_time.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/pmac_time.c 2005-02-11 11:21:34.225666358 +0100
@@ -29,7 +29,6 @@
#include <asm/time.h>
#include <asm/nvram.h>
-#undef DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/prom.c ./arch/ppc64/kernel/prom.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/prom.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/prom.c 2005-02-11 11:22:56.927311249 +0100
@@ -15,7 +15,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <stdarg.h>
#include <linux/config.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/prom_init.c ./arch/ppc64/kernel/prom_init.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/prom_init.c 2005-02-03 02:56:48.000000000 +0100
+++ ./arch/ppc64/kernel/prom_init.c 2005-02-11 11:47:12.781010460 +0100
@@ -15,7 +15,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG_PROM
#include <stdarg.h>
#include <linux/config.h>
@@ -106,7 +105,7 @@ extern const struct linux_logo logo_linu
__asm__ __volatile__(".long " BUG_ILLEGAL_INSTR); \
} while (0)
-#ifdef DEBUG_PROM
+#ifdef DEBUG
#define prom_debug(x...) prom_printf(x)
#else
#define prom_debug(x...)
@@ -643,11 +642,11 @@ static void __init prom_init_mem(void)
p = RELOC(regbuf);
endp = p + (plen / sizeof(cell_t));
-#ifdef DEBUG_PROM
+#ifdef DEBUG
memset(path, 0, PROM_SCRATCH_SIZE);
call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
prom_debug(" node %s :\n", path);
-#endif /* DEBUG_PROM */
+#endif /* DEBUG */
while ((endp - p) >= (_prom->root_addr_cells + _prom->root_size_cells)) {
unsigned long base, size;
@@ -845,7 +844,7 @@ static void __init prom_initialize_tce_t
prom_debug("TCE table: %s\n", path);
prom_debug("\tnode = 0x%x\n", node);
- prom_debug("\tbase = 0x%x\n", vbase);
+ prom_debug("\tbase = 0x%x\n", base);
prom_debug("\tsize = 0x%x\n", minsize);
/* Initialize the table to have a one-to-one mapping
@@ -1516,7 +1515,7 @@ static void __init flatten_device_tree(v
reserve_mem(RELOC(dt_header_start), hdr->totalsize);
memcpy(rsvmap, RELOC(mem_reserve_map), sizeof(mem_reserve_map));
-#ifdef DEBUG_PROM
+#ifdef DEBUG
{
int i;
prom_printf("reserved memory map:\n");
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/ras.c ./arch/ppc64/kernel/ras.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/ras.c 2005-02-03 02:55:23.000000000 +0100
+++ ./arch/ppc64/kernel/ras.c 2005-02-11 11:32:07.303399378 +0100
@@ -74,7 +74,6 @@ static irqreturn_t ras_epow_interrupt(in
static irqreturn_t ras_error_interrupt(int irq, void *dev_id,
struct pt_regs * regs);
-/* #define DEBUG */
static void request_ras_irqs(struct device_node *np, char *propname,
irqreturn_t (*handler)(int, void *, struct pt_regs *),
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/rtasd.c ./arch/ppc64/kernel/rtasd.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/rtasd.c 2005-02-03 02:55:35.000000000 +0100
+++ ./arch/ppc64/kernel/rtasd.c 2005-02-11 11:33:14.493184059 +0100
@@ -28,10 +28,10 @@
#include <asm/atomic.h>
#include <asm/systemcfg.h>
-#if 0
-#define DEBUG(A...) printk(KERN_ERR A)
+#ifdef DEBUG
+#define DBG(A...) printk(KERN_ERR A)
#else
-#define DEBUG(A...)
+#define DBG(A...)
#endif
static DEFINE_SPINLOCK(rtasd_log_lock);
@@ -194,7 +194,7 @@ void pSeries_log_error(char *buf, unsign
unsigned long s;
int len = 0;
- DEBUG("logging event\n");
+ DBG("logging event\n");
if (buf == NULL)
return;
@@ -370,7 +370,7 @@ static int get_eventscan_parms(void)
return -1;
}
rtas_event_scan_rate = *ip;
- DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
+ DBG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
/* Make room for the sequence number */
rtas_error_log_max = rtas_get_error_log_max();
@@ -420,7 +420,7 @@ static int rtasd(void *unused)
printk(KERN_ERR "RTAS daemon started\n");
- DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);
+ DBG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);
/* See if we have any error stored in NVRAM */
memset(logdata, 0, rtas_error_log_max);
@@ -439,9 +439,9 @@ static int rtasd(void *unused)
/* First pass. */
lock_cpu_hotplug();
for_each_online_cpu(cpu) {
- DEBUG("scheduling on %d\n", cpu);
+ DBG("scheduling on %d\n", cpu);
set_cpus_allowed(current, cpumask_of_cpu(cpu));
- DEBUG("watchdog scheduled on cpu %d\n", smp_processor_id());
+ DBG("watchdog scheduled on cpu %d\n", smp_processor_id());
do_event_scan(event_scan);
set_current_state(TASK_INTERRUPTIBLE);
@@ -450,9 +450,9 @@ static int rtasd(void *unused)
unlock_cpu_hotplug();
if (surveillance_timeout != -1) {
- DEBUG("enabling surveillance\n");
+ DBG("enabling surveillance\n");
enable_surveillance(surveillance_timeout);
- DEBUG("surveillance enabled\n");
+ DBG("surveillance enabled\n");
}
lock_cpu_hotplug();
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/scanlog.c ./arch/ppc64/kernel/scanlog.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/scanlog.c 2005-02-03 02:56:48.000000000 +0100
+++ ./arch/ppc64/kernel/scanlog.c 2005-02-11 11:33:56.530027345 +0100
@@ -37,7 +37,7 @@
#define SCANLOG_HWERROR -1
#define SCANLOG_CONTINUE 1
-#define DEBUG(A...) do { if (scanlog_debug) printk(KERN_ERR "scanlog: " A); } while (0)
+#define DBG(A...) do { if (scanlog_debug) printk(KERN_ERR "scanlog: " A); } while (0)
static int scanlog_debug;
static unsigned int ibm_scan_log_dump; /* RTAS token */
@@ -85,14 +85,14 @@ static ssize_t scanlog_read(struct file
memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE);
spin_unlock(&rtas_data_buf_lock);
- DEBUG("status=%d, data[0]=%x, data[1]=%x, data[2]=%x\n",
+ DBG("status=%d, data[0]=%x, data[1]=%x, data[2]=%x\n",
status, data[0], data[1], data[2]);
switch (status) {
case SCANLOG_COMPLETE:
- DEBUG("hit eof\n");
+ DBG("hit eof\n");
return 0;
case SCANLOG_HWERROR:
- DEBUG("hardware error reading scan log data\n");
+ DBG("hardware error reading scan log data\n");
return -EIO;
case SCANLOG_CONTINUE:
/* We may or may not have data yet */
@@ -143,9 +143,9 @@ static ssize_t scanlog_write(struct file
if (buf) {
if (strncmp(stkbuf, "reset", 5) == 0) {
- DEBUG("reset scanlog\n");
+ DBG("reset scanlog\n");
status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0);
- DEBUG("rtas returns %d\n", status);
+ DBG("rtas returns %d\n", status);
} else if (strncmp(stkbuf, "debugon", 7) == 0) {
printk(KERN_ERR "scanlog: debug on\n");
scanlog_debug = 1;
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/setup.c ./arch/ppc64/kernel/setup.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/setup.c 2005-02-03 02:55:51.000000000 +0100
+++ ./arch/ppc64/kernel/setup.c 2005-02-11 11:22:19.422558571 +0100
@@ -10,7 +10,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/module.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/smp.c ./arch/ppc64/kernel/smp.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/kernel/smp.c 2005-02-03 02:56:22.000000000 +0100
+++ ./arch/ppc64/kernel/smp.c 2005-02-11 11:22:06.465576018 +0100
@@ -15,7 +15,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
diff -purNx tags ../linux-2.6.11-rc3.orig/arch/ppc64/mm/hash_utils.c ./arch/ppc64/mm/hash_utils.c
--- ../linux-2.6.11-rc3.orig/arch/ppc64/mm/hash_utils.c 2005-02-03 02:56:10.000000000 +0100
+++ ./arch/ppc64/mm/hash_utils.c 2005-02-11 11:21:04.596749411 +0100
@@ -18,7 +18,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#undef DEBUG
#include <linux/config.h>
#include <linux/spinlock.h>
More information about the Linuxppc64-dev
mailing list