Skip to contentSkip to conversation

loglevel=pci:8,acpi:8,apic=12,dev:8 support v7

PATCH New Yinghai Lu 1 participant 9 messages Sep 18, 2008

Subsystems (6)
Documentation x86 ACPI PCI +2 more subsystems
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

cover loglevel=pci:8,acpi:8,apic=12,dev:8 support v7

KERN_PCI
KERN_ACPI
v4: fix some checkpatch error and warning
v5: add default with DEFINE_LOGLEVE_SETUP_DEF
KERN_APIC
v6: set the default only one time
v7: expand msg_loglevel to 2 digi bits. so KERN_APIC could start from 10

usage:

	in .h to have
		#define KERN_PCI "<pci>"
	in .c to have
		DEFINE_LOGLEVEL_SETUP(pci, KERN_PCI, "pci:");
	then could use
		printk(KERN_DEBUG KERN_PCI fmt, ...);
	and command line
		loglevel=3,pci:8

you can add different printk to different files of one subsys if you like not just one susbsys one tag, and don't need to update kernel.h to add more tags

YH

author
#1 lore raw

PATCH 1/7 add DEFINE_LOGLEVEL_SETUP

so could make subsys easy to add loglevel and xxx_printk
v2: make it more genric, so subsys user only need to two line macro
v3: add back nameStr, so could find out iommu: and iommu_gart: and etc
v4: use printk intead of pci_printk
v5: fix checkpatch error and warning
v6: add DEFINE_LOGLEVEL_SETUP_DEF to take default
v7: call tag_loglevel_setup only one time, so could take several loglevel like
loglevel=4 loglevel=acpi:8 loglevel=pci:8 loglevel=apic:8 is the same as loglevel=4,acpi:8,pci:8,apic:8
v8: add _SPEW, _EXTRA
expand msg_level to 2 digi bits
call tag_name_level_setup second time if user change console_loglevel add get_tag_level, so could use it to find out current level of spcified tag

usage:
in .h to have
#define KERN_PCI "<pci>"
in .c to have
DEFINE_LOGLEVEL_SETUP(pci, KERN_PCI, "pci:");
then could use
printk(KERN_DEBUG KERN_PCI fmt, ...);
and command line
loglevel=pci:8

you can add different printk to different files of one subsys if you like

---
 arch/x86/kernel/vmlinux_32.lds.S  |    1 
 arch/x86/kernel/vmlinux_64.lds.S  |    2 
 include/asm-generic/vmlinux.lds.h |    8 +
 include/linux/init.h              |   22 +++++
 include/linux/kernel.h            |    4 
 init/main.c                       |  156 ++++++++++++++++++++++++++++++++++++--
 kernel/printk.c                   |   90 ++++++++++++++++++---
 7 files changed, 259 insertions(+), 24 deletions(-)
arch/x86/kernel/vmlinux_32.lds.S +1 -0
Index: linux-2.6/arch/x86/kernel/vmlinux_32.lds.S
===================================================================
@@ -145,6 +145,7 @@ SECTIONS
 	*(.x86_cpu_dev.init)
 	__x86_cpu_dev_end = .;
   }
+  LOGLEVEL_SETUP_INIT(8)
   DYN_ARRAY_INIT(8)
   SECURITY_INIT
   . = ALIGN(4);
arch/x86/kernel/vmlinux_64.lds.S +2 -0
Index: linux-2.6/arch/x86/kernel/vmlinux_64.lds.S
===================================================================
@@ -174,6 +174,8 @@ SECTIONS
   }
   __x86_cpu_dev_end = .;
 
+  LOGLEVEL_SETUP_INIT(8)
+
   DYN_ARRAY_INIT(8)
 
   SECURITY_INIT
include/asm-generic/vmlinux.lds.h +8 -0
Index: linux-2.6/include/asm-generic/vmlinux.lds.h
===================================================================
@@ -222,6 +222,14 @@
  * All archs are supposed to use RO_DATA() */
 #define RODATA RO_DATA(4096)
 
+#define LOGLEVEL_SETUP_INIT(align)					\
+	. = ALIGN((align));						\
+	.loglevel_setup.init : AT(ADDR(.loglevel_setup.init) - LOAD_OFFSET) { \
+		VMLINUX_SYMBOL(__loglevel_setup_start) = .;		\
+		*(.loglevel_setup.init)					\
+		VMLINUX_SYMBOL(__loglevel_setup_end) = .;		\
+	}
+
 #define DYN_ARRAY_INIT(align)							\
 	. = ALIGN((align));						\
 	.dyn_array.init : AT(ADDR(.dyn_array.init) - LOAD_OFFSET) {	\
include/linux/init.h +22 -0
Index: linux-2.6/include/linux/init.h
===================================================================
@@ -251,6 +251,28 @@ struct obs_kernel_param {
 /* Relies on boot_command_line being set */
 void __init parse_early_param(void);
 
+struct loglevel_setup {
+	char *name;
+	char *tag;
+	int level;
+};
+
+extern struct loglevel_setup *__loglevel_setup_start[], *__loglevel_setup_end[];
+
+#define DEFINE_LOGLEVEL_SETUP_DEF(nameX, tagX, nameStr, levelX)		\
+	static struct loglevel_setup __loglevel_setup_##nameX __initdata = \
+	{							\
+		.tag = tagX,					\
+		.name = nameStr,				\
+		.level = levelX,				\
+	};							\
+	static struct loglevel_setup *__loglevel_setup_ptr_##nameX __used \
+	__attribute__((__section__(".loglevel_setup.init"))) =	\
+		&__loglevel_setup_##nameX
+
+#define DEFINE_LOGLEVEL_SETUP(nameX, tagX, nameStr)		\
+	DEFINE_LOGLEVEL_SETUP_DEF(nameX, tagX, nameStr, 0)
+
 struct dyn_array {
 	void **name;
 	unsigned long size;
include/linux/kernel.h +4 -0
Index: linux-2.6/include/linux/kernel.h
===================================================================
@@ -89,6 +89,8 @@ extern const char linux_proc_banner[];
 #define	KERN_NOTICE	"<5>"	/* normal but significant condition	*/
 #define	KERN_INFO	"<6>"	/* informational			*/
 #define	KERN_DEBUG	"<7>"	/* debug-level messages			*/
+#define	KERN_SPEW	"<8>"	/* spew messages			*/
+#define	KERN_EXTRA	"<9>"	/* extra messages			*/
 
 /*
  * Annotation for a "continued" line of log printout (only done after a
@@ -104,6 +106,8 @@ extern int console_printk[];
 #define minimum_console_loglevel (console_printk[2])
 #define default_console_loglevel (console_printk[3])
 
+extern int get_tag_level(char *str, int *slen);
+
 struct completion;
 struct pt_regs;
 struct user;
init/main.c +148 -8

183 lines not on this page · raw message

kernel/printk.c +74 -16

137 lines not on this page · raw message

author
#2 lore raw

PATCH 2/7 pci: add KERN_PCI

In reply to Yinghai Lu

use DEFINE_LOGLEVEL_SETUP to set loglevel for pci

---
 drivers/pci/pci.c   |    2 ++
 include/linux/pci.h |    2 ++
 2 files changed, 4 insertions(+)
drivers/pci/pci.c +2 -0
Index: linux-2.6/drivers/pci/pci.c
===================================================================
@@ -1953,6 +1953,8 @@ static int __devinit pci_setup(char *str
 }
 early_param("pci", pci_setup);
 
+DEFINE_LOGLEVEL_SETUP(pci, KERN_PCI, "pci:");
+
 device_initcall_sync(pci_init);
 
 EXPORT_SYMBOL(pci_reenable_device);
include/linux/pci.h +2 -0
Index: linux-2.6/include/linux/pci.h
===================================================================
@@ -55,6 +55,8 @@
 /* Include the ID list */
 #include <linux/pci_ids.h>
 
+#define KERN_PCI "<pci>"
+
 /* pci_slot represents a physical slot */
 struct pci_slot {
 	struct pci_bus *bus;		/* The bus this slot is on */
author
#3 lore raw

PATCH 3/7 pci: using printk(KERN_PCI v3

In reply to Yinghai Lu

v2: use printk(KERN_DEBUG KERN_PCI ...
v3: fix checkpatch error and warning

---
 drivers/pci/probe.c |   28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
drivers/pci/probe.c +17 -11
Index: linux-2.6/drivers/pci/probe.c
===================================================================
@@ -304,7 +304,8 @@ static int __pci_read_base(struct pci_de
 		} else {
 			res->start = l64;
 			res->end = l64 + sz64;
-			printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
+			printk(KERN_DEBUG KERN_PCI
+				 "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
 				 pci_name(dev), pos, res->start, res->end);
 		}
 	} else {
@@ -315,9 +316,10 @@ static int __pci_read_base(struct pci_de
 
 		res->start = l;
 		res->end = l + sz;
-		printk(KERN_DEBUG "PCI: %s reg %x %s: [%llx, %llx]\n", pci_name(dev),
-			 pos, (res->flags & IORESOURCE_IO) ? "io port":"32bit mmio",
-			 res->start, res->end);
+		printk(KERN_DEBUG KERN_PCI "PCI: %s reg %x %s: [%llx, %llx]\n",
+			pci_name(dev), pos,
+			(res->flags & IORESOURCE_IO) ? "io port" : "32bit mmio",
+			res->start, res->end);
 	}
 
  out:
@@ -388,8 +390,9 @@ void __devinit pci_read_bridge_bases(str
 			res->start = base;
 		if (!res->end)
 			res->end = limit + 0xfff;
-		printk(KERN_DEBUG "PCI: bridge %s io port: [%llx, %llx]\n",
-				 pci_name(dev), res->start, res->end);
+		printk(KERN_DEBUG KERN_PCI
+			 "PCI: bridge %s io port: [%llx, %llx]\n",
+			 pci_name(dev), res->start, res->end);
 	}
 
 	res = child->resource[1];
@@ -401,8 +404,9 @@ void __devinit pci_read_bridge_bases(str
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
 		res->start = base;
 		res->end = limit + 0xfffff;
-		printk(KERN_DEBUG "PCI: bridge %s 32bit mmio: [%llx, %llx]\n",
-				 pci_name(dev), res->start, res->end);
+		printk(KERN_DEBUG KERN_PCI
+			 "PCI: bridge %s 32bit mmio: [%llx, %llx]\n",
+			 pci_name(dev), res->start, res->end);
 	}
 
 	res = child->resource[2];
@@ -438,9 +442,11 @@ void __devinit pci_read_bridge_bases(str
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
 		res->start = base;
 		res->end = limit + 0xfffff;
-		printk(KERN_DEBUG "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n",
-				 pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",
-				 res->start, res->end);
+		printk(KERN_DEBUG KERN_PCI
+			 "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n",
+			 pci_name(dev),
+			 (res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32",
+			 res->start, res->end);
 	}
 }
 
author
#4 lore raw

PATCH 4/7 acpi: add KERN_ACPI v3

In reply to Yinghai Lu

use DEFINE_LOGLEVEL_SETUP to set loglevel for acpi
v2: use <acpi, "acpi:"> instead
v3: use KERN_ACPI

---
 drivers/acpi/osl.c   |    2 ++
 include/linux/acpi.h |    1 +
 2 files changed, 3 insertions(+)
drivers/acpi/osl.c +2 -0
Index: linux-2.6/drivers/acpi/osl.c
===================================================================
@@ -75,6 +75,8 @@ EXPORT_SYMBOL(acpi_in_debugger);
 extern char line_buf[80];
 #endif				/*ENABLE_DEBUGGER */
 
+DEFINE_LOGLEVEL_SETUP(acpi, KERN_ACPI, "acpi:");
+
 static unsigned int acpi_irq_irq;
 static acpi_osd_handler acpi_irq_handler;
 static void *acpi_irq_context;
include/linux/acpi.h +1 -0
Index: linux-2.6/include/linux/acpi.h
===================================================================
@@ -43,6 +43,7 @@
 #include <asm/acpi.h>
 #include <linux/dmi.h>
 
+#define KERN_ACPI "<acpi>"
 
 enum acpi_irq_model_id {
 	ACPI_IRQ_MODEL_PIC = 0,
author
#5 lore raw

PATCH 5/7 acpi: dump slit with printk(KERN_ACPI...)

In reply to Yinghai Lu
---
 drivers/acpi/numa.c |    9 +++++++++
 1 file changed, 9 insertions(+)
drivers/acpi/numa.c +9 -0
Index: linux-2.6/drivers/acpi/numa.c
===================================================================
@@ -150,6 +150,15 @@ static __init int slit_valid(struct acpi
 {
 	int i, j;
 	int d = slit->locality_count;
+	printk(KERN_DEBUG KERN_ACPI "ACPI: SLIT: nodes = %d\n", d);
+	for (i = 0; i < d; i++) {
+		printk(KERN_DEBUG KERN_ACPI "  ");
+		for (j = 0; j < d; j++)  {
+			u8 val = slit->entry[d*i + j];
+			printk(KERN_CONT KERN_ACPI " %d", val);
+		}
+		printk(KERN_CONT KERN_ACPI "\n");
+	}
 	for (i = 0; i < d; i++) {
 		for (j = 0; j < d; j++)  {
 			u8 val = slit->entry[d*i + j];
author
#6 lore raw

PATCH 6/7 x86: add KERN_APIC

In reply to Yinghai Lu

and kill apic_printk
using loglevel=apic:8 intead

v2: make it quiet = 10, verbose = 11, debug = 12
use get_tag_level to exit some print functions

---
 Documentation/kernel-parameters.txt         |    6 
 arch/x86/kernel/apic.c                      |  108 +++++-------
 arch/x86/kernel/io_apic.c                   |  241 +++++++++++++---------------
 arch/x86/kernel/mpparse.c                   |   10 -
 arch/x86/kernel/smpboot.c                   |   11 -
 include/asm-x86/apic.h                      |   24 +-
 include/asm-x86/es7000/wakecpu.h            |    6 
 include/asm-x86/mach-default/mach_wakecpu.h |    6 
 8 files changed, 188 insertions(+), 224 deletions(-)
Documentation/kernel-parameters.txt +0 -6
Index: linux-2.6/Documentation/kernel-parameters.txt
===================================================================
@@ -306,12 +306,6 @@ and is between 256 and 4096 characters.
 			not play well with APC CPU idle - disable it if you have
 			APC and your system crashes randomly.
 
-	apic=		[APIC,i386] Advanced Programmable Interrupt Controller
-			Change the output verbosity whilst booting
-			Format: { quiet (default) | verbose | debug }
-			Change the amount of debugging information output
-			when initialising the APIC and IO-APIC components.
-
 	apm=		[APM] Advanced Power Management
 			See header of arch/x86/kernel/apm_32.c.
 
arch/x86/kernel/apic.c +49 -59

368 lines not on this page · raw message

arch/x86/kernel/io_apic.c +117 -124

648 lines not on this page · raw message

arch/x86/kernel/mpparse.c +5 -5
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
@@ -83,7 +83,7 @@ static void __init MP_bus_info(struct mp
 	if (x86_quirks->mpc_oem_bus_info)
 		x86_quirks->mpc_oem_bus_info(m, str);
 	else
-		apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->mpc_busid, str);
+		printk(APIC_VERBOSE "Bus #%d is %s\n", m->mpc_busid, str);
 
 #if MAX_MP_BUSSES < 256
 	if (m->mpc_busid >= MAX_MP_BUSSES) {
@@ -154,7 +154,7 @@ static void __init MP_ioapic_info(struct
 
 static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
 {
-	apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
+	printk(APIC_VERBOSE "Int: type %d, pol %d, trig %d, bus %02x,"
 		" IRQ %02x, APIC ID %x, APIC INT %02x\n",
 		m->mpc_irqtype, m->mpc_irqflag & 3,
 		(m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
@@ -163,7 +163,7 @@ static void print_MP_intsrc_info(struct
 
 static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
 {
-	apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
+	printk(APIC_VERBOSE "Int: type %d, pol %d, trig %d, bus %02x,"
 		" IRQ %02x, APIC ID %x, APIC INT %02x\n",
 		mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3,
 		(mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus,
@@ -235,7 +235,7 @@ static void __init MP_intsrc_info(struct
 
 static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
 {
-	apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x,"
+	printk(APIC_VERBOSE "Lint: type %d, pol %d, trig %d, bus %02x,"
 		" IRQ %02x, APIC ID %x, APIC LINT %02x\n",
 		m->mpc_irqtype, m->mpc_irqflag & 3,
 		(m->mpc_irqflag >> 2) & 3, m->mpc_srcbusid,
@@ -697,7 +697,7 @@ static int __init smp_scan_config(unsign
 	unsigned int *bp = phys_to_virt(base);
 	struct intel_mp_floating *mpf;
 
-	apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
+	printk(APIC_VERBOSE "Scan SMP from %p for %ld bytes.\n",
 			bp, length);
 	BUILD_BUG_ON(sizeof(*mpf) != 16);
 
arch/x86/kernel/smpboot.c +6 -5
Index: linux-2.6/arch/x86/kernel/smpboot.c
===================================================================
@@ -542,17 +542,18 @@ static inline void __inquire_remote_apic
 	int timeout;
 	u32 status;
 
-	printk(KERN_INFO "Inquiring remote APIC 0x%x...\n", apicid);
+	printk(APIC_DEBUG "Inquiring remote APIC 0x%x...\n", apicid);
 
 	for (i = 0; i < ARRAY_SIZE(regs); i++) {
-		printk(KERN_INFO "... APIC 0x%x %s: ", apicid, names[i]);
+		printk(APIC_DEBUG "... APIC 0x%x %s: ",
+			 apicid, names[i]);
 
 		/*
 		 * Wait for idle.
 		 */
 		status = safe_apic_wait_icr_idle();
 		if (status)
-			printk(KERN_CONT
+			printk(KERN_CONT KERN_APIC
 			       "a previous APIC delivery may have failed\n");
 
 		apic_icr_write(APIC_DM_REMRD | regs[i], apicid);
@@ -566,10 +567,10 @@ static inline void __inquire_remote_apic
 		switch (status) {
 		case APIC_ICR_RR_VALID:
 			status = apic_read(APIC_RRR);
-			printk(KERN_CONT "%08x\n", status);
+			printk(KERN_CONT KERN_APIC "%08x\n", status);
 			break;
 		default:
-			printk(KERN_CONT "failed\n");
+			printk(KERN_CONT KERN_APIC "failed\n");
 		}
 	}
 }
include/asm-x86/apic.h +9 -15
Index: linux-2.6/include/asm-x86/apic.h
===================================================================
@@ -14,24 +14,18 @@
 
 #define ARCH_APICTIMER_STOPS_ON_C3	1
 
-/*
- * Debugging macros
- */
-#define APIC_QUIET   0
-#define APIC_VERBOSE 1
-#define APIC_DEBUG   2
+#define KERN_APIC "<apic>"
 
 /*
- * Define the default level of output to be very little
- * This can be turned up by using apic=verbose for more
- * information and apic=debug for _lots_ of information.
- * apic_verbosity is defined in apic.c
+ * Debugging macros
  */
-#define apic_printk(v, s, a...) do {       \
-		if ((v) <= apic_verbosity) \
-			printk(s, ##a);    \
-	} while (0)
-
+#define APIC_QUIET_LEVEL   10
+#define APIC_VERBOSE_LEVEL 11
+#define APIC_DEBUG_LEVEL   12
+
+#define APIC_QUIET   "<10>" KERN_APIC
+#define APIC_VERBOSE "<11>" KERN_APIC
+#define APIC_DEBUG   "<12>" KERN_APIC
 
 extern void generic_apic_probe(void);
 
include/asm-x86/es7000/wakecpu.h +1 -5
Index: linux-2.6/include/asm-x86/es7000/wakecpu.h
===================================================================
@@ -50,10 +50,6 @@ static inline void restore_NMI_vector(un
 {
 }
 
-#if APIC_DEBUG
- #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
-#else
- #define inquire_remote_apic(apicid) {}
-#endif
+#define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
 
 #endif /* __ASM_MACH_WAKECPU_H */
include/asm-x86/mach-default/mach_wakecpu.h +1 -5
Index: linux-2.6/include/asm-x86/mach-default/mach_wakecpu.h
===================================================================
@@ -33,10 +33,6 @@ static inline void restore_NMI_vector(un
 {
 }
 
-#if APIC_DEBUG
- #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
-#else
- #define inquire_remote_apic(apicid) {}
-#endif
+#define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
 
 #endif /* ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H */
author
#7 lore raw

PATCH 1/1 pci: using %pF in quirks.c

In reply to Yinghai Lu
---
 drivers/pci/quirks.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/quirks.c +1 -2
Index: linux-2.6/drivers/pci/quirks.c
===================================================================
@@ -1689,8 +1689,7 @@ static void pci_do_fixups(struct pci_dev
 		if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) &&
  		    (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) {
 #ifdef DEBUG
-			dev_dbg(&dev->dev, "calling ");
-			print_fn_descriptor_symbol("%s\n", f->hook);
+			dev_dbg(&dev->dev, "calling %pF\n", f->hook);
 #endif
 			f->hook(dev);
 		}
author
#8 lore raw

PATCH 7/7 pci: add KERN_PCI

In reply to Yinghai Lu

use DEFINE_LOGLEVEL_SETUP to set loglevel for dev

so could use loglevel=4,dev:8 it will only print out info with dev_printk

---
 drivers/base/core.c    |    2 ++
 include/linux/device.h |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/base/core.c +2 -0
Index: linux-2.6/drivers/base/core.c
===================================================================
@@ -26,6 +26,8 @@
 #include "base.h"
 #include "power/power.h"
 
+DEFINE_LOGLEVEL_SETUP(dev, KERN_DEV, "dev:");
+
 int (*platform_notify)(struct device *dev) = NULL;
 int (*platform_notify_remove)(struct device *dev) = NULL;
 static struct kobject *dev_kobj;
include/linux/device.h +5 -1
Index: linux-2.6/include/linux/device.h
===================================================================
@@ -518,10 +518,12 @@ extern void device_shutdown(void);
 /* drivers/base/sys.c */
 extern void sysdev_shutdown(void);
 
+#define KERN_DEV "<dev>"
+
 /* debugging and troubleshooting/diagnostic helpers. */
 extern const char *dev_driver_string(const struct device *dev);
 #define dev_printk(level, dev, format, arg...)	\
-	printk(level "%s %s: " format , dev_driver_string(dev) , \
+	printk(level KERN_DEV "%s %s: " format , dev_driver_string(dev) , \
 	       dev_name(dev) , ## arg)
 
 #define dev_emerg(dev, format, arg...)		\
@@ -538,6 +540,8 @@ extern const char *dev_driver_string(con
 	dev_printk(KERN_NOTICE , dev , format , ## arg)
 #define dev_info(dev, format, arg...)		\
 	dev_printk(KERN_INFO , dev , format , ## arg)
+#define dev_debug(dev, format, arg...)		\
+	dev_printk(KERN_DEBUG , dev , format , ## arg)
 
 #ifdef DEBUG
 #define dev_dbg(dev, format, arg...)		\