[lkml]   [2018]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] do not call trace_printk on non-debug build
On Tue, 24 Apr 2018 19:02:34 +0000
Wei Wang <> 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

 \ /
  Last update: 2018-04-24 21:15    [W:0.086 / U:3.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site