printk: add module parameter ignore_loglevel to control ignore_loglevel
authorYanmin Zhang <yanmin_zhang@linux.intel.com>
Tue, 1 Nov 2011 00:11:25 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2011 00:30:53 +0000 (17:30 -0700)
We are enabling some power features on medfield.  To test suspend-2-RAM
conveniently, we need turn on/off ignore_loglevel frequently without
rebooting.

Add a module parameter, so users can change it by:
/sys/module/printk/parameters/ignore_loglevel

Signed-off-by: Yanmin Zhang <yanmin.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/kernel-parameters.txt
kernel/printk.c

index 27e0488d54d2699bf3526d199523311e69e688ee..106efe1e2bab21b062757bdb0ea06d8fca306456 100644 (file)
@@ -973,6 +973,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.
index b7da18391c388d543ac0eaa7cd9fbf6a4c367520..e62f949ec14075fd11c0517c9f20514b8a4bc2d0 100644 (file)
@@ -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