]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
printk: add CON_ALLDATA console flag
authorJoern Engel <joern@logfs.org>
Wed, 20 Feb 2013 19:38:59 +0000 (11:38 -0800)
committerJoern Engel <joern@logfs.org>
Wed, 20 Feb 2013 19:38:59 +0000 (11:38 -0800)
For consoles like netconsole and blockconsole the loglevel filtering
really doesn't make any sense.  If a line gets printed at all, please
send it down to that console, no questions asked.

For vga_con, it is a completely different matter, as the user sitting in
front of his console could get spammed by messages while trying to login
or similar.  So ignore_loglevel doesn't work as a one-size-fits-all
approach.  Add a per-console flag instead so that netconsole and
blockconsole can opt-in.

Signed-off-by: Joern Engel <joern@logfs.org>
include/linux/console.h
kernel/printk.c

index dedb082fe50fde9e62190569b0c362238a46f1b0..eed92ad1cb88908d2a86c3215e90f06911bef23b 100644 (file)
@@ -116,6 +116,7 @@ static inline int con_debug_leave(void)
 #define CON_BOOT       (8)
 #define CON_ANYTIME    (16) /* Safe to call when cpu is offline */
 #define CON_BRL                (32) /* Used for a braille device */
+#define CON_ALLDATA    (64) /* per-console ignore_loglevel */
 
 struct console {
        char    name[16];
index 267ce780abe8dd0c18b3c6f1d93f3974b75697ed..5221c591ccbe0efecce759bb954a083500009211 100644 (file)
@@ -1261,8 +1261,6 @@ static void call_console_drivers(int level, const char *text, size_t len)
 
        trace_console(text, 0, len, len);
 
-       if (level >= console_loglevel && !ignore_loglevel)
-               return;
        if (!console_drivers)
                return;
 
@@ -1276,6 +1274,9 @@ static void call_console_drivers(int level, const char *text, size_t len)
                if (!cpu_online(smp_processor_id()) &&
                    !(con->flags & CON_ANYTIME))
                        continue;
+               if (level >= console_loglevel && !ignore_loglevel &&
+                   !(con->flags & CON_ALLDATA))
+                       continue;
                con->write(con, text, len);
        }
 }