Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757196Ab3CSA3m (ORCPT ); Mon, 18 Mar 2013 20:29:42 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:50163 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754433Ab3CSA3l (ORCPT ); Mon, 18 Mar 2013 20:29:41 -0400 Message-ID: <1363652979.1932.23.camel@joe-AO722> Subject: Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages From: Joe Perches To: Davidlohr Bueso Cc: Andrew Morton , Michel Lespinasse , LKML Date: Mon, 18 Mar 2013 17:29:39 -0700 In-Reply-To: <1363650471.1774.20.camel@buesod1.americas.hpqcorp.net> References: <1363648854.1774.16.camel@buesod1.americas.hpqcorp.net> <1363650265.1932.17.camel@joe-AO722> <1363650471.1774.20.camel@buesod1.americas.hpqcorp.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.6.2-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1927 Lines: 57 On Mon, 2013-03-18 at 16:47 -0700, Davidlohr Bueso wrote: > 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 -> cycles" > > > > The new code prints: > > > > "rbtree_test: rbtree testing" > > "rbtree_test: -> 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. Your choice. I don't prefer one over the other. I do prefer you add an explicit newline to the first format though instead of relying on the implicit newline the printk subsystem will emit during the next pr_ call. cheers, Joe -- 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/