Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-20

Re: [PATCH v2] tools/perf: Fix the mask in regs_dump__printf and

From: Jiri Olsa <hidden>
Date: 2016-06-20 09:18:49
Also in: lkml

On Mon, Jun 20, 2016 at 02:14:01PM +0530, Madhavan Srinivasan wrote:
When decoding the perf_regs mask in regs_dump__printf(),
we loop through the mask using find_first_bit and find_next_bit functions.
"mask" is of type "u64", but sent as a "unsigned long *" to
lib functions along with sizeof(). While the exisitng code works fine in
most of the case, the logic is broken when using a 32bit perf on a
64bit kernel (Big Endian). We end up reading the wrong word of the u64
first in the lib functions.
hum, I still don't see why this happens.. why do we read the
wrong word in this case?

thanks,
jirka
first in the lib functions. Proposed fix is to swap the words of the
u64 to handle this case. This is not endianess swap.
SNIP
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help