Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-16 Thread Madhavan Srinivasan
On Thursday 16 June 2016 02:41 AM, Yury Norov wrote: > On Wed, Jun 15, 2016 at 10:51:27PM +0300, Yury Norov wrote: >> Hi Madhavan, >> >> On Wed, Jun 15, 2016 at 05:12:53PM +0530, Madhavan Srinivasan wrote: >>> When decoding the perf_regs mask in regs_dump__printf(), >>> we loop through the mask u

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-16 Thread Madhavan Srinivasan
On Wednesday 15 June 2016 06:14 PM, George Spelvin wrote: > Madhavan Srinivasan wrote: >> +#if (__BYTE_ORDER == __BIG_ENDIAN) && (BITS_PER_LONG != 64) >> +tmp = addr[(((nbits - 1)/BITS_PER_LONG) - (start / BITS_PER_LONG))] >> +^ inve

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-16 Thread Madhavan Srinivasan
On Thursday 16 June 2016 01:21 AM, Yury Norov wrote: > Hi Madhavan, > > On Wed, Jun 15, 2016 at 05:12:53PM +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. >> And mask is of

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Hekuang
在 2016/6/16 5:29, Arnaldo Carvalho de Melo 写道: Em Thu, Jun 16, 2016 at 12:11:04AM +0300, Yury Norov escreveu: On Wed, Jun 15, 2016 at 10:51:27PM +0300, Yury Norov wrote: Maybe there already is some macro doing the conversion for you... yes it is, cpu_to_le64() is what you want Beware that t

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Arnaldo Carvalho de Melo
Em Thu, Jun 16, 2016 at 12:11:04AM +0300, Yury Norov escreveu: > On Wed, Jun 15, 2016 at 10:51:27PM +0300, Yury Norov wrote: > > Maybe there already is some macro doing the conversion for you... > > yes it is, cpu_to_le64() is what you want Beware that the cpu_to_le64() in tools/perf is bogus, we

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Yury Norov
On Wed, Jun 15, 2016 at 10:51:27PM +0300, Yury Norov wrote: > Hi Madhavan, > > On Wed, Jun 15, 2016 at 05:12:53PM +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. > > And ma

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Yury Norov
Hi Madhavan, On Wed, Jun 15, 2016 at 05:12:53PM +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. > And mask is of type "u64". But "u64" is send as a "unsigned long *" to > lib f

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread George Spelvin
Madhavan Srinivasan wrote: > +#if (__BYTE_ORDER == __BIG_ENDIAN) && (BITS_PER_LONG != 64) > + tmp = addr[(((nbits - 1)/BITS_PER_LONG) - (start / BITS_PER_LONG))] > + ^ invert; > +#else > tmp = addr[start / BITS_PER_LONG] ^ invert

[PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Madhavan Srinivasan
When decoding the perf_regs mask in regs_dump__printf(), we loop through the mask using find_first_bit and find_next_bit functions. And mask is of type "u64". But "u64" is send as a "unsigned long *" to lib functions along with sizeof(). While the exisitng code works fine in most of the case, when