Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-18 Thread Steven Rostedt
On Mon, 18 Apr 2016 18:15:04 -0700 Alexei Starovoitov wrote: > On 4/18/16 3:16 PM, Steven Rostedt wrote: > Yes. That what I referred to in below 'a struct to pass args'... > But, fine, will try to optimize the size further. > Frankly much bigger .text savings will come from combining > trace_eve

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-18 Thread Alexei Starovoitov
On 4/18/16 3:16 PM, Steven Rostedt wrote: On Mon, 18 Apr 2016 14:43:07 -0700 Alexei Starovoitov wrote: I was worried about this too, but single 'if' and two calls (as in commit 98b5c2c65c295) is a better way, since it's faster, cleaner and doesn't need to refactor the whole perf_trace_buf_sub

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-18 Thread Steven Rostedt
On Mon, 18 Apr 2016 14:43:07 -0700 Alexei Starovoitov wrote: > I was worried about this too, but single 'if' and two calls > (as in commit 98b5c2c65c295) is a better way, since it's faster, cleaner > and doesn't need to refactor the whole perf_trace_buf_submit() to pass > extra event_call argume

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-18 Thread Alexei Starovoitov
On 4/18/16 1:29 PM, Steven Rostedt wrote: On Mon, 4 Apr 2016 21:52:48 -0700 Alexei Starovoitov wrote: introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be attached to tracepoints. The tracepoint will copy the arguments in the per-cpu buffer and pass it to the bpf program as its f

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-18 Thread Steven Rostedt
On Mon, 4 Apr 2016 21:52:48 -0700 Alexei Starovoitov wrote: > introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be > attached to tracepoints. > The tracepoint will copy the arguments in the per-cpu buffer and pass > it to the bpf program as its first argument. > The layout of the fi

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-05 Thread Alexei Starovoitov
On 4/5/16 11:16 AM, Peter Zijlstra wrote: On Tue, Apr 05, 2016 at 11:09:30AM -0700, Alexei Starovoitov wrote: @@ -67,6 +69,14 @@ perf_trace_##call(void *__data, proto) \ \ { ass

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-05 Thread Peter Zijlstra
On Tue, Apr 05, 2016 at 11:09:30AM -0700, Alexei Starovoitov wrote: > >>@@ -67,6 +69,14 @@ perf_trace_##call(void *__data, proto) > >>\ > >>\ > >>{ assign; }

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-05 Thread Alexei Starovoitov
On 4/5/16 7:18 AM, Peter Zijlstra wrote: On Mon, Apr 04, 2016 at 09:52:48PM -0700, Alexei Starovoitov wrote: introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be attached to tracepoints. More specifically the perf tracepoint handler, not tracepoints directly. yes. perf tracepoi

Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-05 Thread Peter Zijlstra
On Mon, Apr 04, 2016 at 09:52:48PM -0700, Alexei Starovoitov wrote: > introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be > attached to tracepoints. More specifically the perf tracepoint handler, not tracepoints directly. > The tracepoint will copy the arguments in the per-cpu buff

[PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints

2016-04-04 Thread Alexei Starovoitov
introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be attached to tracepoints. The tracepoint will copy the arguments in the per-cpu buffer and pass it to the bpf program as its first argument. The layout of the fields can be discovered by doing 'cat /sys/kernel/debug/tracing/events/sc