Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754625AbbDGNr7 (ORCPT ); Tue, 7 Apr 2015 09:47:59 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:52109 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754558AbbDGNrx convert rfc822-to-8bit (ORCPT ); Tue, 7 Apr 2015 09:47:53 -0400 Message-ID: <5523E006.4050507@arm.com> Date: Tue, 07 Apr 2015 14:47:50 +0100 From: Juri Lelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Borislav Petkov , Ingo Molnar CC: LKML , "Peter Zijlstra (Intel)" , Juri Lelli , Steven Rostedt Subject: Re: [PATCH] sched/core: Drop debugging leftover trace_printk call References: <1428050570-21041-1-git-send-email-bp@alien8.de> In-Reply-To: <1428050570-21041-1-git-send-email-bp@alien8.de> X-OriginalArrivalTime: 07 Apr 2015 13:47:49.0935 (UTC) FILETIME=[6FF81BF0:01D07139] X-MC-Unique: DA8c9UwrR_KnCMWlcfmiHg-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2848 Lines: 88 On 03/04/2015 09:42, Borislav Petkov wrote: > From: Borislav Petkov > > Commit > > 3c18d447b3b3 ("sched/core: Check for available DL bandwidth in cpuset_cpu_inactive()") > > forgot a trace_printk debugging piece in and Steve's banner blew in > dmesg. Remove it. > Argh! Sorry about that! Shame on me, I didn't pay much attention to Rostedt's banner because I was working on several fixes at once :(. Anyway, how about we add also something like this to checkpatch? (I'll add appropriate CCs if this makes sense). Thanks, - Juri >From e5733b377d55fd760160fa0e7822bdefa4f3a2c4 Mon Sep 17 00:00:00 2001 From: Juri Lelli Date: Sun, 5 Apr 2015 09:57:04 +0100 Subject: [PATCH] scripts/checkpatch: check for uses of trace_printk 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. Signed-off-by: Juri Lelli --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d124359..1fc454c5 100755 --- 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); + } + # printk should use KERN_* levels. Note that follow on printk's on the # same line do not need a level, so we use the current block context # to try and find and validate the current printk. In summary the current -- 2.3.0 > Signed-off-by: Borislav Petkov > Cc: Juri Lelli > Cc: Peter Zijlstra (Intel) > Cc: Juri Lelli > Cc: Ingo Molnar > Cc: Steven Rostedt > --- > kernel/sched/core.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index a27d38f5a464..dbfc93d40292 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -7015,10 +7015,8 @@ static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action, > > rcu_read_unlock_sched(); > > - if (overflow) { > - trace_printk("hotplug failed for cpu %lu", cpu); > + if (overflow) > return notifier_from_errno(-EBUSY); > - } > } > cpuset_update_active_cpus(false); > break; > -- 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/