Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

2018-02-10 Thread Peter Zijlstra
On Fri, Feb 09, 2018 at 10:49:35AM -0500, Liang, Kan wrote: > > > On 2/9/2018 9:09 AM, Peter Zijlstra wrote: > > On Tue, Feb 06, 2018 at 12:58:23PM -0500, Liang, Kan wrote: > > > > > > > > > > With the exception of handling 'empty' buffers, I ended up with the > > > > below. Please try again. >

Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

2018-02-09 Thread Liang, Kan
On 2/9/2018 9:09 AM, Peter Zijlstra wrote: On Tue, Feb 06, 2018 at 12:58:23PM -0500, Liang, Kan wrote: With the exception of handling 'empty' buffers, I ended up with the below. Please try again. There are two small errors. After fixing them, the patch works well. Well, it still doesn'

Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

2018-02-09 Thread Peter Zijlstra
On Tue, Feb 06, 2018 at 12:58:23PM -0500, Liang, Kan wrote: > > > > With the exception of handling 'empty' buffers, I ended up with the > > below. Please try again. > > > > There are two small errors. After fixing them, the patch works well. Well, it still doesn't do A, two read()s without PEB

Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

2018-02-06 Thread Liang, Kan
With the exception of handling 'empty' buffers, I ended up with the below. Please try again. There are two small errors. After fixing them, the patch works well. --- --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1156,16 +1156,13 @@ int x86_perf_event_set_period(struct per

Re: [PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

2018-02-06 Thread Peter Zijlstra
On Mon, Jan 29, 2018 at 08:29:29AM -0800, kan.li...@linux.intel.com wrote: > +/* > + * Specific intel_pmu_save_and_restart() for auto-reload. > + * It only be called from drain_pebs(). > + */ > +static int intel_pmu_save_and_restart_reload(struct perf_event *event, > +

[PATCH V3 1/5] perf/x86/intel: fix event update for auto-reload

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