mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
9ee6ddc9da
commit
80c0120a3c
4 changed files with 22 additions and 7 deletions
|
@ -442,6 +442,16 @@ static void perf_tool__fill_defaults(struct perf_tool *tool)
|
|||
tool->finished_round = process_finished_round_stub;
|
||||
}
|
||||
}
|
||||
|
||||
void mem_bswap_32(void *src, int byte_size)
|
||||
{
|
||||
u32 *m = src;
|
||||
while (byte_size > 0) {
|
||||
*m = bswap_32(*m);
|
||||
byte_size -= sizeof(u32);
|
||||
++m;
|
||||
}
|
||||
}
|
||||
|
||||
void mem_bswap_64(void *src, int byte_size)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue