Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-28 Thread Steven Rostedt
On Tue, 27 Mar 2018 17:51:55 -0700 Alexei Starovoitov wrote: > Turned out it was in init.data section and got poisoned. > this fixes it: > @@ -258,6 +258,7 @@ > LIKELY_PROFILE()\ > BRANCH_PROFILE()

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Alexei Starovoitov
On 3/27/18 5:44 PM, Mathieu Desnoyers wrote: - On Mar 27, 2018, at 8:00 PM, Alexei Starovoitov a...@fb.com wrote: On 3/27/18 4:13 PM, Mathieu Desnoyers wrote: - On Mar 27, 2018, at 6:48 PM, Alexei Starovoitov a...@fb.com wrote: On 3/27/18 2:04 PM, Steven Rostedt wrote: +#ifdef

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 8:00 PM, Alexei Starovoitov a...@fb.com wrote: > On 3/27/18 4:13 PM, Mathieu Desnoyers wrote: >> - On Mar 27, 2018, at 6:48 PM, Alexei Starovoitov a...@fb.com wrote: >> >>> On 3/27/18 2:04 PM, Steven Rostedt wrote: +#ifdef CONFIG_BPF_EVENTS +#define

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Alexei Starovoitov
On 3/27/18 4:13 PM, Mathieu Desnoyers wrote: - On Mar 27, 2018, at 6:48 PM, Alexei Starovoitov a...@fb.com wrote: On 3/27/18 2:04 PM, Steven Rostedt wrote: +#ifdef CONFIG_BPF_EVENTS +#define BPF_RAW_TP() . = ALIGN(8); \ Given that the section consists of a 16-bytes

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 6:48 PM, Alexei Starovoitov a...@fb.com wrote: > On 3/27/18 2:04 PM, Steven Rostedt wrote: >> >> +#ifdef CONFIG_BPF_EVENTS >> +#define BPF_RAW_TP() . = ALIGN(8); \ Given that the section consists of a 16-bytes structure elements on architectures with 8 bytes

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Alexei Starovoitov
On 3/27/18 2:04 PM, Steven Rostedt wrote: +#ifdef CONFIG_BPF_EVENTS +#define BPF_RAW_TP() . = ALIGN(8); \ +VMLINUX_SYMBOL(__start__bpf_raw_tp) = .; \ +KEEP(*(__bpf_raw_tp_map)) \ +

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 14:58:24 -0400 Steven Rostedt wrote: > +extern struct bpf_raw_event_map *__start__bpf_raw_tp[]; > +extern struct bpf_raw_event_map *__stop__bpf_raw_tp[]; > + > +struct bpf_raw_event_map *bpf_find_raw_tracepoint(const char *name) > +{ > + struct

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
[ Added Andrew Morton too ] On Tue, 27 Mar 2018 15:00:41 -0400 Steven Rostedt wrote: > On Tue, 27 Mar 2018 11:45:34 -0700 > Alexei Starovoitov wrote: > > > >> + > > >> +snprintf(buf, sizeof(buf), "__bpf_trace_%s", tp->name); > > >> +addr =

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 15:00:41 -0400 Steven Rostedt wrote: > > Wasting extra 8bytes * number_of_tracepoints just for lack of trust > > in kallsyms doesn't sound like good trade off to me. > > If kallsyms are inaccurate all sorts of things will break: > > kprobes, livepatch,

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Mathieu Desnoyers
- On Mar 27, 2018, at 3:00 PM, rostedt rost...@goodmis.org wrote: > On Tue, 27 Mar 2018 11:45:34 -0700 > Alexei Starovoitov wrote: > >> >> + >> >> + snprintf(buf, sizeof(buf), "__bpf_trace_%s", tp->name); >> >> + addr = kallsyms_lookup_name(buf); >> >> + if (!addr) >> >> +

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 11:45:34 -0700 Alexei Starovoitov wrote: > >> + > >> + snprintf(buf, sizeof(buf), "__bpf_trace_%s", tp->name); > >> + addr = kallsyms_lookup_name(buf); > >> + if (!addr) > >> + return -ENOENT; > >> + > >> + return tracepoint_probe_register(tp, (void

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 13:11:43 -0400 Steven Rostedt wrote: > On Tue, 27 Mar 2018 13:02:11 -0400 > Steven Rostedt wrote: > > > Honestly, I think this is too much of a short cut and a hack. I know > > you want to keep it "simple" and save space, but you

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Alexei Starovoitov
On 3/27/18 10:02 AM, Steven Rostedt wrote: On Mon, 26 Mar 2018 19:47:03 -0700 Alexei Starovoitov wrote: Ctrl-C of tracing daemon or cmdline tool that uses this feature will automatically detach bpf program, unload it and unregister tracepoint probe. On the kernel side

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Tue, 27 Mar 2018 13:02:11 -0400 Steven Rostedt wrote: > Honestly, I think this is too much of a short cut and a hack. I know > you want to keep it "simple" and save space, but you really should do > it the same way ftrace and perf do it. That is, create a section and >

Re: [PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-27 Thread Steven Rostedt
On Mon, 26 Mar 2018 19:47:03 -0700 Alexei Starovoitov wrote: > Ctrl-C of tracing daemon or cmdline tool that uses this feature > will automatically detach bpf program, unload it and > unregister tracepoint probe. > > On the kernel side for_each_kernel_tracepoint() is used You

[PATCH v6 bpf-next 08/11] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-26 Thread Alexei Starovoitov
From: Alexei Starovoitov Introduce BPF_PROG_TYPE_RAW_TRACEPOINT bpf program type to access kernel internal arguments of the tracepoints in their raw form. >From bpf program point of view the access to the arguments look like: struct bpf_raw_tracepoint_args { __u64