Re: [PATCH] kernel/trace: Add TRACING_ALLOW_PRINTK config option

From: Alexei Starovoitov
Date: Wed Jun 24 2020 - 13:25:53 EST


On Wed, Jun 24, 2020 at 9:07 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Wed, 24 Jun 2020 16:45:24 +0800
> Nicolas Boichat <drinkcat@xxxxxxxxxxxx> wrote:
>
> > trace_printk is only meant as a debugging tool, and should never be
> > compiled into production code without source code changes, as
> > indicated by the warning that shows up on boot if any trace_printk
> > is called:
> > ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **
> > ** **
> > ** trace_printk() being used. Allocating extra memory. **
> > ** **
> > ** This means that this is a DEBUG kernel and it is **
> > ** unsafe for production use. **
> >
> > If this option is set to n, the kernel will generate a build-time
> > error if trace_printk is used.
> >
> > Signed-off-by: Nicolas Boichat <drinkcat@xxxxxxxxxxxx>
>
> Interesting. Note, this will prevent modules with trace_printk from
> being loaded as well.

Nack.
The message is bogus. It's used in production kernels.
bpf_trace_printk() calls it.