lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 Mar 2013 16:47:51 -0700
From:	Davidlohr Bueso <davidlohr.bueso@...com>
To:	Joe Perches <joe@...ches.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Michel Lespinasse <walken@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in
 messages

On Mon, 2013-03-18 at 16:44 -0700, Joe Perches wrote:
> 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"
> 

Ah, I see. This is actually the first time I'm using pr_* calls. I
actually don't mind the new format, it looked
ok, but if others don't agree, I can always resend it.

> 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.
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ