Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-11 Thread Mao Han
On Wed, Apr 10, 2019 at 10:28:37AM -0300, Arnaldo Carvalho de Melo wrote: > > > You forgot to convert that one, doing it for you, > > > > Also in perf_event__sample_event_size() we need to do the same thing, > > right? > > and perf_event__synthesize_sample() > > Done, resulting patch is at the e

Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-10 Thread Arnaldo Carvalho de Melo
Em Wed, Apr 10, 2019 at 10:10:42AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Apr 10, 2019 at 10:08:41AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Wed, Apr 10, 2019 at 04:16:43PM +0800, Mao Han escreveu: > > > On 32-bits platform with more than 32 registers, the 64 bits mask is > >

Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-10 Thread Arnaldo Carvalho de Melo
Em Wed, Apr 10, 2019 at 10:08:41AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Apr 10, 2019 at 04:16:43PM +0800, Mao Han escreveu: > > On 32-bits platform with more than 32 registers, the 64 bits mask is > > truncate to the lower 32 bits and the return value of hweight_long will > > always

Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-10 Thread Arnaldo Carvalho de Melo
Em Wed, Apr 10, 2019 at 04:16:43PM +0800, Mao Han escreveu: > On 32-bits platform with more than 32 registers, the 64 bits mask is > truncate to the lower 32 bits and the return value of hweight_long will > always smaller than 32. When kernel outputs more than 32 registers, but > the user perf prog

[PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-10 Thread Mao Han
On 32-bits platform with more than 32 registers, the 64 bits mask is truncate to the lower 32 bits and the return value of hweight_long will always smaller than 32. When kernel outputs more than 32 registers, but the user perf program only counts 32, there will be a data mismatch result to overflow