Skip to content

Commit

Permalink
Revert "printk: make sure to print log on console."
Browse files Browse the repository at this point in the history
This reverts commit 375899c.

The visibility of early messages did not longer take into account
"quiet", "debug", and "loglevel" early parameters.

It would be possible to invalidate and recompute LOG_NOCONS flag
for the affected messages. But it would be hairy.

Instead this patch just reverts the problematic commit. We could
come up with a better solution for the original problem. For example,
we could simplify the logic and just mark messages that should always
be visible or always invisible on the console.

Also this patch reverts the related build fix commit ffaa619
("printk: Fix warning about unused suppress_message_printing").

Finally, this patch does not put back the unused LOG_NOCONS flag.

Link: http://lkml.kernel.org/r/20180910145747.emvfzv4mzlk5dfqk@pathway.suse.cz
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Maninder Singh <maninder1.s@samsung.com>
Reported-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
  • Loading branch information
Petr Mladek committed Sep 11, 2018
1 parent 9f68cb5 commit a6ae928
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT;
*/

enum log_flags {
LOG_NOCONS = 1, /* suppress print, do not print to console */
LOG_NEWLINE = 2, /* text ended with a newline */
LOG_PREFIX = 4, /* text started with a prefix */
LOG_CONT = 8, /* text is a fragment of a continuation line */
Expand Down Expand Up @@ -1879,9 +1878,6 @@ int vprintk_store(int facility, int level,
if (dict)
lflags |= LOG_PREFIX|LOG_NEWLINE;

if (suppress_message_printing(level))
lflags |= LOG_NOCONS;

return log_output(facility, level, lflags,
dict, dictlen, text, text_len);
}
Expand Down Expand Up @@ -2030,6 +2026,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len,
const char *text, size_t len) {}
static size_t msg_print_text(const struct printk_log *msg,
bool syslog, char *buf, size_t size) { return 0; }
static bool suppress_message_printing(int level) { return false; }

#endif /* CONFIG_PRINTK */

Expand Down Expand Up @@ -2365,10 +2362,11 @@ void console_unlock(void)
break;

msg = log_from_idx(console_idx);
if (msg->flags & LOG_NOCONS) {
if (suppress_message_printing(msg->level)) {
/*
* Skip record if !ignore_loglevel, and
* record has level above the console loglevel.
* Skip record we have buffered and already printed
* directly to the console when we received it, and
* record that has level above the console loglevel.
*/
console_idx = log_next(console_idx);
console_seq++;
Expand Down

0 comments on commit a6ae928

Please sign in to comment.