Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Mathieu Desnoyers
- On Mar 28, 2018, at 3:38 PM, rostedt rost...@goodmis.org wrote: > On Wed, 28 Mar 2018 15:32:20 -0400 > Steven Rostedt wrote: > >> -#define __DO_TRACE(tp, proto, args, cond, rcucheck) \ >> +#define __DO_TRACE(name, proto, args, cond, rcucheck) >> \ >>

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 15:32:20 -0400 Steven Rostedt wrote: > -#define __DO_TRACE(tp, proto, args, cond, rcucheck) \ > +#define __DO_TRACE(name, proto, args, cond, rcucheck) > \ > do {\ >

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 15:22:24 -0400 (EDT) Mathieu Desnoyers wrote: > > > cache hot/cold argument clearly doesn't apply. > > In the current situation I'm fine with adding this extra field > to struct tracepoint. However, we should keep in mind to move > all non-required cache-cold fields to a se

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Alexei Starovoitov
On 3/28/18 12:22 PM, Mathieu Desnoyers wrote: - On Mar 28, 2018, at 2:54 PM, rostedt rost...@goodmis.org wrote: On Wed, 28 Mar 2018 11:19:34 -0700 Alexei Starovoitov wrote: On 3/28/18 11:10 AM, Steven Rostedt wrote: On Wed, 28 Mar 2018 11:03:24 -0700 Alexei Starovoitov wrote: I can

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Mathieu Desnoyers
- On Mar 28, 2018, at 2:54 PM, rostedt rost...@goodmis.org wrote: > On Wed, 28 Mar 2018 11:19:34 -0700 > Alexei Starovoitov wrote: > >> On 3/28/18 11:10 AM, Steven Rostedt wrote: >> > On Wed, 28 Mar 2018 11:03:24 -0700 >> > Alexei Starovoitov wrote: >> > >> >> I can live with this overhe

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 11:19:34 -0700 Alexei Starovoitov wrote: > On 3/28/18 11:10 AM, Steven Rostedt wrote: > > On Wed, 28 Mar 2018 11:03:24 -0700 > > Alexei Starovoitov wrote: > > > >> I can live with this overhead if Mathieu insists, > >> but I prefer to keep it in 'struct tracepoint'. > >> >

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Alexei Starovoitov
On 3/28/18 11:10 AM, Steven Rostedt wrote: On Wed, 28 Mar 2018 11:03:24 -0700 Alexei Starovoitov wrote: I can live with this overhead if Mathieu insists, but I prefer to keep it in 'struct tracepoint'. Thoughts? I'm fine with keeping it as is. We could probably use it for future enhancement

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 11:03:24 -0700 Alexei Starovoitov wrote: > I can live with this overhead if Mathieu insists, > but I prefer to keep it in 'struct tracepoint'. > > Thoughts? I'm fine with keeping it as is. We could probably use it for future enhancements in perf and ftrace. Perhaps, we shou

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Alexei Starovoitov
On 3/28/18 10:38 AM, Steven Rostedt wrote: On Wed, 28 Mar 2018 10:10:34 -0700 Alexei Starovoitov wrote: and have: u64 tp_offset = (u64)tp - (u64)_sdata; if (WARN_ON(tp_offset > UINT_MAX) return -EINVAL; btp->tp_offset = (u32)tp_offset; above math

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 10:10:34 -0700 Alexei Starovoitov wrote: > > and have: > > > > u64 tp_offset = (u64)tp - (u64)_sdata; > > > > if (WARN_ON(tp_offset > UINT_MAX) > > return -EINVAL; > > > > btp->tp_offset = (u32)tp_offset; > > above math has to be build time constan

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Mathieu Desnoyers
- On Mar 28, 2018, at 12:43 PM, Alexei Starovoitov a...@fb.com wrote: > On 3/28/18 6:49 AM, Mathieu Desnoyers wrote: >> - On Mar 27, 2018, at 10:11 PM, Alexei Starovoitov a...@fb.com wrote: >> >>> From: Alexei Starovoitov >>> >>> compute number of arguments passed into tracepoint >>> at c

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Alexei Starovoitov
On 3/28/18 10:04 AM, Steven Rostedt wrote: On Wed, 28 Mar 2018 09:43:56 -0700 Alexei Starovoitov wrote: Given that only eBPF needs this parameter count, we can move it to the struct bpf_raw_event_map newly introduced by Steven, right ? This would reduce bloat of struct tracepoint. For instance

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Steven Rostedt
On Wed, 28 Mar 2018 09:43:56 -0700 Alexei Starovoitov wrote: > > > > Given that only eBPF needs this parameter count, we can move > > it to the struct bpf_raw_event_map newly introduced by Steven, > > right ? This would reduce bloat of struct tracepoint. For instance, > > we don't need to keep thi

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Alexei Starovoitov
On 3/28/18 6:49 AM, Mathieu Desnoyers wrote: - On Mar 27, 2018, at 10:11 PM, Alexei Starovoitov a...@fb.com wrote: From: Alexei Starovoitov compute number of arguments passed into tracepoint at compile time and store it as part of 'struct tracepoint'. The number is necessary to check safe

Re: [PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-28 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 10:11 PM, Alexei Starovoitov a...@fb.com wrote: > From: Alexei Starovoitov > > compute number of arguments passed into tracepoint > at compile time and store it as part of 'struct tracepoint'. > The number is necessary to check safety of bpf program access that > is com

[PATCH v7 bpf-next 06/10] tracepoint: compute num_args at build time

2018-03-27 Thread Alexei Starovoitov
From: Alexei Starovoitov compute number of arguments passed into tracepoint at compile time and store it as part of 'struct tracepoint'. The number is necessary to check safety of bpf program access that is coming in subsequent patch. Signed-off-by: Alexei Starovoitov Reviewed-by: Steven Rosted