mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Reisner <d@falconindy.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Dave Reisner <dreisner@archlinux.org>
Subject: [PATCH] printk: add Kconfig for default console loglevel
Date: Tue, 26 Jul 2011 11:33:51 -0400	[thread overview]
Message-ID: <1311694431-17037-1-git-send-email-dreisner@archlinux.org> (raw)

Keep the historical default of 7, but allow distributions and users to
tune this value instead of requiring a kernel cmdline parameter.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 kernel/printk.c   |    4 +++-
 lib/Kconfig.debug |   10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 37dff34..fabc216 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -58,7 +58,9 @@ void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
 
 /* We show everything that is MORE important than this.. */
 #define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
-#define DEFAULT_CONSOLE_LOGLEVEL 7 /* anything MORE serious than KERN_DEBUG */
+
+/* default to 7 -- anything MORE serious than KERN_DEBUG */
+#define DEFAULT_CONSOLE_LOGLEVEL CONFIG_DEFAULT_CONSOLE_LOGLEVEL
 
 DECLARE_WAIT_QUEUE_HEAD(log_wait);
 
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index c0cb9c4..6caa66e 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -21,6 +21,16 @@ config DEFAULT_MESSAGE_LOGLEVEL
 	  that are auditing their logs closely may want to set it to a lower
 	  priority.
 
+config DEFAULT_CONSOLE_LOGLEVEL
+	int "Default console log level (1-7)"
+	range 1 7
+	default "7"
+	help
+	  Default console log level setting for printk statements.
+
+	  This was hard-coded to KERN_INFO (7) since at least 2.6.12. You may
+	  wish to turn this down to 4 for a quieter console.
+
 config ENABLE_WARN_DEPRECATED
 	bool "Enable __deprecated logic"
 	default y
-- 
1.7.6


             reply	other threads:[~2011-07-26 15:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 15:33 Dave Reisner [this message]
2011-07-26 16:37 ` Randy Dunlap
2011-07-26 17:01   ` Joe Perches
2011-07-26 17:16     ` Randy Dunlap
2011-07-29 12:58     ` Dave Reisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311694431-17037-1-git-send-email-dreisner@archlinux.org \
    --to=d@falconindy.com \
    --cc=akpm@linux-foundation.org \
    --cc=dreisner@archlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome