Linux kernel log switch
1, let Pr_debug can output
---a/kernel/printk/printk.c
+++ B/KERNEL/PRINTK/PRINTK.C
@@ -59,7 +59,7 @@
/* We show everything which is moreimportant than this.. */
#define MINIMUM_CONSOLE_LOGLEVEL 1/*minimum loglevel We have people use * *
-#define DEFAULT_CONSOLE_LOGLEVEL 7/*anything more serious than kern_debug * *
+ #define DEFAULT_CONSOLE_LOGLEVEL 8/*anything more serious than kern_debug * *
int console_printk[4] = {
Default_console_loglevel, * console_loglevel * *
2, let the module inside the code can output
---a/drivers/of/makefile
+++ B/drivers/of/makefile
Extra_cflags + +-ddebug
3, let each file output
---a/drivers/of/makefile
+++ B/drivers/of/makefile
Add define DEBUG before file include
or makefile inside.
Pr_debug ()
Some files Call Pr_debug (), which are ordinarily an empty macro-discards its
arguments at compile t IME. To enable debugging output, builds the
appropriate file with-ddebug by adding
cflags_[filename].o: =-ddebug
t o the makefile.
For example, to the all attempts to spawn a usermode helper (such
as/sbin/hotplug), add to lib/makefile the line:
CFLAGS_KOBJECT_UEVENT.O: =-ddebug
Then boot The new kernel, do something this spawns a usermode helper, and
use The "DMESG" command to view the Pr_debug () output.
4. Kernel Print Control
D,lx,ld,,lu, these are all 32-bit output.
Hd,hx,hu, these are all output 16-bit data,
Hhd,hhx,hhu, these are all output 8 bits,
LLD,LL,LLU,LLX, these are all output 64 bits,