From: Frederic Weisbecker Date: Tue, 24 May 2011 01:31:26 +0000 (+0200) Subject: perf tools: Fix sample type size calculation in 32 bits archs X-Git-Tag: MMI-PSA29.97-13-9~18912^2~68 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f61f3e4db71946292ef8d6d6df74b8fcf001646;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git perf tools: Fix sample type size calculation in 32 bits archs The shift used here to count the number of bits set in the mask doesn't work above the low part for archs that are not 64 bits. Fix the constant used for the shift. This fixes a 32-bit perf top failure reported by Eric Dumazet: Can't parse sample, err = -14 Can't parse sample, err = -14 ... Reported-and-tested-by: Eric Dumazet Signed-off-by: Frederic Weisbecker Cc: Linus Torvalds Cc: Steven Rostedt Cc: Eric Dumazet Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Stephane Eranian --- diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 252b72a5e59e..6635fcd11ca5 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -42,7 +42,7 @@ int perf_sample_size(u64 sample_type) int i; for (i = 0; i < 64; i++) { - if (mask & (1UL << i)) + if (mask & (1ULL << i)) size++; }