Re: [PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread xiakaixu
于 2015/10/15 5:28, Alexei Starovoitov 写道: > On 10/14/15 5:37 AM, Kaixu Xia wrote: >> +event->p_sample_disable = _event->sample_disable; > > I don't like it as a concept and it's buggy implementation. > What happens here when enabler is alive, but other event is destroyed? > >> ---

Re: [PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread Alexei Starovoitov
On 10/14/15 5:37 AM, Kaixu Xia wrote: + event->p_sample_disable = _event->sample_disable; I don't like it as a concept and it's buggy implementation. What happens here when enabler is alive, but other event is destroyed? --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@

[PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread Kaixu Xia
This patch creates a new ioctl PERF_EVENT_IOC_SET_ENABLER to let perf to select an event as 'enabler'. So we can set this 'enabler' event to enable/disable a set of events. The event on CPU 0 is treated as the 'enabler' event by default. Signed-off-by: Kaixu Xia --- include/linux/perf_event.h

Re: [PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread Alexei Starovoitov
On 10/14/15 5:37 AM, Kaixu Xia wrote: + event->p_sample_disable = _event->sample_disable; I don't like it as a concept and it's buggy implementation. What happens here when enabler is alive, but other event is destroyed? --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@

[PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread Kaixu Xia
This patch creates a new ioctl PERF_EVENT_IOC_SET_ENABLER to let perf to select an event as 'enabler'. So we can set this 'enabler' event to enable/disable a set of events. The event on CPU 0 is treated as the 'enabler' event by default. Signed-off-by: Kaixu Xia ---

Re: [PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread xiakaixu
于 2015/10/15 5:28, Alexei Starovoitov 写道: > On 10/14/15 5:37 AM, Kaixu Xia wrote: >> +event->p_sample_disable = _event->sample_disable; > > I don't like it as a concept and it's buggy implementation. > What happens here when enabler is alive, but other event is destroyed? > >> ---