Re: [PATCH V5 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-26 Thread xiakaixu
于 2015/10/23 23:12, Peter Zijlstra 写道: > On Fri, Oct 23, 2015 at 02:52:11PM +0200, Peter Zijlstra wrote: >> On Thu, Oct 22, 2015 at 06:28:22PM +0800, Wangnan (F) wrote: >>> information to analysis when glitch happen. Another way we are trying to >>> implement >>> now is to dynamically turn events o

Re: [PATCH V5 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-21 Thread xiakaixu
于 2015/10/21 17:12, Peter Zijlstra 写道: > On Tue, Oct 20, 2015 at 03:53:02PM -0700, Alexei Starovoitov wrote: >> On 10/20/15 12:22 AM, Kaixu Xia wrote: >>> diff --git a/kernel/events/core.c b/kernel/events/core.c >>> index b11756f..5219635 100644 >>> --- a/kernel/events/core.c >>> +++ b/kernel/event

Re: [PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread xiakaixu
于 2015/10/20 10:14, Alexei Starovoitov 写道: > On 10/19/15 3:37 AM, Kaixu Xia wrote: >> +/* flags for PERF_EVENT_ARRAY maps*/ >> +enum { >> +BPF_EVENT_CTL_BIT_CUR = 0, >> +BPF_EVENT_CTL_BIT_ALL = 1, >> +__NR_BPF_EVENT_CTL_BITS, >> +}; >> + >> +#defineBPF_CTL_BIT_FLAG_MASK \ >> +((

Re: [PATCH V3 1/2] bpf: control the trace data output on current cpu when perf sampling

2015-10-18 Thread xiakaixu
于 2015/10/17 6:06, Alexei Starovoitov 写道: > On 10/16/15 12:42 AM, Kaixu Xia wrote: >> This patch adds the flag dump_enable to control the trace data >> output process when perf sampling. By setting this flag and >> integrating with ebpf, we can control the data output process and >> get the samples

Re: [PATCH V3 1/2] bpf: control the trace data output on current cpu when perf sampling

2015-10-18 Thread xiakaixu
于 2015/10/17 6:06, Alexei Starovoitov 写道: > On 10/16/15 12:42 AM, Kaixu Xia wrote: >> This patch adds the flag dump_enable to control the trace data >> output process when perf sampling. By setting this flag and >> integrating with ebpf, we can control the data output process and >> get the samples

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 = &enabler_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/k

Re: [RFC PATCH 1/2] perf: Add the flag sample_disable not to output data on samples

2015-10-12 Thread xiakaixu
于 2015/10/13 3:20, Alexei Starovoitov 写道: > On 10/12/15 2:02 AM, Kaixu Xia wrote: >> diff --git a/include/linux/bpf.h b/include/linux/bpf.h >> index f57d7fe..25e073d 100644 >> --- a/include/linux/bpf.h >> +++ b/include/linux/bpf.h >> @@ -39,6 +39,7 @@ struct bpf_map { >> u32 max_entries; >>

Re: [PATCH v2 net-next] bpf: s390: Fix build error caused by the struct bpf_array member name changed

2015-08-11 Thread xiakaixu
于 2015/8/11 16:24, Daniel Borkmann 写道: > On 08/11/2015 08:53 AM, Kaixu Xia wrote: >> There is a build error that "'struct bpf_array' has no member >> named 'prog'" on s390. In commit 2a36f0b, the member 'prog' of >> struct bpf_array is replaced by 'ptrs'. So this patch fixes it. >> >> Signed-off-by

Re: [PATCH v6 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-05 Thread xiakaixu
于 2015/8/5 21:53, Peter Zijlstra 写道: > On Wed, Aug 05, 2015 at 12:04:25PM +0200, Peter Zijlstra wrote: >> Also, you probably want a WARN_ON(in_nmi()) there, this function is >> _NOT_ NMI safe. > > I had a wee think about that, and I think the below is safe. > > (with the obvious problem that WARN

Re: [PATCH v6 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-05 Thread xiakaixu
于 2015/8/5 18:04, Peter Zijlstra 写道: > On Tue, Aug 04, 2015 at 08:58:15AM +, Kaixu Xia wrote: >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> index 6251b53..726ca1b 100644 >> --- a/kernel/events/core.c >> +++ b/kernel/events/core.c >> @@ -8599,6 +8599,25 @@ struct perf_event_attr

Re: [PATCH v6 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-04 Thread xiakaixu
于 2015/8/5 1:55, Alexei Starovoitov 写道: > On 8/4/15 1:58 AM, Kaixu Xia wrote: >> +static int check_func_limit(struct bpf_map **mapp, int func_id) > > how about 'check_map_func_compatibility' or 'check_map_func_affinity' ? > >> +{ >> +struct bpf_map *map = *mapp; > > why pass pointer to a poi