... 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 | load_ucode_bsp(); | 173 | load_ucode_bsp(); |
| 174 | 174 | ||
| 175 | if (console_loglevel == 10) | 175 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 176 | early_printk("Kernel alive\n"); | 176 | early_printk("Kernel alive\n"); |
| 177 | 177 | ||
| 178 | clear_page(init_level4_pgt); | 178 | clear_page(init_level4_pgt); |
| @@ -85,7 +85,7 @@ static cpumask_var_t uv_nmi_cpu_mask; · 84 unmodified lines | |||
| 85 | * Default is all stack dumps go to the console and buffer. | 85 | * Default is all stack dumps go to the console and buffer. |
| 86 | * Lower level to send to log buffer only. | 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 | module_param_named(dump_loglevel, uv_nmi_loglevel, int, 0644); | 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 | if (slot == 0 && (unsigned long)dir.base % 2) | 473 | if (slot == 0 && (unsigned long)dir.base % 2) |
| 474 | dir.base += 1; | 474 | dir.base += 1; |
| 475 | 475 | ||
| 476 | if (console_loglevel >= 10) | 476 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 477 | printk(KERN_DEBUG "nubus_get_functional_resource: parent is 0x%p, dir is 0x%p\n", | 477 | printk(KERN_DEBUG "nubus_get_functional_resource: parent is 0x%p, dir is 0x%p\n", |
| 478 | parent->base, dir.base); | 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 | printk(KERN_INFO " video modes supported:\n"); | 569 | printk(KERN_INFO " video modes supported:\n"); |
| 570 | nubus_get_subdir(parent, &dir); | 570 | nubus_get_subdir(parent, &dir); |
| 571 | if (console_loglevel >= 10) | 571 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 572 | printk(KERN_DEBUG "nubus_get_vidnames: parent is 0x%p, dir is 0x%p\n", | 572 | printk(KERN_DEBUG "nubus_get_vidnames: parent is 0x%p, dir is 0x%p\n", |
| 573 | parent->base, dir.base); | 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 | printk(KERN_INFO " vendor info:\n"); | 630 | printk(KERN_INFO " vendor info:\n"); |
| 631 | nubus_get_subdir(parent, &dir); | 631 | nubus_get_subdir(parent, &dir); |
| 632 | if (console_loglevel >= 10) | 632 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 633 | printk(KERN_DEBUG "nubus_get_vendorinfo: parent is 0x%p, dir is 0x%p\n", | 633 | printk(KERN_DEBUG "nubus_get_vendorinfo: parent is 0x%p, dir is 0x%p\n", |
| 634 | parent->base, dir.base); | 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 | struct nubus_dirent ent; | 654 | struct nubus_dirent ent; |
| 655 | 655 | ||
| 656 | nubus_get_subdir(parent, &dir); | 656 | nubus_get_subdir(parent, &dir); |
| 657 | if (console_loglevel >= 10) | 657 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 658 | printk(KERN_DEBUG "nubus_get_board_resource: parent is 0x%p, dir is 0x%p\n", | 658 | printk(KERN_DEBUG "nubus_get_board_resource: parent is 0x%p, dir is 0x%p\n", |
| 659 | parent->base, dir.base); | 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 | if (nubus_readdir(&dir, &ent) == -1) | 753 | if (nubus_readdir(&dir, &ent) == -1) |
| 754 | goto badrom; | 754 | goto badrom; |
| 755 | 755 | ||
| 756 | if (console_loglevel >= 10) | 756 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 757 | printk(KERN_INFO "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); | 757 | printk(KERN_INFO "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 758 | /* This one takes us to where we want to go. */ | 758 | /* This one takes us to where we want to go. */ |
| 759 | if (nubus_readdir(&dir, &ent) == -1) | 759 | if (nubus_readdir(&dir, &ent) == -1) |
| 760 | goto badrom; | 760 | goto badrom; |
| 761 | if (console_loglevel >= 10) | 761 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 762 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); | 762 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 763 | nubus_get_subdir(&ent, &dir); | 763 | nubus_get_subdir(&ent, &dir); |
| 764 | 764 | ||
| 765 | /* Resource ID 01, also an "Unknown Macintosh" */ | 765 | /* Resource ID 01, also an "Unknown Macintosh" */ |
| 766 | if (nubus_readdir(&dir, &ent) == -1) | 766 | if (nubus_readdir(&dir, &ent) == -1) |
| 767 | goto badrom; | 767 | goto badrom; |
| 768 | if (console_loglevel >= 10) | 768 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 769 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); | 769 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 770 | 770 | ||
| 771 | /* FIXME: the first one is *not* always the right one. We | 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 | path to that address... */ | 780 | path to that address... */ |
| 781 | if (nubus_readdir(&dir, &ent) == -1) | 781 | if (nubus_readdir(&dir, &ent) == -1) |
| 782 | goto badrom; | 782 | goto badrom; |
| 783 | if (console_loglevel >= 10) | 783 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) |
| 784 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); | 784 | printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); |
| 785 | 785 | ||
| 786 | /* Bwahahahaha... */ | 786 | /* Bwahahahaha... */ |
| @@ -816,7 +816,7 @@ static struct nubus_board* __init nubus_add_board(int slot, int bytelanes) · 29 unmodified lines | |||
| 816 | board->fblock = rp; | 816 | board->fblock = rp; |
| 817 | 817 | ||
| 818 | /* Dump the format block for debugging purposes */ | 818 | /* Dump the format block for debugging purposes */ |
| 819 | if (console_loglevel >= 10) { | 819 | if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) { |
| 820 | int i; | 820 | int i; |
| 821 | printk(KERN_DEBUG "Slot %X, format block at 0x%p\n", | 821 | printk(KERN_DEBUG "Slot %X, format block at 0x%p\n", |
| 822 | slot, rp); | 822 | slot, rp); |
| @@ -88,7 +88,7 @@ static void sysrq_handle_loglevel(int key) · 87 unmodified lines | |||
| 88 | int i; | 88 | int i; |
| 89 | 89 | ||
| 90 | i = key - '0'; | 90 | i = key - '0'; |
| 91 | console_loglevel = 7; | 91 | console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; |
| 92 | printk("Loglevel set to %d\n", i); | 92 | printk("Loglevel set to %d\n", i); |
| 93 | console_loglevel = i; | 93 | console_loglevel = i; |
| 94 | } | 94 | } |
| @@ -343,7 +343,7 @@ static void send_sig_all(int sig) · 248 unmodified lines | |||
| 343 | static void sysrq_handle_term(int key) | 343 | static void sysrq_handle_term(int key) |
| 344 | { | 344 | { |
| 345 | send_sig_all(SIGTERM); | 345 | send_sig_all(SIGTERM); |
| 346 | console_loglevel = 8; | 346 | console_loglevel = CONSOLE_LOGLEVEL_DEBUG; |
| 347 | } | 347 | } |
| 348 | static struct sysrq_key_op sysrq_term_op = { | 348 | static struct sysrq_key_op sysrq_term_op = { |
| 349 | .handler = sysrq_handle_term, | 349 | .handler = sysrq_handle_term, |
| @@ -387,7 +387,7 @@ static struct sysrq_key_op sysrq_thaw_op = { · 37 unmodified lines | |||
| 387 | static void sysrq_handle_kill(int key) | 387 | static void sysrq_handle_kill(int key) |
| 388 | { | 388 | { |
| 389 | send_sig_all(SIGKILL); | 389 | send_sig_all(SIGKILL); |
| 390 | console_loglevel = 8; | 390 | console_loglevel = CONSOLE_LOGLEVEL_DEBUG; |
| 391 | } | 391 | } |
| 392 | static struct sysrq_key_op sysrq_kill_op = { | 392 | static struct sysrq_key_op sysrq_kill_op = { |
| 393 | .handler = sysrq_handle_kill, | 393 | .handler = sysrq_handle_kill, |
| @@ -520,7 +520,7 @@ void __handle_sysrq(int key, bool check_mask) · 126 unmodified lines | |||
| 520 | * routing in the consumers of /proc/kmsg. | 520 | * routing in the consumers of /proc/kmsg. |
| 521 | */ | 521 | */ |
| 522 | orig_log_level = console_loglevel; | 522 | orig_log_level = console_loglevel; |
| 523 | console_loglevel = 7; | 523 | console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; |
| 524 | printk(KERN_INFO "SysRq : "); | 524 | printk(KERN_INFO "SysRq : "); |
| 525 | 525 | ||
| 526 | op_p = __sysrq_get_key_op(key); | 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 | return buffer; | 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 | extern int console_printk[]; | 44 | extern int console_printk[]; |
| 34 | 45 | ||
| 35 | #define console_loglevel (console_printk[0]) | 46 | #define console_loglevel (console_printk[0]) |
| @@ -39,13 +50,13 @@ extern int console_printk[]; · 3 unmodified lines | |||
| 39 | 50 | ||
| 40 | static inline void console_silent(void) | 51 | static inline void console_silent(void) |
| 41 | { | 52 | { |
| 42 | console_loglevel = 0; | 53 | console_loglevel = CONSOLE_LOGLEVEL_SILENT; |
| 43 | } | 54 | } |
| 44 | 55 | ||
| 45 | static inline void console_verbose(void) | 56 | static inline void console_verbose(void) |
| 46 | { | 57 | { |
| 47 | if (console_loglevel) | 58 | if (console_loglevel) |
| 48 | console_loglevel = 15; | 59 | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; |
| 49 | } | 60 | } |
| 50 | 61 | ||
| 51 | struct va_format { | 62 | struct va_format { |
| @@ -203,13 +203,13 @@ EXPORT_SYMBOL(loops_per_jiffy); · 202 unmodified lines | |||
| 203 | 203 | ||
| 204 | static int __init debug_kernel(char *str) | 204 | static int __init debug_kernel(char *str) |
| 205 | { | 205 | { |
| 206 | console_loglevel = 10; | 206 | console_loglevel = CONSOLE_LOGLEVEL_DEBUG; |
| 207 | return 0; | 207 | return 0; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | static int __init quiet_kernel(char *str) | 210 | static int __init quiet_kernel(char *str) |
| 211 | { | 211 | { |
| 212 | console_loglevel = 4; | 212 | console_loglevel = CONSOLE_LOGLEVEL_QUIET; |
| 213 | return 0; | 213 | return 0; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | static void kdb_show_stack(struct task_struct *p, void *addr) | 21 | static void kdb_show_stack(struct task_struct *p, void *addr) |
| 22 | { | 22 | { |
| 23 | int old_lvl = console_loglevel; | 23 | int old_lvl = console_loglevel; |
| 24 | console_loglevel = 15; | 24 | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; |
| 25 | kdb_trap_printk++; | 25 | kdb_trap_printk++; |
| 26 | kdb_set_current_task(p); | 26 | kdb_set_current_task(p); |
| 27 | if (addr) { | 27 | if (addr) { |
| @@ -710,7 +710,7 @@ kdb_printit: · 709 unmodified lines | |||
| 710 | } | 710 | } |
| 711 | if (logging) { | 711 | if (logging) { |
| 712 | saved_loglevel = console_loglevel; | 712 | saved_loglevel = console_loglevel; |
| 713 | console_loglevel = 0; | 713 | console_loglevel = CONSOLE_LOGLEVEL_SILENT; |
| 714 | printk(KERN_INFO "%s", kdb_buffer); | 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 | static void kdb_dumpregs(struct pt_regs *regs) | 1091 | static void kdb_dumpregs(struct pt_regs *regs) |
| 1092 | { | 1092 | { |
| 1093 | int old_lvl = console_loglevel; | 1093 | int old_lvl = console_loglevel; |
| 1094 | console_loglevel = 15; | 1094 | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; |
| 1095 | kdb_trap_printk++; | 1095 | kdb_trap_printk++; |
| 1096 | show_regs(regs); | 1096 | show_regs(regs); |
| 1097 | kdb_trap_printk--; | 1097 | kdb_trap_printk--; |
| @@ -54,18 +54,11 @@ · 53 unmodified lines | |||
| 54 | #include "console_cmdline.h" | 54 | #include "console_cmdline.h" |
| 55 | #include "braille.h" | 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 | int console_printk[4] = { | 57 | int console_printk[4] = { |
| 65 | DEFAULT_CONSOLE_LOGLEVEL, /* console_loglevel */ | 58 | CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */ |
| 66 | DEFAULT_MESSAGE_LOGLEVEL, /* default_message_loglevel */ | 59 | DEFAULT_MESSAGE_LOGLEVEL, /* default_message_loglevel */ |
| 67 | MINIMUM_CONSOLE_LOGLEVEL, /* minimum_console_loglevel */ | 60 | CONSOLE_LOGLEVEL_MIN, /* minimum_console_loglevel */ |
| 68 | DEFAULT_CONSOLE_LOGLEVEL, /* default_console_loglevel */ | 61 | CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ |
| 69 | }; | 62 | }; |
| 70 | 63 | ||
| 71 | /* Deferred messaged from sched code are marked by this special level */ | 64 | /* Deferred messaged from sched code are marked by this special level */ |