Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| console_loglevel [2018/11/23 13:40] – [Kernel source files] rpjday | console_loglevel [2018/11/23 15:33] (current) – [Overview] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | How to mess with '' | + | Properties of console |
| ===== Files ===== | ===== Files ===== | ||
| Line 27: | Line 27: | ||
| * / | * / | ||
| * / | * / | ||
| + | |||
| + | ===== Kernel parameters ===== | ||
| + | |||
| + | < | ||
| + | loglevel= | ||
| + | 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) | ||
| + | 1 (KERN_ALERT) | ||
| + | 2 (KERN_CRIT) | ||
| + | 3 (KERN_ERR) | ||
| + | 4 (KERN_WARNING) | ||
| + | 5 (KERN_NOTICE) | ||
| + | 6 (KERN_INFO) | ||
| + | 7 (KERN_DEBUG) | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | 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, | ||
| + | / | ||
| + | </ | ||
| ===== Kernel source files ===== | ===== Kernel source files ===== | ||
| + | |||
| + | ==== kernel/ | ||
| + | |||
| + | < | ||
| + | int console_printk[4] = { | ||
| + | CONSOLE_LOGLEVEL_DEFAULT, | ||
| + | MESSAGE_LOGLEVEL_DEFAULT, | ||
| + | CONSOLE_LOGLEVEL_MIN, | ||
| + | CONSOLE_LOGLEVEL_DEFAULT, | ||
| + | }; | ||
| + | </ | ||
| ==== include/ | ==== include/ | ||
| Line 38: | Line 76: | ||
| /* We show everything that is MORE important than this.. */ | /* We show everything that is MORE important than this.. */ | ||
| #define CONSOLE_LOGLEVEL_SILENT | #define CONSOLE_LOGLEVEL_SILENT | ||
| - | #define CONSOLE_LOGLEVEL_MIN | + | #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ |
| - | #define CONSOLE_LOGLEVEL_DEBUG | + | #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ |
| - | #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ | + | #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ |
| /* | /* | ||
| Line 47: | Line 85: | ||
| */ | */ | ||
| #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT | #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT | ||
| - | #define CONSOLE_LOGLEVEL_QUIET | + | #define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET |
| extern int console_printk[]; | extern int console_printk[]; | ||
| Line 58: | Line 96: | ||
| static inline void console_silent(void) | static inline void console_silent(void) | ||
| { | { | ||
| - | | + | console_loglevel = CONSOLE_LOGLEVEL_SILENT; |
| } | } | ||
| static inline void console_verbose(void) | static inline void console_verbose(void) | ||
| { | { | ||
| - | | + | if (console_loglevel) |
| - | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | + | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; |
| } | } | ||
| - | |||
| </ | </ | ||
| ==== lib/ | ==== lib/ | ||