Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-02 Thread Alexei Starovoitov
On 7/2/15 2:24 AM, Wangnan (F) wrote: Yes, by using perf_trace_buf_prepare() + perf_trace_buf_submit() in helper function and let bpf program always returns 0 we can make data collected by BPF programs output into samples, if following problems are solved: 1. In bpf program there's no way to g

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-02 Thread Peter Zijlstra
On Wed, Jul 01, 2015 at 07:48:25PM -0700, Alexei Starovoitov wrote: > On 7/1/15 4:58 AM, Peter Zijlstra wrote: > > > >But why create a separate trace buffer, it should go into the regular > >perf buffer. > > +1 > > I think > +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; > is redu

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-02 Thread Wangnan (F)
On 2015/7/2 11:52, Alexei Starovoitov wrote: On 7/1/15 8:38 PM, He Kuang wrote: On 2015/7/2 10:48, Alexei Starovoitov wrote: On 7/1/15 4:58 AM, Peter Zijlstra wrote: But why create a separate trace buffer, it should go into the regular perf buffer. +1 I think +static char __percpu *per

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-01 Thread Alexei Starovoitov
On 7/1/15 8:38 PM, He Kuang wrote: On 2015/7/2 10:48, Alexei Starovoitov wrote: On 7/1/15 4:58 AM, Peter Zijlstra wrote: But why create a separate trace buffer, it should go into the regular perf buffer. +1 I think +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; is redundan

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-01 Thread He Kuang
On 2015/7/2 10:48, Alexei Starovoitov wrote: On 7/1/15 4:58 AM, Peter Zijlstra wrote: But why create a separate trace buffer, it should go into the regular perf buffer. +1 I think +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; is redundant. It adds quite a bit of unnecessar

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-01 Thread Alexei Starovoitov
On 7/1/15 4:58 AM, Peter Zijlstra wrote: But why create a separate trace buffer, it should go into the regular perf buffer. +1 I think +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; is redundant. It adds quite a bit of unnecessary complexity to the whole patch set. Also the c

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-01 Thread Peter Zijlstra
On Wed, Jul 01, 2015 at 02:21:11PM +0800, Wangnan (F) wrote: > > > On 2015/7/1 13:44, Peter Zijlstra wrote: > >On Wed, Jul 01, 2015 at 02:57:30AM +, He Kuang wrote: > >>This patch adds an extra perf trace buffer for other utilities like > >>bpf to fill extra data to perf events. > >What!, why

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-06-30 Thread Wangnan (F)
On 2015/7/1 13:44, Peter Zijlstra wrote: On Wed, Jul 01, 2015 at 02:57:30AM +, He Kuang wrote: This patch adds an extra perf trace buffer for other utilities like bpf to fill extra data to perf events. What!, why? The goal of this patchset is to give BPF program a mean to output someth

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-06-30 Thread Peter Zijlstra
On Wed, Jul 01, 2015 at 02:57:30AM +, He Kuang wrote: > This patch adds an extra perf trace buffer for other utilities like > bpf to fill extra data to perf events. What!, why? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger

[RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-06-30 Thread He Kuang
The idea to let eBPF output data to perf sample event was first metioned in "[RFC PATCH v4 10/29] bpf tools: Collect map definitions from 'maps' section", and the output data is not limited to PMU counters but data like time latencies, cache misses or other things users want to record. This patch