Skip to contentSkip to conversation

printk: add ignore_loglevel as module parameter.

PATCH New Yanmin Zhang 1 participant 1 message Aug 23, 2011 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 printk: add ignore_loglevel as module parameter.

We are enabling some power features on medfield. To test suspend-2-RAM conveniently, we need turn on/off ignore_loglevel frequently without rebooting.

Below patch adds a module parameter, so users could change it by:
/sys/module/printk/parameters/ignore_loglevel

Thanks Andrew and Young. I added document info and module param desc.

---
 Documentation/kernel-parameters.txt |    3 +++
 kernel/printk.c                     |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
Documentation/kernel-parameters.txt +3 -0
index 74446e0..8cf3431 100644
@@ -954,6 +954,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	ignore_loglevel	[KNL]
 			Ignore loglevel setting - this will print /all/
 			kernel messages to the console. Useful for debugging.
+			We also add it as printk module parameter, so users
+			could change it dynamically, usually by
+			/sys/module/printk/parameters/ignore_loglevel.
 
 	ihash_entries=	[KNL]
 			Set number of hash buckets for inode cache.
kernel/printk.c +3 -0
index b9ef93a..a6936a9 100644
@@ -532,6 +532,9 @@ static int __init ignore_loglevel_setup(char *str)
 }
 
 early_param("ignore_loglevel", ignore_loglevel_setup);
+module_param_named(ignore_loglevel, ignore_loglevel, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to"
+	"print all kernel messages to the console.");
 
 /*
  * Write out chars from start to end - 1 inclusive
Signature · 1 line
1.7.1