OSDN Git Service

printk: keep kernel cont support always enabled
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Tue, 2 Oct 2018 02:38:34 +0000 (11:38 +0900)
committerPetr Mladek <pmladek@suse.com>
Fri, 12 Oct 2018 08:03:30 +0000 (10:03 +0200)
commit9627808d2d409279cea3fb334212d04a83ff6371
treeaf946f325a2fade86a211620e3b5e32f1aaab4fb
parente6fe3e5b7d16e8f146a4ae7fe481bc6e97acde1e
printk: keep kernel cont support always enabled

Since commit 5c2992ee7fd8a29 ("printk: remove console flushing special
cases for partial buffered lines") we don't print cont fragments
to the consoles; cont lines are now proper log_buf entries and
there is no "consecutive continuation flag" anymore: we either
have 'c' entries that mark continuation lines without fragments;
or '-' entries that mark normal logbuf entries. There are no '+'
entries anymore.

However, we still have a small leftover - presence of ext_console
drivers disables kernel cont support and we flush each pr_cont()
and store it as a separate log_buf entry. Previously, it worked
because msg_print_ext_header() had that "an optional external merge
of the records" functionality:

if (msg->flags & LOG_CONT)
cont = (prev_flags & LOG_CONT) ? '+' : 'c';

We don't do this as of now, so keep kernel cont always enabled.

Note from pmladek:

The original purpose was to get full information including
the metadata and dictionary via extended console drivers,
see commit 6fe29354befe4c46e ("printk: implement support
for extended console drivers").

The dictionary probably was the most important part but
it was actually lost:

  static void cont_flush(void)
  {
  [...]
log_store(cont.facility, cont.level, cont.flags, cont.ts_nsec,
  NULL, 0, cont.buf, cont.len);

Nobody noticed because the only dictionary user is dev_printk()
and dev_cont() is _not_ defined.

Link: http://lkml.kernel.org/r/20181002023836.4487-2-sergey.senozhatsky@gmail.com
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
[pmladek@suse.com: Updated commit message]
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c