Linux Kernel log Switch __linux

Source: Internet
Author: User

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,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.