summaryrefslogtreecommitdiff
path: root/tools/perf/util/pmu.c
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2013-01-17 09:11:30 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-01-24 16:40:47 -0300
commit15268138e334bd0362f8395edac4822351714a22 (patch)
tree1c51d41a40fd6088aeae65a6bdb1e25c26ff8da0 /tools/perf/util/pmu.c
parent3cecaa2002273887a9364c454684fa8491bb2b10 (diff)
perf tools: Fix PMU format parsing test failure
On POWER, the 'perf format parsing' test always fails. Looks like it is because memset() is being passed number of longs rather than number of bytes. It is interesting that the test always passes on my x86 box. With this patch, the test passes on POWER and continues to pass on x86. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Anton Blanchard <anton@au1.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: linuxppc-dev@ozlabs.org Link: http://lkml.kernel.org/r/20130117172814.GA18882@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r--tools/perf/util/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 9bdc60c6f138..b93ff146766e 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -548,7 +548,7 @@ void perf_pmu__set_format(unsigned long *bits, long from, long to)
if (!to)
to = from;
- memset(bits, 0, BITS_TO_LONGS(PERF_PMU_FORMAT_BITS));
+ memset(bits, 0, BITS_TO_BYTES(PERF_PMU_FORMAT_BITS));
for (b = from; b <= to; b++)
set_bit(b, bits);
}