diff options
| author | Madhavan Srinivasan <[email protected]> | 2016-08-17 09:36:08 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2016-08-18 08:44:20 +0000 |
| commit | 29dd3288705f26cc27663e79061209dabce2d5b9 (patch) | |
| tree | b73441ec4167b7b185a36cf368382ed4fda6e224 /tools/perf/util/scripting-engines/trace-event-perl.c | |
| parent | Merge branch 'perf/urgent' into perf/core, to pick up dependencies (diff) | |
| download | kernel-29dd3288705f26cc27663e79061209dabce2d5b9.tar.gz kernel-29dd3288705f26cc27663e79061209dabce2d5b9.zip | |
bitmap.h, perf/core: Fix the mask in perf_output_sample_regs()
When decoding the perf_regs mask in perf_output_sample_regs(),
we loop through the mask using find_first_bit and find_next_bit functions.
While the exisiting code works fine in most of the case, the logic
is broken for big-endian 32-bit kernels.
When reading a u64 mask using (u32 *)(&val)[0], find_*_bit() assumes
that it gets the lower 32 bits of u64, but instead it gets the upper
32 bits - which is wrong.
The fix is to swap the words of the u64 to handle this case.
This is _not_ a regular endianness swap.
Suggested-by: Yury Norov <[email protected]>
Signed-off-by: Madhavan Srinivasan <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Yury Norov <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions
