Re: [PATCH v8 2/5] usb: early: add driver for xhci debug capability

From: Steven Rostedt
Date: Wed May 31 2017 - 02:25:01 EST


On Wed, 31 May 2017 11:27:19 +0800
Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx> wrote:


> >> +
> >> +#define XDBC_TRACE
> >> +#ifdef XDBC_TRACE
> >> +#define xdbc_trace trace_printk
> > Did you forget to remove the #define XDBC_TRACE?
> >
> > Enabling this driver brings the "trace_printk() being used.
> > Allocating extra memory. This means that this is a DEBUG kernel and
> > it is unsafe for production use." message in 4.12-rcX dmesg.
>
> This feature is only for a DEBUG kernel, should not be enabled for
> any production kernel. This was the reason I enabled trace_printk()
> by default.

Yes, it is perfectly fine to use trace_printk() for debug only configs.
But if if you have it there and it is helpful to debug something that
happens in a production system, you may want to look into creating a
real tracepoint for the locations.

-- Steve