printk: add Kconfig for default console loglevel
PATCH 1/1 printk: add Kconfig for default console loglevel
Keep the historical default of 7, but allow distributions and users to tune this value instead of requiring a kernel cmdline parameter.
--- kernel/printk.c | 4 +++- lib/Kconfig.debug | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletions(-)
kernel/printk.c +3 -1
@@ -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_LOGLEVELDECLARE_WAIT_QUEUE_HEAD (log_wait);
lib/Kconfig.debug +10 -0
@@ -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
Signature · 1 line
1.7.6
Quoted 2 lines · On Tue, 26 Jul 2011 11:33:51 -0400 Dave Reisner wrote:
Keep the historical default of 7, but allow distributions and users to tune this value instead of requiring a kernel cmdline parameter.
Hi,
Please explain how this is different from what is already in lib/Kconfig.debug:
config DEFAULT_MESSAGE_LOGLEVEL
int "Default message log level (1-7)"
range 1 7
default "4"
help
Default log level for printk statements with no specified priority.
Quoted 33 lines
Signed-off-by Dave Reisner <[email protected]>--- kernel/printk.c | 4 +++- lib/Kconfig.debug | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletions(-)kernel/printk.c +3
-1@@ -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_LOGLEVELDECLARE_WAIT_QUEUE_HEAD (log_wait);lib/Kconfig.debug +3
-0@@ -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
lib/Kconfig.debug config DEFAULT_MESSAGE_LOGLEVEL · line 36
Quoted 10 lines
lib/Kconfig.debug +7
-0+ 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
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 10 lines · Randy Dunlap
Quoted 2 lines · On Tue, 26 Jul 2011 11:33:51 -0400 Dave Reisner wrote:
Keep the historical default of 7, but allow distributions and users to tune this value instead of requiring a kernel cmdline parameter.
Please explain how this is different from what is already in
lib/Kconfig.debug:
configDEFAULT_MESSAGE_LOGLEVEL
int "Default message log level (1-7)"
range 1 7
default "4"
help
Default log level for printk statements with no specified priority.
DEFAULT_MESSAGE_LOGLEVEL sets a KERN_<level> for printks without a KERN_<level>.
Quoted 10 lines
lib/Kconfig.debug config DEFAULT_MESSAGE_LOGLEVEL · line 33
Quoted 10 lines
lib/Kconfig.debug +10
-0+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. +
This allows 'unimportant' messages to not be shown by default.
I think there are lots of KERN_INFO messages that are miscategorized. This change might cause some shifting of KERN_<level>s in the future, so it's OK by me.
Quoted 15 lines · On Tue, 26 Jul 2011 10:01:45 -0700 Joe Perches wrote:
Quoted 10 lines · Randy Dunlap
Quoted 2 lines · On Tue, 26 Jul 2011 11:33:51 -0400 Dave Reisner wrote:
Keep the historical default of 7, but allow distributions and users to tune this value instead of requiring a kernel cmdline parameter.
Please explain how this is different from what is already in
lib/Kconfig.debug:
configDEFAULT_MESSAGE_LOGLEVEL
int "Default message log level (1-7)"
range 1 7
default "4"
help
Default log level for printk statements with no specified priority.
DEFAULT_MESSAGE_LOGLEVELsets a KERN_<level> for printks without a KERN_<level>.
Quoted 12 lines
Quoted 10 lines
lib/Kconfig.debug config DEFAULT_MESSAGE_LOGLEVEL · line 33
Quoted 10 lines
lib/Kconfig.debug +10
-0+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. +This allows 'unimportant' messages to not be shown by default.
Thanks. Maybe Kconfig help text could be clearer.
Quoted 3 lines
I think there are lots of
KERN_INFOmessages that are miscategorized. This change might cause some shifting of KERN_<level>s in the future, so it's OK by me.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 28 lines · Joe Perches
Quoted 10 lines · Randy Dunlap
Quoted 2 lines · On Tue, 26 Jul 2011 11:33:51 -0400 Dave Reisner wrote:
Keep the historical default of 7, but allow distributions and users to tune this value instead of requiring a kernel cmdline parameter.
Please explain how this is different from what is already in
lib/Kconfig.debug:
configDEFAULT_MESSAGE_LOGLEVEL
int "Default message log level (1-7)"
range 1 7
default "4"
help
Default log level for printk statements with no specified priority.
DEFAULT_MESSAGE_LOGLEVELsets a KERN_<level> for printks without a KERN_<level>.Quoted 10 lines
lib/Kconfig.debug config DEFAULT_MESSAGE_LOGLEVEL · line 33
Quoted 10 lines
lib/Kconfig.debug +10
-0+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. +This allows 'unimportant' messages to not be shown by default.
Quoted 4 lines
I think there are lots of
KERN_INFOmessages that are miscategorized. This change might cause some shifting of KERN_<level>s in the future, so it's OK by me.
Joe,
Did you want me to resubmit with your addition? Do I need to cc anyone else to move this along to Linus's integration branch? Apologies, my familiarity with the merge process for the kernel stops at the documentation in the git repo.
dave