[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXk5yriz2CtCN-vkL0q7gdpV+f8+9GJH-FT+v3KBLb-fWoCZA@mail.gmail.com>
Date: Tue, 24 Apr 2018 19:20:03 +0000
From: Wei Wang <wvw@...gle.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: gregkh@...uxfoundation.org, Wei Wang <wei.vince.wang@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Crt Mori <cmo@...exis.com>,
Alexei Starovoitov <ast@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>,
linux-kernel@...r.kernel.org, Joe Perches <joe@...ches.com>
Subject: Re: [PATCH] do not call trace_printk on non-debug build
checkpatch.pl sounds good. One thing to add is we have many off tree
patches with abuse trace_printk. Also as you mentioned, given this is
really not for use in production and we have been cleaning this our on our
side for years, could we consider to enforce this in kernel?
Thanks!
Wei
On Tue, Apr 24, 2018 at 12:14 PM Steven Rostedt <rostedt@...dmis.org> wrote:
> On Tue, 24 Apr 2018 19:02:34 +0000
> Wei Wang <wvw@...gle.com> wrote:
> > We have seen many cases vendor have shipped kernel/drivers with it, and
> > have to clean up that every year. This was brought up in an internal
> > discussion and Greg suggested have some feedback from upstream about
what
> > should be taken to prevent this globally besides fixing individual
drivers.
> > From him "I think this change makes sense at a high level, but there
could
> > be non-obvious reasons why this isn't the way things are handled right
now."
> The thing is, trace_printk() should not be used except for development
> and debugging. There should be no use cases in the kernel that us it,
> unless it's part of something else that should never be used (I use it
> for the ring buffer benchmark which itself will destabilize the
> system and is why I use it - I want that warning for it too).
> Any trace_printk() in a patch submitted to the kernel should simply be
> stripped out. If someone wants a trace_printk() in their code, then
> they should create a trace event, which is the proper way of retrieving
> static data from the kernel. Using trace_printk() is just a lazy fast
> way to create trace events.
> Hmm, ideally I think check_patch needs to add a warning if
> trace_printk() is used.
> -- Steve
Powered by blists - more mailing lists