]> Git Repo - linux.git/commitdiff
perf tools: Fix sample type size calculation in 32 bits archs
authorFrederic Weisbecker <[email protected]>
Tue, 24 May 2011 01:31:26 +0000 (03:31 +0200)
committerIngo Molnar <[email protected]>
Tue, 24 May 2011 02:33:24 +0000 (04:33 +0200)
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 <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Stephane Eranian <[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
tools/perf/util/event.c

index 252b72a5e59ef17fc477dc7cc87eb7b8dbac7699..6635fcd11ca558e1831d331a500474c8908a58d1 100644 (file)
@@ -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++;
        }
 
This page took 0.062456 seconds and 4 git commands to generate.