Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-05-03 Thread Vikas Shivappa
On Tue, 3 May 2016, Peter Zijlstra wrote: On Mon, Apr 25, 2016 at 02:12:09PM -0700, Vikas Shivappa wrote: start: prev_count = read_hw_counter(); I am assuming this means we keep the prev_count when event is initialized. This is done in the mbm_init which calls update_sample with

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-05-03 Thread Vikas Shivappa
On Tue, 3 May 2016, Peter Zijlstra wrote: On Mon, Apr 25, 2016 at 02:12:09PM -0700, Vikas Shivappa wrote: start: prev_count = read_hw_counter(); I am assuming this means we keep the prev_count when event is initialized. This is done in the mbm_init which calls update_sample with

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-05-03 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 02:12:09PM -0700, Vikas Shivappa wrote: > >start: > > prev_count = read_hw_counter(); > > I am assuming this means we keep the prev_count when event is initialized. > This is done in the mbm_init which calls update_sample with first parameter > set to true.. No,

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-05-03 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 02:12:09PM -0700, Vikas Shivappa wrote: > >start: > > prev_count = read_hw_counter(); > > I am assuming this means we keep the prev_count when event is initialized. > This is done in the mbm_init which calls update_sample with first parameter > set to true.. No,

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Vikas Shivappa
On Mon, 25 Apr 2016, Peter Zijlstra wrote: On Mon, Apr 25, 2016 at 11:04:38AM -0700, Vikas Shivappa wrote: This is a 'creative' solution; why don't you do the normal thing, which is: start: prev_count = read_hw_counter(); read: do { prev = prev_count;

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Vikas Shivappa
On Mon, 25 Apr 2016, Peter Zijlstra wrote: On Mon, Apr 25, 2016 at 11:04:38AM -0700, Vikas Shivappa wrote: This is a 'creative' solution; why don't you do the normal thing, which is: start: prev_count = read_hw_counter(); read: do { prev = prev_count;

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 11:04:38AM -0700, Vikas Shivappa wrote: > >This is a 'creative' solution; why don't you do the normal thing, which > >is: > > > >start: > > prev_count = read_hw_counter(); > > > >read: > > do { > > prev = prev_count; > > cur_val =

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Peter Zijlstra
On Mon, Apr 25, 2016 at 11:04:38AM -0700, Vikas Shivappa wrote: > >This is a 'creative' solution; why don't you do the normal thing, which > >is: > > > >start: > > prev_count = read_hw_counter(); > > > >read: > > do { > > prev = prev_count; > > cur_val =

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Vikas Shivappa
On Mon, 25 Apr 2016, Peter Zijlstra wrote: On Fri, Apr 22, 2016 at 05:27:19PM -0700, Vikas Shivappa wrote: +static inline void mbm_set_rccount( + struct perf_event *event, struct rmid_read *rr) That's horrible style, the 'normal' style is something like: static

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Vikas Shivappa
On Mon, 25 Apr 2016, Peter Zijlstra wrote: On Fri, Apr 22, 2016 at 05:27:19PM -0700, Vikas Shivappa wrote: +static inline void mbm_set_rccount( + struct perf_event *event, struct rmid_read *rr) That's horrible style, the 'normal' style is something like: static

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Peter Zijlstra
On Fri, Apr 22, 2016 at 05:27:19PM -0700, Vikas Shivappa wrote: > +static inline void mbm_set_rccount( > + struct perf_event *event, struct rmid_read *rr) That's horrible style, the 'normal' style is something like: static inline void mbm_set_rccount(struct perf_event

Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-25 Thread Peter Zijlstra
On Fri, Apr 22, 2016 at 05:27:19PM -0700, Vikas Shivappa wrote: > +static inline void mbm_set_rccount( > + struct perf_event *event, struct rmid_read *rr) That's horrible style, the 'normal' style is something like: static inline void mbm_set_rccount(struct perf_event

[PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-22 Thread Vikas Shivappa
For MBM, since we report total bytes for the duration the perf counts, we need to keep the total bytes counted every time we loose an RMID. Introduce rc_count(recycle count) per event keep this history count(all bytes counted before the current RMID). If we do not keep this count separately then

[PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during recycle

2016-04-22 Thread Vikas Shivappa
For MBM, since we report total bytes for the duration the perf counts, we need to keep the total bytes counted every time we loose an RMID. Introduce rc_count(recycle count) per event keep this history count(all bytes counted before the current RMID). If we do not keep this count separately then