... instead of naked numbers. Stuff in sysrq.c used to set it to 8 which is supposed to mean above default level so set it to DEBUG instead as we're terminating/killing all tasks and we want to be verbose there. Also, correct the check in x86_64_start_kernel which should be >= as we're clearly issuing the string there for all debug levels, not only the magical 10.
Unified · Split
| @@ -172,7 +172,7 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) · 171 unmodified lines | ||
| 172 | 172 | */ |
| 173 | 173 | load_ucode_bsp(); |
| 174 | 174 | |
| 175 | − if (console_loglevel == 10) | |
| 175 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 176 | 176 | early_printk("Kernel alive\n"); |
| 177 | 177 | |
| 178 | 178 | clear_page(init_level4_pgt); |
| @@ -85,7 +85,7 @@ static cpumask_var_t uv_nmi_cpu_mask; · 84 unmodified lines | ||
| 85 | 85 | * Default is all stack dumps go to the console and buffer. |
| 86 | 86 | * Lower level to send to log buffer only. |
| 87 | 87 | */ |
| 88 | −static int uv_nmi_loglevel = 7; | |
| 88 | +static int uv_nmi_loglevel = CONSOLE_LOGLEVEL_DEFAULT; | |
| 89 | 89 | module_param_named(dump_loglevel, uv_nmi_loglevel, int, 0644); |
| 90 | 90 | |
| 91 | 91 | /* |
| @@ -473,7 +473,7 @@ static struct nubus_dev* __init · 472 unmodified lines | ||
| 473 | 473 | if (slot == 0 && (unsigned long)dir.base % 2) |
| 474 | 474 | dir.base += 1; |
| 475 | 475 | |
| 476 | − if (console_loglevel >= 10) | |
| 476 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 477 | 477 | printk(KERN_DEBUG "nubus_get_functional_resource: parent is 0x%p, dir is 0x%p\n", |
| 478 | 478 | parent->base, dir.base); |
| 479 | 479 | |
| @@ -568,7 +568,7 @@ static int __init nubus_get_vidnames(struct nubus_board* board, · 88 unmodified lines | ||
| 568 | 568 | |
| 569 | 569 | printk(KERN_INFO " video modes supported:\n"); |
| 570 | 570 | nubus_get_subdir(parent, &dir); |
| 571 | − if (console_loglevel >= 10) | |
| 571 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 572 | 572 | printk(KERN_DEBUG "nubus_get_vidnames: parent is 0x%p, dir is 0x%p\n", |
| 573 | 573 | parent->base, dir.base); |
| 574 | 574 | |
| @@ -629,7 +629,7 @@ static int __init nubus_get_vendorinfo(struct nubus_board* board, · 54 unmodified lines | ||
| 629 | 629 | |
| 630 | 630 | printk(KERN_INFO " vendor info:\n"); |
| 631 | 631 | nubus_get_subdir(parent, &dir); |
| 632 | − if (console_loglevel >= 10) | |
| 632 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 633 | 633 | printk(KERN_DEBUG "nubus_get_vendorinfo: parent is 0x%p, dir is 0x%p\n", |
| 634 | 634 | parent->base, dir.base); |
| 635 | 635 | |
| @@ -654,7 +654,7 @@ static int __init nubus_get_board_resource(struct nubus_board* board, int slot, · 18 unmodified lines | ||
| 654 | 654 | struct nubus_dirent ent; |
| 655 | 655 | |
| 656 | 656 | nubus_get_subdir(parent, &dir); |
| 657 | − if (console_loglevel >= 10) | |
| 657 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 658 | 658 | printk(KERN_DEBUG "nubus_get_board_resource: parent is 0x%p, dir is 0x%p\n", |
| 659 | 659 | parent->base, dir.base); |
| 660 | 660 | |
| @@ -753,19 +753,19 @@ static void __init nubus_find_rom_dir(struct nubus_board* board) · 92 unmodified lines | ||
| 753 | 753 | if (nubus_readdir(&dir, &ent) == -1) |
| 754 | 754 | goto badrom; |
| 755 | 755 | |
| 756 | − if (console_loglevel >= 10) | |
| 756 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 757 | 757 | printk(KERN_INFO "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 758 | 758 | /* This one takes us to where we want to go. */ |
| 759 | 759 | if (nubus_readdir(&dir, &ent) == -1) |
| 760 | 760 | goto badrom; |
| 761 | − if (console_loglevel >= 10) | |
| 761 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 762 | 762 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 763 | 763 | nubus_get_subdir(&ent, &dir); |
| 764 | 764 | |
| 765 | 765 | /* Resource ID 01, also an "Unknown Macintosh" */ |
| 766 | 766 | if (nubus_readdir(&dir, &ent) == -1) |
| 767 | 767 | goto badrom; |
| 768 | − if (console_loglevel >= 10) | |
| 768 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 769 | 769 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 770 | 770 | |
| 771 | 771 | /* FIXME: the first one is *not* always the right one. We |
| @@ -780,7 +780,7 @@ static void __init nubus_find_rom_dir(struct nubus_board* board) · 8 unmodified lines | ||
| 780 | 780 | path to that address... */ |
| 781 | 781 | if (nubus_readdir(&dir, &ent) == -1) |
| 782 | 782 | goto badrom; |
| 783 | − if (console_loglevel >= 10) | |
| 783 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) | |
| 784 | 784 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 785 | 785 | |
| 786 | 786 | /* Bwahahahaha... */ |
| @@ -816,7 +816,7 @@ static struct nubus_board* __init nubus_add_board(int slot, int bytelanes) · 29 unmodified lines | ||
| 816 | 816 | board->fblock = rp; |
| 817 | 817 | |
| 818 | 818 | /* Dump the format block for debugging purposes */ |
| 819 | − if (console_loglevel >= 10) { | |
| 819 | + if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) { | |
| 820 | 820 | int i; |
| 821 | 821 | printk(KERN_DEBUG "Slot %X, format block at 0x%p\n", |
| 822 | 822 | slot, rp); |
| @@ -88,7 +88,7 @@ static void sysrq_handle_loglevel(int key) · 87 unmodified lines | ||
| 88 | 88 | int i; |
| 89 | 89 | |
| 90 | 90 | i = key - '0'; |
| 91 | − console_loglevel = 7; | |
| 91 | + console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; | |
| 92 | 92 | printk("Loglevel set to %d\n", i); |
| 93 | 93 | console_loglevel = i; |
| 94 | 94 | } |
| @@ -343,7 +343,7 @@ static void send_sig_all(int sig) · 248 unmodified lines | ||
| 343 | 343 | static void sysrq_handle_term(int key) |
| 344 | 344 | { |
| 345 | 345 | send_sig_all(SIGTERM); |
| 346 | − console_loglevel = 8; | |
| 346 | + console_loglevel = CONSOLE_LOGLEVEL_DEBUG; | |
| 347 | 347 | } |
| 348 | 348 | static struct sysrq_key_op sysrq_term_op = { |
| 349 | 349 | .handler = sysrq_handle_term, |
| @@ -387,7 +387,7 @@ static struct sysrq_key_op sysrq_thaw_op = { · 37 unmodified lines | ||
| 387 | 387 | static void sysrq_handle_kill(int key) |
| 388 | 388 | { |
| 389 | 389 | send_sig_all(SIGKILL); |
| 390 | − console_loglevel = 8; | |
| 390 | + console_loglevel = CONSOLE_LOGLEVEL_DEBUG; | |
| 391 | 391 | } |
| 392 | 392 | static struct sysrq_key_op sysrq_kill_op = { |
| 393 | 393 | .handler = sysrq_handle_kill, |
| @@ -520,7 +520,7 @@ void __handle_sysrq(int key, bool check_mask) · 126 unmodified lines | ||
| 520 | 520 | * routing in the consumers of /proc/kmsg. |
| 521 | 521 | */ |
| 522 | 522 | orig_log_level = console_loglevel; |
| 523 | − console_loglevel = 7; | |
| 523 | + console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; | |
| 524 | 524 | printk(KERN_INFO "SysRq : "); |
| 525 | 525 | |
| 526 | 526 | op_p = __sysrq_get_key_op(key); |
| @@ -30,6 +30,17 @@ static inline const char *printk_skip_level(const char *buffer) · 29 unmodified lines | ||
| 30 | 30 | return buffer; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | +/* printk's without a loglevel use this.. */ | |
| 34 | +#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL | |
| 35 | + | |
| 36 | +/* We show everything that is MORE important than this.. */ | |
| 37 | +#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */ | |
| 38 | +#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ | |
| 39 | +#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */ | |
| 40 | +#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */ | |
| 41 | +#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ | |
| 42 | +#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ | |
| 43 | + | |
| 33 | 44 | extern int console_printk[]; |
| 34 | 45 | |
| 35 | 46 | #define console_loglevel (console_printk[0]) |
| @@ -39,13 +50,13 @@ extern int console_printk[]; · 3 unmodified lines | ||
| 39 | 50 | |
| 40 | 51 | static inline void console_silent(void) |
| 41 | 52 | { |
| 42 | − console_loglevel = 0; | |
| 53 | + console_loglevel = CONSOLE_LOGLEVEL_SILENT; | |
| 43 | 54 | } |
| 44 | 55 | |
| 45 | 56 | static inline void console_verbose(void) |
| 46 | 57 | { |
| 47 | 58 | if (console_loglevel) |
| 48 | − console_loglevel = 15; | |
| 59 | + console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | |
| 49 | 60 | } |
| 50 | 61 | |
| 51 | 62 | struct va_format { |
| @@ -203,13 +203,13 @@ EXPORT_SYMBOL(loops_per_jiffy); · 202 unmodified lines | ||
| 203 | 203 | |
| 204 | 204 | static int __init debug_kernel(char *str) |
| 205 | 205 | { |
| 206 | − console_loglevel = 10; | |
| 206 | + console_loglevel = CONSOLE_LOGLEVEL_DEBUG; | |
| 207 | 207 | return 0; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | static int __init quiet_kernel(char *str) |
| 211 | 211 | { |
| 212 | − console_loglevel = 4; | |
| 212 | + console_loglevel = CONSOLE_LOGLEVEL_QUIET; | |
| 213 | 213 | return 0; |
| 214 | 214 | } |
| 215 | 215 | |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | static void kdb_show_stack(struct task_struct *p, void *addr) |
| 22 | 22 | { |
| 23 | 23 | int old_lvl = console_loglevel; |
| 24 | − console_loglevel = 15; | |
| 24 | + console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | |
| 25 | 25 | kdb_trap_printk++; |
| 26 | 26 | kdb_set_current_task(p); |
| 27 | 27 | if (addr) { |
| @@ -710,7 +710,7 @@ kdb_printit: · 709 unmodified lines | ||
| 710 | 710 | } |
| 711 | 711 | if (logging) { |
| 712 | 712 | saved_loglevel = console_loglevel; |
| 713 | − console_loglevel = 0; | |
| 713 | + console_loglevel = CONSOLE_LOGLEVEL_SILENT; | |
| 714 | 714 | printk(KERN_INFO "%s", kdb_buffer); |
| 715 | 715 | } |
| 716 | 716 | |
| @@ -1091,7 +1091,7 @@ static int kdb_reboot(int argc, const char **argv) · 1090 unmodified lines | ||
| 1091 | 1091 | static void kdb_dumpregs(struct pt_regs *regs) |
| 1092 | 1092 | { |
| 1093 | 1093 | int old_lvl = console_loglevel; |
| 1094 | − console_loglevel = 15; | |
| 1094 | + console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | |
| 1095 | 1095 | kdb_trap_printk++; |
| 1096 | 1096 | show_regs(regs); |
| 1097 | 1097 | kdb_trap_printk--; |
| @@ -54,18 +54,11 @@ · 53 unmodified lines | ||
| 54 | 54 | #include "console_cmdline.h" |
| 55 | 55 | #include "braille.h" |
| 56 | 56 | |
| 57 | −/* printk's without a loglevel use this.. */ | |
| 58 | −#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL | |
| 59 | − | |
| 60 | −/* We show everything that is MORE important than this.. */ | |
| 61 | −#define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */ | |
| 62 | −#define DEFAULT_CONSOLE_LOGLEVEL 7 /* anything MORE serious than KERN_DEBUG */ | |
| 63 | − | |
| 64 | 57 | int console_printk[4] = { |
| 65 | − DEFAULT_CONSOLE_LOGLEVEL, /* console_loglevel */ | |
| 58 | + CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */ | |
| 66 | 59 | DEFAULT_MESSAGE_LOGLEVEL, /* default_message_loglevel */ |
| 67 | − MINIMUM_CONSOLE_LOGLEVEL, /* minimum_console_loglevel */ | |
| 68 | − DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ | |
| 60 | + CONSOLE_LOGLEVEL_MIN, /* minimum_console_loglevel */ | |
| 61 | + CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ | |
| 69 | 62 | }; |
| 70 | 63 | |
| 71 | 64 | /* Deferred messaged from sched code are marked by this special level */ |