The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jovi Zhang <bookjovi@gmail.com>
Cc: rostedt@goodmis.org, "Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ftrace: using pr_fmt for better printk output
Date: Mon, 16 Jul 2012 20:42:01 -0700	[thread overview]
Message-ID: <1342496521.8377.105.camel@joe2Laptop> (raw)
In-Reply-To: <CACV3sb+CkmMtBSRe=bp4EcN3xXD+XqBKy+o_-Cr7e6bapYQftw@mail.gmail.com>

On Tue, 2012-07-17 at 09:15 +0800, Jovi Zhang wrote:
> >From fe42b2f29e5968482b3129c71f81a58a0559cf04 Mon Sep 17 00:00:00 2001
[]
> There don't have subsystem name output in front ot ftrace related log entry,
> so use pr_fmt to enable better printk output, for output subsystem name in
> log entry.

Hi Jovi.  A few things:

Your patch has 80 column wrapping issues and doesn't
apply cleanly.

This sort of patch, because it's trivial and not really
important to apply this close to an actual release, should
be done against linux-next not current mainline.

The #define pr_fmt(fmt) should probably use KBUILD_MODNAME.
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Please coalesce formats even though they then may exceed
80 columns and compress multiple lines that fit in 80 too.

> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
[]
> @@ -13,6 +13,8 @@
>   *  Copyright (C) 2004 William Lee Irwin III
>   */
> 
> +#define pr_fmt(fmt) "ftrace: " fmt

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

[]
> @@ -2187,12 +2189,12 @@ static int __init
> ftrace_dyn_table_alloc(unsigned long num_to_init)

wrapped

>  	int cnt;
> 
>  	if (!num_to_init) {
> -		pr_info("ftrace: No functions to be traced?\n");
> +		pr_info("No functions to be traced?\n");
>  		return -1;
>  	}
> 
>  	cnt = num_to_init / ENTRIES_PER_PAGE;
> -	pr_info("ftrace: allocating %ld entries in %d pages\n",
> +	pr_info("allocating %ld entries in %d pages\n",
>  		num_to_init, cnt + 1);

Single line:

	pr_info("allocating %ld entries in %d pages\n", num_to_init, cnt + 1);

> @@ -4495,7 +4497,7 @@ static int start_graph_tracing(void)
>  	if (!ret) {
>  		ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL);
>  		if (ret)
> -			pr_info("ftrace_graph: Couldn't activate tracepoint"
> +			pr_info("Couldn't activate tracepoint"
>  				" probe to kernel_sched_switch\n");

Coalesce format:

			pr_info("Couldn't activate tracepoint probe to kernel_sched_switch\n");

etc...

cheers, Joe


  reply	other threads:[~2012-07-17  3:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17  1:15 [PATCH] ftrace: using pr_fmt for better printk output Jovi Zhang
2012-07-17  3:42 ` Joe Perches [this message]
2012-07-17  4:25   ` Steven Rostedt
2012-07-17  5:07     ` Joe Perches
2012-07-17  5:32       ` Jovi Zhang
2012-07-17  5:37         ` Joe Perches
2012-07-17  6:47           ` Jovi Zhang
2012-07-17  5:23     ` Jovi Zhang
2012-07-17  5:27       ` Joe Perches
2012-07-17  5:29       ` 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=1342496521.8377.105.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=bookjovi@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox