[OPW,kernel,v3,1/4] init: Added a Kconfig symbol to define printk log priority.
diff mbox

Message ID 096c4cba47164b4e753511873fac1f464bdc4e22.1414653432.git.kumari.radha3@gmail.com
State New, archived
Headers show

Commit Message

Kumari Radha Oct. 30, 2014, 7:54 a.m. UTC
This patch adds a Kconfig symbol to define printk log priority
which compiles out all printk messages below a certain priority level.
Messages compiled out with this option cannot be enabled at runtime.

Signed-off-by: Kumari Radha <kumari.radha3@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
Changes in v3:
    - changed the Kconfig symbol so that it's always defined.

init/Kconfig |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch
diff mbox

diff --git a/init/Kconfig b/init/Kconfig
index 3ee28ae..dfc1335 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1431,6 +1431,21 @@  config PRINTK
 	  very difficult to diagnose system problems, saying N here is
 	  strongly discouraged.
 
+config PRINTK_LOG_PRIORITY
+	int "Kernel printk loglevel priority" if EXPERT && PRINTK
+	range 0 7
+	default 7
+	help
+	  Set this option to a printk priority level from 0-7, to compile
+	  out all printk messages with lower priority (numerically higher)
+	  than the given priority level, saving space in the compiled kernel.
+	  Smaller values have higher priorities. For instance, set this to 3
+	  to compile out all messages with lower priority than KERN_ERR.
+
+	  Messages compiled out with this option cannot be enabled at runtime.
+	  To disable the printk subsystem entirely, along with all printk
+	  message, turn off CONFIG_PRINTK.
+
 config BUG
 	bool "BUG() support" if EXPERT
 	default y