Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-04-07 Thread Wangnan (F)
On 2016/3/29 22:04, Peter Zijlstra wrote: On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: Could you maybe write a perf/tests thingy for this so that _some_ userspace exists that exercises this new code? Yes. Please see: http://lkml.kernel.org/r/1460022180-61262-1-git-send-email-

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-04-05 Thread Wangnan (F)
On 2016/3/30 10:38, Wangnan (F) wrote: On 2016/3/30 10:28, Wangnan (F) wrote: On 2016/3/29 22:04, Peter Zijlstra wrote: On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: Could you maybe write a perf/tests thingy for this so that _some_ userspace exists that exercises this new cod

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-29 Thread Wangnan (F)
On 2016/3/30 10:28, Wangnan (F) wrote: On 2016/3/29 22:04, Peter Zijlstra wrote: On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: Could you maybe write a perf/tests thingy for this so that _some_ userspace exists that exercises this new code? int perf_output_begin(struct perf_

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-29 Thread Wangnan (F)
On 2016/3/29 22:04, Peter Zijlstra wrote: On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: Could you maybe write a perf/tests thingy for this so that _some_ userspace exists that exercises this new code? int perf_output_begin(struct perf_output_handle *handle,

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-29 Thread Peter Zijlstra
On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: Could you maybe write a perf/tests thingy for this so that _some_ userspace exists that exercises this new code? > int perf_output_begin(struct perf_output_handle *handle, > struct perf_event *event, unsigned int size

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-28 Thread Wangnan (F)
On 2016/3/29 12:59, Alexei Starovoitov wrote: On Tue, Mar 29, 2016 at 10:01:24AM +0800, Wangnan (F) wrote: On 2016/3/28 14:41, Wang Nan wrote: [SNIP] To prevent this problem, we need to find a way to ensure the ring buffer is stable during reading. ioctl(PERF_EVENT_IOC_PAUSE_OUTPUT) is sug

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-28 Thread Alexei Starovoitov
On Tue, Mar 29, 2016 at 10:01:24AM +0800, Wangnan (F) wrote: > > > On 2016/3/28 14:41, Wang Nan wrote: > > [SNIP] > > > > >To prevent this problem, we need to find a way to ensure the ring buffer > >is stable during reading. ioctl(PERF_EVENT_IOC_PAUSE_OUTPUT) is > >suggested because its overhea

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-28 Thread Wangnan (F)
On 2016/3/28 14:41, Wang Nan wrote: [SNIP] To prevent this problem, we need to find a way to ensure the ring buffer is stable during reading. ioctl(PERF_EVENT_IOC_PAUSE_OUTPUT) is suggested because its overhead is lower than ioctl(PERF_EVENT_IOC_ENABLE). Add comment: By carefully verifyi

Re: [PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-28 Thread Alexei Starovoitov
On Mon, Mar 28, 2016 at 06:41:32AM +, Wang Nan wrote: > This patch introduces 'write_backward' bit to perf_event_attr, which > controls the direction of a ring buffer. After set, the corresponding > ring buffer is written from end to beginning. This feature is design to > support reading from o

[PATCH 4/4] perf core: Add backward attribute to perf event

2016-03-27 Thread Wang Nan
This patch introduces 'write_backward' bit to perf_event_attr, which controls the direction of a ring buffer. After set, the corresponding ring buffer is written from end to beginning. This feature is design to support reading from overwritable ring buffer. Ring buffer can be created by mapping a