Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-24 Thread Liang, Kan
On 1/24/2018 7:26 AM, Peter Zijlstra wrote: On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: The formula to calculate the event->count is as below: event->count = period left from last time + (reload_times - 1) * reload_val +

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-24 Thread Liang, Kan
On 1/24/2018 7:26 AM, Peter Zijlstra wrote: On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: The formula to calculate the event->count is as below: event->count = period left from last time + (reload_times - 1) * reload_val +

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-24 Thread Peter Zijlstra
On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: > The formula to calculate the event->count is as below: > event->count = period left from last time + > (reload_times - 1) * reload_val + > latency of PMI handler > > prev_count is the last

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-24 Thread Peter Zijlstra
On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: > The formula to calculate the event->count is as below: > event->count = period left from last time + > (reload_times - 1) * reload_val + > latency of PMI handler > > prev_count is the last

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-11 Thread Jiri Olsa
On Wed, Jan 10, 2018 at 09:31:01AM -0500, Liang, Kan wrote: > > > On 1/10/2018 5:22 AM, Jiri Olsa wrote: > > On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: > > > > SNIP > > > > > There is nothing need to do in x86_perf_event_set_period(). Because it > > > is fixed period.

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-11 Thread Jiri Olsa
On Wed, Jan 10, 2018 at 09:31:01AM -0500, Liang, Kan wrote: > > > On 1/10/2018 5:22 AM, Jiri Olsa wrote: > > On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: > > > > SNIP > > > > > There is nothing need to do in x86_perf_event_set_period(). Because it > > > is fixed period.

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-10 Thread Liang, Kan
On 1/10/2018 5:22 AM, Jiri Olsa wrote: On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: SNIP There is nothing need to do in x86_perf_event_set_period(). Because it is fixed period. The period_left is already adjusted. Signed-off-by: Kan Liang

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-10 Thread Liang, Kan
On 1/10/2018 5:22 AM, Jiri Olsa wrote: On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: SNIP There is nothing need to do in x86_perf_event_set_period(). Because it is fixed period. The period_left is already adjusted. Signed-off-by: Kan Liang ---

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-10 Thread Jiri Olsa
On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: SNIP > There is nothing need to do in x86_perf_event_set_period(). Because it > is fixed period. The period_left is already adjusted. > > Signed-off-by: Kan Liang > --- > arch/x86/events/intel/ds.c

Re: [RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-10 Thread Jiri Olsa
On Mon, Jan 08, 2018 at 07:15:13AM -0800, kan.li...@intel.com wrote: SNIP > There is nothing need to do in x86_perf_event_set_period(). Because it > is fixed period. The period_left is already adjusted. > > Signed-off-by: Kan Liang > --- > arch/x86/events/intel/ds.c | 69 >

[RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-08 Thread kan . liang
From: Kan Liang There is bug when mmap read event->count with large PEBS enabled. Here is an example. #./read_count 0x71f0 0x122c0 0x11c54 0x10001257d 0x2bdc5 There is auto-reload mechanism enabled for PEBS events in fixed period mode. But

[RESEND PATCH V2 1/4] perf/x86/intel: fix event update for auto-reload

2018-01-08 Thread kan . liang
From: Kan Liang There is bug when mmap read event->count with large PEBS enabled. Here is an example. #./read_count 0x71f0 0x122c0 0x11c54 0x10001257d 0x2bdc5 There is auto-reload mechanism enabled for PEBS events in fixed period mode. But the calculation of