console_loglevel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
console_loglevel [2018/11/23 14:32] – [include/linux/printk.h] rpjdayconsole_loglevel [2018/11/23 15:33] (current) – [Overview] rpjday
Line 1: Line 1:
 ===== Overview ===== ===== Overview =====
  
-Properties of console loglevel.+Properties of console loglevel, and how to use it.
  
 ===== Files ===== ===== Files =====
Line 27: Line 27:
   * /sys/module/printk/parameters   * /sys/module/printk/parameters
   * /proc/sys/kernel/printk/*   * /proc/sys/kernel/printk/*
 +
 +===== Kernel parameters =====
 +
 +<code>
 +loglevel=       All Kernel Messages with a loglevel smaller than the
 +                console loglevel will be printed to the console. It can
 +                also be changed with klogd or other programs. The
 +                loglevels are defined as follows:
 +
 +                0 (KERN_EMERG)          system is unusable
 +                1 (KERN_ALERT)          action must be taken immediately
 +                2 (KERN_CRIT)           critical conditions
 +                3 (KERN_ERR)            error conditions
 +                4 (KERN_WARNING)        warning conditions
 +                5 (KERN_NOTICE)         normal but significant condition
 +                6 (KERN_INFO)           informational
 +                7 (KERN_DEBUG)          debug-level messages
 +</code>
 +
 +<code>
 +ignore_loglevel [KNL]
 +                Ignore loglevel setting - this will print /all/
 +                kernel messages to the console. Useful for debugging.
 +                We also add it as printk module parameter, so users
 +                could change it dynamically, usually by
 +                /sys/module/printk/parameters/ignore_loglevel.
 +</code>
  
 ===== Kernel source files ===== ===== Kernel source files =====
 +
 +==== kernel/printk/printk.c ====
 +
 +<code>
 +int console_printk[4] = {
 + CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */
 + MESSAGE_LOGLEVEL_DEFAULT, /* default_message_loglevel */
 + CONSOLE_LOGLEVEL_MIN, /* minimum_console_loglevel */
 + CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */
 +};
 +</code>
  
 ==== include/linux/printk.h ==== ==== include/linux/printk.h ====
  • console_loglevel.1542983540.txt.gz
  • Last modified: 2018/11/23 14:32
  • by rpjday