[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1428415297.20888.92.camel@perches.com>
Date: Tue, 07 Apr 2015 07:01:37 -0700
From: Joe Perches <joe@...ches.com>
To: Juri Lelli <juri.lelli@....com>
Cc: Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Juri Lelli <juri.lelli@...il.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] sched/core: Drop debugging leftover trace_printk call
On Tue, 2015-04-07 at 14:47 +0100, Juri Lelli wrote:
> how about we add also something like this to checkpatch?
[]
> Production kernels will scream if trace_printk() is used (thanks to
> Rostedt's banner). Rather than waiting for that to happen, let's check
> patches beforehand.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3257,6 +3257,12 @@ sub process {
> "Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr);
> }
>
> +# check for uses of trace_printk
> + if ($line =~ /\btrace_printk\s*\(/) {
> + ERROR("TRACE_PRINTK",
> + "Never use trace_printk in production code!\n" . $herecurr);
> + }
OK by me with a couple Nits:
o Please add a test for $realfile !~ m@...nel/trace/@
or maybe $realfile !~ /(?:trace|tracing)/
o ERROR seems a bit strong, WARN is probably good enough
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists