printk: suppress printing less important messages to console
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 7 Mar 2022 23:22:54 +0000 (00:22 +0100)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 23 Nov 2022 02:30:44 +0000 (11:30 +0900)
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 7f27cfe..1523ead 100644 (file)
@@ -1844,6 +1844,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))