Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755180AbbDGOBp (ORCPT ); Tue, 7 Apr 2015 10:01:45 -0400 Received: from smtprelay0136.hostedemail.com ([216.40.44.136]:45112 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753789AbbDGOBo (ORCPT ); Tue, 7 Apr 2015 10:01:44 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3653:3866:3867:3870:3871:3874:4250:4321:4605:5007:6261:7903:9040:10004:10400:10848:11232:11658:11914:12296:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: jail23_2bac6c9651e3e X-Filterd-Recvd-Size: 1884 Message-ID: <1428415297.20888.92.camel@perches.com> Subject: Re: [PATCH] sched/core: Drop debugging leftover trace_printk call From: Joe Perches To: Juri Lelli Cc: Borislav Petkov , Ingo Molnar , LKML , "Peter Zijlstra (Intel)" , Juri Lelli , Steven Rostedt Date: Tue, 07 Apr 2015 07:01:37 -0700 In-Reply-To: <5523E006.4050507@arm.com> References: <1428050570-21041-1-git-send-email-bp@alien8.de> <5523E006.4050507@arm.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 33 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__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@kernel/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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/