All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@arm.com>
To: Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Juri Lelli <juri.lelli@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] sched/core: Drop debugging leftover trace_printk call
Date: Tue, 07 Apr 2015 14:47:50 +0100	[thread overview]
Message-ID: <5523E006.4050507@arm.com> (raw)
In-Reply-To: <1428050570-21041-1-git-send-email-bp@alien8.de>

On 03/04/2015 09:42, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> 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 <juri.lelli@arm.com>
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 <juri.lelli@arm.com>
---
 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_<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);
+		}
+
 # 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 <bp@suse.de>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> ---
>  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;
> 


  parent reply	other threads:[~2015-04-07 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03  8:42 [PATCH] sched/core: Drop debugging leftover trace_printk call Borislav Petkov
2015-04-03  8:51 ` [tip:sched/core] " tip-bot for Borislav Petkov
2015-04-03 13:24 ` [PATCH] " Steven Rostedt
2015-04-03 13:28   ` Borislav Petkov
2015-04-07 13:47 ` Juri Lelli [this message]
2015-04-07 13:56   ` Steven Rostedt
2015-04-07 14:19     ` Juri Lelli
2015-04-07 14:01   ` Joe Perches
2015-04-07 14:10     ` Steven Rostedt
2015-04-07 14:26       ` Joe Perches
2015-04-07 14:34         ` Steven Rostedt
2015-04-07 14:38           ` Peter Zijlstra
2015-04-07 14:43           ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5523E006.4050507@arm.com \
    --to=juri.lelli@arm.com \
    --cc=bp@alien8.de \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.