Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-10 Thread Yan, Zheng
On 07/10/2013 07:44 PM, Peter Zijlstra wrote: > On Wed, Jul 10, 2013 at 07:37:43PM +0800, Yan, Zheng wrote: >> On 07/08/2013 08:15 PM, Peter Zijlstra wrote: >>> On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: From: "Yan, Zheng" > before overwrite mode after

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-10 Thread Peter Zijlstra
On Wed, Jul 10, 2013 at 07:37:43PM +0800, Yan, Zheng wrote: > On 07/08/2013 08:15 PM, Peter Zijlstra wrote: > > On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: > >> From: "Yan, Zheng" > >> before overwrite mode after overwrite mode > >> AVG 1000999

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-10 Thread Yan, Zheng
On 07/08/2013 08:15 PM, Peter Zijlstra wrote: > On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: >> From: "Yan, Zheng" >> >> If perf event buffer is in overwrite mode, the kernel only updates >> the data head when it overwrites old samples. The program that owns >> the buffer need perio

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-09 Thread Peter Zijlstra
On Tue, Jul 09, 2013 at 09:52:17PM +0800, Yan, Zheng wrote: > On 07/09/2013 04:05 PM, Peter Zijlstra wrote: > > On Tue, Jul 09, 2013 at 03:05:41PM +0800, Yan, Zheng wrote: > > > >> Thank you for your help. I ran the same test, the results for regular case > >> are much better. But it still has abo

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-09 Thread Yan, Zheng
On 07/09/2013 04:05 PM, Peter Zijlstra wrote: > On Tue, Jul 09, 2013 at 03:05:41PM +0800, Yan, Zheng wrote: > >> Thank you for your help. I ran the same test, the results for regular case >> are much better. But it still has about 1% overhead, probably because we >> enlarge the ring_buffer structu

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-09 Thread Peter Zijlstra
On Tue, Jul 09, 2013 at 03:05:41PM +0800, Yan, Zheng wrote: > Thank you for your help. I ran the same test, the results for regular case > are much better. But it still has about 1% overhead, probably because we > enlarge the ring_buffer structure, make it less cache friendly. > > origin

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-09 Thread Peter Zijlstra
On Tue, Jul 09, 2013 at 03:18:20PM +0900, Namhyung Kim wrote: > Hi Peter, > > On Mon, 8 Jul 2013 14:15:57 +0200, Peter Zijlstra wrote: > [SNIP] > > +static void > > +perf_event_set_overflow(struct perf_event *event, struct ring_buffer *rb) > > +{ > > + if (event->overflow_handler != perf_event_

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-09 Thread Yan, Zheng
On 07/08/2013 08:15 PM, Peter Zijlstra wrote: > On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: >> From: "Yan, Zheng" >> >> If perf event buffer is in overwrite mode, the kernel only updates >> the data head when it overwrites old samples. The program that owns >> the buffer need perio

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-08 Thread Namhyung Kim
Hi Peter, On Mon, 8 Jul 2013 14:15:57 +0200, Peter Zijlstra wrote: [SNIP] > +static void > +perf_event_set_overflow(struct perf_event *event, struct ring_buffer *rb) > +{ > + if (event->overflow_handler != perf_event_output || I guess you wanted "&&" instead of "||" here. Thanks, Namhyung

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-07-08 Thread Peter Zijlstra
On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: > From: "Yan, Zheng" > > If perf event buffer is in overwrite mode, the kernel only updates > the data head when it overwrites old samples. The program that owns > the buffer need periodically check the buffer and update a variable > tha

Re: [PATCH] perf: Update event buffer tail when overwriting old events

2013-06-18 Thread Peter Zijlstra
On Thu, Jun 06, 2013 at 01:58:06PM +0800, Yan, Zheng wrote: > From: "Yan, Zheng" > > If perf event buffer is in overwrite mode, the kernel only updates > the data head when it overwrites old samples. The program that owns > the buffer need periodically check the buffer and update a variable > tha

[PATCH] perf: Update event buffer tail when overwriting old events

2013-06-05 Thread Yan, Zheng
From: "Yan, Zheng" If perf event buffer is in overwrite mode, the kernel only updates the data head when it overwrites old samples. The program that owns the buffer need periodically check the buffer and update a variable that tracks the date tail. If the program fails to do this in time, the dat

Re: [RFC PATCH] perf: Update event buffer tail when overwriting old events

2013-04-18 Thread Peter Zijlstra
On Mon, 2013-04-15 at 14:02 +0800, Yan, Zheng wrote: > From: "Yan, Zheng" > > If perf event buffer is in overwrite mode, the kernel only updates > the data head when it overwrites old samples. The program that owns > the buffer need periodically check the buffer and update a variable > that track

[RFC PATCH] perf: Update event buffer tail when overwriting old events

2013-04-14 Thread Yan, Zheng
From: "Yan, Zheng" If perf event buffer is in overwrite mode, the kernel only updates the data head when it overwrites old samples. The program that owns the buffer need periodically check the buffer and update a variable that tracks the date tail. If the program fails to do this in time, the dat