Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 11:28 AM, joel opensrc joel.open...@gmail.com wrote: > On Tue, Mar 27, 2018 at 6:27 AM, Mathieu Desnoyers > wrote: > +static void find_tp(struct tracepoint *tp, void *priv) +{ + struct tp_find_args *args = priv;

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 11:28 AM, joel opensrc joel.open...@gmail.com wrote: > On Tue, Mar 27, 2018 at 6:27 AM, Mathieu Desnoyers > wrote: > +static void find_tp(struct tracepoint *tp, void *priv) +{ + struct tp_find_args *args = priv; + + if

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Joel Fernandes (Google)
On Tue, Mar 27, 2018 at 6:27 AM, Mathieu Desnoyers wrote: >>> +static void find_tp(struct tracepoint *tp, void *priv) >>> +{ >>> + struct tp_find_args *args = priv; >>> + >>> + if (!strcmp(tp->name, args->name)) { >>> +

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Joel Fernandes (Google)
On Tue, Mar 27, 2018 at 6:27 AM, Mathieu Desnoyers wrote: >>> +static void find_tp(struct tracepoint *tp, void *priv) >>> +{ >>> + struct tp_find_args *args = priv; >>> + >>> + if (!strcmp(tp->name, args->name)) { >>> + WARN_ON_ONCE(args->tp); >>> +

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Mathieu Desnoyers
- On Mar 26, 2018, at 9:35 PM, joel opensrc joel.open...@gmail.com wrote: > Hi Mathieu, Hi Joel, > > On Mon, Mar 26, 2018 at 12:10 PM, Mathieu Desnoyers > wrote: >> Provide an API allowing eBPF to lookup core kernel tracepoints by name. >> >> Given that a

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Mathieu Desnoyers
- On Mar 26, 2018, at 9:35 PM, joel opensrc joel.open...@gmail.com wrote: > Hi Mathieu, Hi Joel, > > On Mon, Mar 26, 2018 at 12:10 PM, Mathieu Desnoyers > wrote: >> Provide an API allowing eBPF to lookup core kernel tracepoints by name. >> >> Given that a lookup by name explicitly

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Joel Fernandes (Google)
Hi Mathieu, On Mon, Mar 26, 2018 at 12:10 PM, Mathieu Desnoyers wrote: > Provide an API allowing eBPF to lookup core kernel tracepoints by name. > > Given that a lookup by name explicitly requires tracepoint definitions > to be unique for a given name (no

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Joel Fernandes (Google)
Hi Mathieu, On Mon, Mar 26, 2018 at 12:10 PM, Mathieu Desnoyers wrote: > Provide an API allowing eBPF to lookup core kernel tracepoints by name. > > Given that a lookup by name explicitly requires tracepoint definitions > to be unique for a given name (no duplicate keys), include a >

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Steven Rostedt
On Mon, 26 Mar 2018 13:48:36 -0700 Alexei Starovoitov wrote: > > Mathieu, that's not enough. > Commit log is also wrong. > It needs to state that something like this is needed only because > changing for_each_tracepoint_range() semantics will break lttng. > I'll

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Steven Rostedt
On Mon, 26 Mar 2018 13:48:36 -0700 Alexei Starovoitov wrote: > > Mathieu, that's not enough. > Commit log is also wrong. > It needs to state that something like this is needed only because > changing for_each_tracepoint_range() semantics will break lttng. > I'll post a follow up patch shortly.

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Alexei Starovoitov
On Mon, Mar 26, 2018 at 03:10:31PM -0400, Mathieu Desnoyers wrote: > Provide an API allowing eBPF to lookup core kernel tracepoints by name. > > Given that a lookup by name explicitly requires tracepoint definitions > to be unique for a given name (no duplicate keys), include a > WARN_ON_ONCE()

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Alexei Starovoitov
On Mon, Mar 26, 2018 at 03:10:31PM -0400, Mathieu Desnoyers wrote: > Provide an API allowing eBPF to lookup core kernel tracepoints by name. > > Given that a lookup by name explicitly requires tracepoint definitions > to be unique for a given name (no duplicate keys), include a > WARN_ON_ONCE()

[RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Mathieu Desnoyers
Provide an API allowing eBPF to lookup core kernel tracepoints by name. Given that a lookup by name explicitly requires tracepoint definitions to be unique for a given name (no duplicate keys), include a WARN_ON_ONCE() check that only a single match is encountered at runtime. This should always

[RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Mathieu Desnoyers
Provide an API allowing eBPF to lookup core kernel tracepoints by name. Given that a lookup by name explicitly requires tracepoint definitions to be unique for a given name (no duplicate keys), include a WARN_ON_ONCE() check that only a single match is encountered at runtime. This should always