aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/head64.c2
-rw-r--r--arch/x86/platform/uv/uv_nmi.c2
-rw-r--r--drivers/nubus/nubus.c18
-rw-r--r--drivers/tty/sysrq.c8
-rw-r--r--include/linux/printk.h15
-rw-r--r--init/main.c4
-rw-r--r--kernel/debug/kdb/kdb_bt.c2
-rw-r--r--kernel/debug/kdb/kdb_io.c2
-rw-r--r--kernel/debug/kdb/kdb_main.c2
-rw-r--r--kernel/printk/printk.c13
10 files changed, 36 insertions, 32 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 068054f4bf20..eda1a865641e 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -172,7 +172,7 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
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);
diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
index be27da60dc8f..c89c93320c12 100644
--- a/arch/x86/platform/uv/uv_nmi.c
+++ b/arch/x86/platform/uv/uv_nmi.c
@@ -85,7 +85,7 @@ static cpumask_var_t uv_nmi_cpu_mask;
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 */
88static int uv_nmi_loglevel = 7; 88static int uv_nmi_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
89module_param_named(dump_loglevel, uv_nmi_loglevel, int, 0644); 89module_param_named(dump_loglevel, uv_nmi_loglevel, int, 0644);
90 90
91/* 91/*
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 43926cd25ae8..5066a7ef7b6c 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -473,7 +473,7 @@ static struct nubus_dev* __init
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,
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,
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,
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)
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)
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)
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);
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index ce396ecdf412..b767a64e49d9 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -88,7 +88,7 @@ static void sysrq_handle_loglevel(int key)
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)
343static void sysrq_handle_term(int key) 343static 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}
348static struct sysrq_key_op sysrq_term_op = { 348static 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 = {
387static void sysrq_handle_kill(int key) 387static 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}
392static struct sysrq_key_op sysrq_kill_op = { 392static 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)
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);
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 37f3a6589c1c..319ff7e53efb 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -30,6 +30,17 @@ static inline const char *printk_skip_level(const char *buffer)
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
33extern int console_printk[]; 44extern 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[];
39 50
40static inline void console_silent(void) 51static inline void console_silent(void)
41{ 52{
42 console_loglevel = 0; 53 console_loglevel = CONSOLE_LOGLEVEL_SILENT;
43} 54}
44 55
45static inline void console_verbose(void) 56static 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
51struct va_format { 62struct va_format {
diff --git a/init/main.c b/init/main.c
index e08c0b2065a1..04fab8d74c89 100644
--- a/init/main.c
+++ b/init/main.c
@@ -203,13 +203,13 @@ EXPORT_SYMBOL(loops_per_jiffy);
203 203
204static int __init debug_kernel(char *str) 204static 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
210static int __init quiet_kernel(char *str) 210static 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
diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c
index b03e0e814e43..fe15fff5df53 100644
--- a/kernel/debug/kdb/kdb_bt.c
+++ b/kernel/debug/kdb/kdb_bt.c
@@ -21,7 +21,7 @@
21static void kdb_show_stack(struct task_struct *p, void *addr) 21static 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) {
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index 14ff4849262c..7c70812caea5 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -710,7 +710,7 @@ kdb_printit:
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
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 0b097c8a1e50..2f7c760305ca 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1091,7 +1091,7 @@ static int kdb_reboot(int argc, const char **argv)
1091static void kdb_dumpregs(struct pt_regs *regs) 1091static 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--;
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 923c5d4e4202..ea2d5f6962ed 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -54,18 +54,11 @@
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
64int console_printk[4] = { 57int 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 */