[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140515073405.11002d59@gandalf.local.home>
Date: Thu, 15 May 2014 07:34:05 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Javi Merino <javi.merino@....com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Jiri Olsa <jolsa@...hat.com>
Subject: Re: [RFC][PATCH v3] tracing: Add __bitmask() macro to trace events
to cpumasks and other bitmasks
On Wed, 14 May 2014 20:42:41 +0100
Javi Merino <javi.merino@....com> wrote:
> It looks like an off-by-one error. The system that generated the
> trace.dat is running a kernel configured with NR_CPUS=5, can that be
> the culprit?
You were correct! Actually, I had two off by one errors :-/
One was with calculating the number of added commas
- str_size += nr_bits / 32;
+ str_size += (nr_bits - 1) / 32
No comma if the we have exactly 32 bits (only one if we have 64).
The other was with the start:
- for (i = str_size - 3; i >= 0; i -= 2) {
+ for (i = str_size - 2; i >= 0; i -= 2) {
I included the '\0' when I didn't have to :-p
Should work now. Thanks for testing.
-- Steve
View attachment "print-cpumask.patch" of type "text/x-patch" (5326 bytes)
Powered by blists - more mailing lists