mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michel Lespinasse <walken@google.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages
Date: Mon, 18 Mar 2013 16:44:25 -0700	[thread overview]
Message-ID: <1363650265.1932.17.camel@joe-AO722> (raw)
In-Reply-To: <1363648854.1774.16.camel@buesod1.americas.hpqcorp.net>

On Mon, 2013-03-18 at 16:20 -0700, Davidlohr Bueso wrote:
> This provides nicer message output. Since it seems more appropriate
> for the nature of this module, also use KERN_INFO instead of other
> levels.
[]
> diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
[]
> @@ -153,7 +156,7 @@ static int rbtree_test_init(void)
>  	int i, j;
>  	cycles_t time1, time2, time;
>  
> -	printk(KERN_ALERT "rbtree testing");
> +	pr_info("rbtree testing");
>  
>  	prandom_seed_state(&rnd, 3141592653589793238ULL);
>  	init();
> @@ -171,7 +174,7 @@ static int rbtree_test_init(void)
>  	time = time2 - time1;
>  
>  	time = div_u64(time, PERF_LOOPS);
> -	printk(" -> %llu cycles\n", (unsigned long long)time);
> +	pr_info(" -> %llu cycles\n", (unsigned long long)time);

You change the output here by more than just adding a prefix.

The first printk didn't have a newline.

The old code would print:

"rbtree testing -> <foo> cycles"

The new code prints:

"rbtree_test: rbtree testing"
"rbtree_test: -> <foo> cycles"

btw: each pr_info should have a newline termination
or be followed by a some number of pr_cont/printk with
the last one having a terminating newline.

The first pr_info here doesn't have a newline
so it's possible (though unlikely) that another
thread could have its output appended/interleaved
on the same line.



  reply	other threads:[~2013-03-18 23:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 23:20 Davidlohr Bueso
2013-03-18 23:44 ` Joe Perches [this message]
2013-03-18 23:47   ` Davidlohr Bueso
2013-03-19  0:29     ` Joe Perches
2013-03-19 16:29 ` Shuah Khan
2013-03-19 17:14   ` Davidlohr Bueso
2013-03-19 17:54     ` Shuah Khan
2013-03-22  2:51       ` Davidlohr Bueso
2013-03-22  3:29         ` Michel Lespinasse
2013-03-22 23:06           ` Davidlohr Bueso

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=1363650265.1932.17.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidlohr.bueso@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=walken@google.com \
    /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

all inboxes | Powered by JetHome®