printk: suppress printing less important messages to console 67/272067/2
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 7 Mar 2022 23:22:54 +0000 (00:22 +0100)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 9 Mar 2022 20:44:45 +0000 (21:44 +0100)
Suppress printing to console messages with loglevel above the
console_loglevel via print_sync().

Change-Id: Ia8d53fd2fadb74e323d776f053c91f7832402021
Fixes: 5d6a5a2378db ("patch-5.10.100-rt62.patch")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
kernel/printk/printk.c

index dea500d..5aafb44 100644 (file)
@@ -1774,6 +1774,11 @@ static bool print_sync(struct console *con, u64 *seq)
        if (!prb_read_valid(prb, *seq, &r))
                return false;
 
+       if (suppress_message_printing(r.info->level)) {
+               *seq = r.info->seq;
+               return true;
+       }
+
        text_len = record_print_text(&r, console_msg_format & MSG_FORMAT_SYSLOG, printk_time);
 
        if (!call_sync_console_driver(con, &con->sync_buf[0], text_len))