Re: [RFC PATCH 2/2] init: Allow multi-line output of kernel command line
From: Joe Perches
Date: Wed May 20 2020 - 16:36:53 EST
On Wed, 2020-05-20 at 21:10 +0900, Sergey Senozhatsky wrote:
> On (20/05/19 21:58), Joe Perches wrote:
> [..]
> > > Maybe we can
> > > use here something rather random and much shorter instead. E.g.
> > > 256 chars. Hmm. How
> >
> > min(some_max like 132/256, PRINTK_LOG_LINE_MAX)
> >
> > would work.
>
> An alternative approach would be to do what we do in the
> print_modules() (the list of modules which can definitely
> be longer than 1K chars).
>
> We can split command line in a loop - memchr(pos, ' ') - and
> pr_cont() parts of the command line. pr_cont() has overflow
> control and it flushes cont buffer before it overflows, so
> we should not lose anything.
It doesn't matter much here, but I believe
there's an 8k max buffer for pr_cont output.
include/linux/printk.h:#define CONSOLE_EXT_LOG_MAX 8192
Anyway, no worries, it simplifies the loop if
done that way.