perf tools: Fix endianity swapping for adds_features bitmask
authorDavid Ahern <dsahern@gmail.com>
Fri, 8 Jun 2012 14:47:51 +0000 (11:47 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 11 Jun 2012 14:20:01 +0000 (11:20 -0300)
commit80c0120a3cca30166c0ab8b24e44be67e97b79af
treee7328b01e584d810f30e044f0286254a7b12bead
parent9ee6ddc9dada9cc4b2201631bc74fbf203183a10
perf tools: Fix endianity swapping for adds_features bitmask

Based on Jiri's latest attempt:
https://lkml.org/lkml/2012/5/16/61

Basically, adds_features should be byte swapped assuming unsigned
longs are either 8-bytes (u64) or 4-bytes (u32).

    Fixes 32-bit ppc dumping 64-bit x86 feature data:
     ========
     captured on: Sun May 20 19:23:23 2012
     hostname : nxos-vdc-dev3
     os release : 3.4.0-rc7+
     perf version : 3.4.rc4.137.g978da3
     arch : x86_64
     nrcpus online : 16
     nrcpus avail : 16
     cpudesc : Intel(R) Xeon(R) CPU E5540 @ 2.53GHz
     cpuid : GenuineIntel,6,26,5
     total memory : 24680324 kB
    ...

Verified 64-bit x86 can still dump feature data for 32-bit ppc.

Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/4FBBB539.5010805@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c
tools/perf/util/include/linux/bitops.h
tools/perf/util/session.c
tools/perf/util/session.h