public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, Valdis.Kletnieks@vt.edu,
	dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com,
	fweisbec@gmail.com, patches@linaro.org
Subject: Re: [PATCH RFC tip/core/rcu 2/2] rcu: Fix broken strings in RCU's source code.
Date: Thu, 17 May 2012 15:41:46 -0700	[thread overview]
Message-ID: <20120517224146.GP2567@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120517222322.GA15766@leaf>

On Thu, May 17, 2012 at 03:23:22PM -0700, Josh Triplett wrote:
> On Thu, May 17, 2012 at 03:12:45PM -0700, Paul E. McKenney wrote:
> > @@ -1184,27 +1183,27 @@ rcu_torture_printk(char *page)
> >  	}
> >  	cnt += sprintf(&page[cnt], "%s%s ", torture_type, TORTURE_FLAG);
> >  	cnt += sprintf(&page[cnt],
> > -		       "rtc: %p ver: %lu tfle: %d rta: %d rtaf: %d rtf: %d "
> > -		       "rtmbe: %d rtbke: %ld rtbre: %ld "
> > -		       "rtbf: %ld rtb: %ld nt: %ld "
> > -		       "onoff: %ld/%ld:%ld/%ld "
> > -		       "barrier: %ld/%ld:%ld",
> > +		       "rtc: %p ver: %lu tfle: %d rta: %d rtaf: %d rtf: %d ",
> >  		       rcu_torture_current,
> >  		       rcu_torture_current_version,
> >  		       list_empty(&rcu_torture_freelist),
> >  		       atomic_read(&n_rcu_torture_alloc),
> >  		       atomic_read(&n_rcu_torture_alloc_fail),
> > -		       atomic_read(&n_rcu_torture_free),
> > +		       atomic_read(&n_rcu_torture_free));
> > +	cnt += sprintf(&page[cnt], "rtmbe: %d rtbke: %ld rtbre: %ld ",
> >  		       atomic_read(&n_rcu_torture_mberror),
> >  		       n_rcu_torture_boost_ktrerror,
> > -		       n_rcu_torture_boost_rterror,
> > +		       n_rcu_torture_boost_rterror);
> > +	cnt += sprintf(&page[cnt], "rtbf: %ld rtb: %ld nt: %ld ",
> >  		       n_rcu_torture_boost_failure,
> >  		       n_rcu_torture_boosts,
> > -		       n_rcu_torture_timers,
> > +		       n_rcu_torture_timers);
> > +	cnt += sprintf(&page[cnt], "onoff: %ld/%ld:%ld/%ld ",
> >  		       n_online_successes,
> >  		       n_online_attempts,
> >  		       n_offline_successes,
> > -		       n_offline_attempts,
> > +		       n_offline_attempts);
> > +	cnt += sprintf(&page[cnt], "barrier: %ld/%ld:%ld",
> >  		       n_barrier_successes,
> >  		       n_barrier_attempts,
> >  		       n_rcu_torture_barrier_error);
> 
> A change like this placates tools like checkpatch, but doesn't actually
> fix the problem. :)

The formatting would frustrate most people trying to grep for the
debugfs output anyway, though.

But the main reason for the change is that it makes it easier to see
which quantity goes with which sprintf() format specifier.  (Lazy and
self-indulgent, I know!!!)

						Thanx, Paul


  reply	other threads:[~2012-05-17 22:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 22:12 [PATCH tip/core/rcu 0/2] Code-style fixes Paul E. McKenney
2012-05-17 22:12 ` [PATCH RFC tip/core/rcu 1/2] rcu: Fix code-style issues involving "else" Paul E. McKenney
2012-05-17 22:12   ` [PATCH RFC tip/core/rcu 2/2] rcu: Fix broken strings in RCU's source code Paul E. McKenney
2012-05-17 22:20     ` Peter Zijlstra
2012-05-17 22:32       ` Josh Triplett
2012-05-17 22:32       ` Paul Bolle
2012-05-18  6:33       ` Ingo Molnar
2012-05-18 12:33         ` Paul E. McKenney
2012-05-17 22:23     ` Josh Triplett
2012-05-17 22:41       ` Paul E. McKenney [this message]
2012-05-17 22:27     ` Peter Zijlstra
2012-05-17 22:43       ` Paul E. McKenney
2012-05-17 22:24   ` [PATCH RFC tip/core/rcu 1/2] rcu: Fix code-style issues involving "else" Josh Triplett
2012-05-18  7:38   ` Lai Jiangshan

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=20120517224146.GP2567@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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