public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] add ignore_loglevel boot option
@ 2006-12-05 12:09 Ingo Molnar
  2006-12-05 22:47 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-12-05 12:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Subject: [patch] add ignore_loglevel boot option
From: Ingo Molnar <mingo@elte.hu>

sometimes the kernel prints something interesting while userspace
bootup keeps messages turned off via loglevel. Enable the printing
of /all/ kernel messages via the "ignore_loglevel" boot option.
Off by default.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/kernel-parameters.txt |    4 ++++
 kernel/printk.c                     |   14 +++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -657,6 +657,10 @@ and is between 256 and 4096 characters. 
 	idle=		[HW]
 			Format: idle=poll or idle=halt
 
+	ignore_loglevel	[KNL]
+			Ignore loglevel setting - this will print /all/
+			kernel messages to the console. Useful for debugging.
+
 	ihash_entries=	[KNL]
 			Set number of hash buckets for inode cache.
 
Index: linux/kernel/printk.c
===================================================================
--- linux.orig/kernel/printk.c
+++ linux/kernel/printk.c
@@ -352,13 +352,25 @@ static void __call_console_drivers(unsig
 	touch_critical_timing();
 }
 
+static int __read_mostly ignore_loglevel;
+
+int __init ignore_loglevel_setup(char *str)
+{
+	ignore_loglevel = 1;
+	printk(KERN_INFO "debug: ignoring loglevel setting.\n");
+
+	return 1;
+}
+
+__setup("ignore_loglevel", ignore_loglevel_setup);
+
 /*
  * Write out chars from start to end - 1 inclusive
  */
 static void _call_console_drivers(unsigned long start,
 				unsigned long end, int msg_log_level)
 {
-	if (msg_log_level < console_loglevel &&
+	if ((msg_log_level < console_loglevel || ignore_loglevel) &&
 			console_drivers && start != end) {
 		if ((start & LOG_BUF_MASK) > (end & LOG_BUF_MASK)) {
 			/* wrapped write */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-06  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-05 12:09 [patch] add ignore_loglevel boot option Ingo Molnar
2006-12-05 22:47 ` Randy Dunlap
2006-12-06  9:00   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox