Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-20 Thread Alexei Starovoitov
On Tue, Apr 20, 2021 at 9:52 AM Jiri Olsa wrote: > > On Tue, Apr 20, 2021 at 08:33:43AM -0700, Alexei Starovoitov wrote: > > On Tue, Apr 20, 2021 at 5:51 AM Jiri Olsa wrote: > > > > > > On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote: > > > > On Sat, 17 Apr 2021 00:03:04 +0900 > >

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-20 Thread Jiri Olsa
On Tue, Apr 20, 2021 at 08:33:43AM -0700, Alexei Starovoitov wrote: > On Tue, Apr 20, 2021 at 5:51 AM Jiri Olsa wrote: > > > > On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote: > > > On Sat, 17 Apr 2021 00:03:04 +0900 > > > Masami Hiramatsu wrote: > > > > > > > > Anyway, IIRC, Masam

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-20 Thread Steven Rostedt
On Tue, 20 Apr 2021 08:33:43 -0700 Alexei Starovoitov wrote: > I don't see how you can do it without BTF. I agree. > The mass-attach feature should prepare generic 6 or so arguments > from all functions it attached to. > On x86-64 it's trivial because 6 regs are the same. > On arm64 is now mo

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-20 Thread Alexei Starovoitov
On Tue, Apr 20, 2021 at 5:51 AM Jiri Olsa wrote: > > On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote: > > On Sat, 17 Apr 2021 00:03:04 +0900 > > Masami Hiramatsu wrote: > > > > > > Anyway, IIRC, Masami wasn't sure that the full regs was ever needed for > > > > the > > > > return (

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-20 Thread Jiri Olsa
On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote: > On Sat, 17 Apr 2021 00:03:04 +0900 > Masami Hiramatsu wrote: > > > > Anyway, IIRC, Masami wasn't sure that the full regs was ever needed for > > > the > > > return (who cares about the registers on return, except for the return >

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-19 Thread Andrii Nakryiko
On Fri, Apr 16, 2021 at 8:03 AM Masami Hiramatsu wrote: > > Hi, > > On Thu, 15 Apr 2021 17:00:07 -0400 > Steven Rostedt wrote: > > > > > [ > > Added Masami, as I didn't realize he wasn't on Cc. He's the maintainer of > > kretprobes. > > > > Masami, you may want to use lore.kernel.org to rea

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-19 Thread Steven Rostedt
On Mon, 19 Apr 2021 22:51:46 +0200 Jiri Olsa wrote: > now, it looks like the fgraph_ops entry callback does not have access > to registers.. once we have that, we could store arguments for the exit > callback and have all in place.. could this be added? ;-) Sure. The only problem is that we need

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-19 Thread Jiri Olsa
On Thu, Apr 15, 2021 at 07:30:32PM -0400, Steven Rostedt wrote: > On Thu, 15 Apr 2021 23:49:43 +0200 > Jiri Olsa wrote: > > > > right, I quickly checked on that and it looks exactly like > > the thing we need > > > > I'll try to rebase that on the current code and try to use > > it with the bpf

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-19 Thread Masami Hiramatsu
On Fri, 16 Apr 2021 12:48:34 -0400 Steven Rostedt wrote: > On Sat, 17 Apr 2021 00:03:04 +0900 > Masami Hiramatsu wrote: > > > > Anyway, IIRC, Masami wasn't sure that the full regs was ever needed for > > > the > > > return (who cares about the registers on return, except for the return > > > v

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-16 Thread Steven Rostedt
On Sat, 17 Apr 2021 00:03:04 +0900 Masami Hiramatsu wrote: > > Anyway, IIRC, Masami wasn't sure that the full regs was ever needed for the > > return (who cares about the registers on return, except for the return > > value?) > > I think kretprobe and ftrace are for a bit different usage. kret

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-16 Thread Masami Hiramatsu
Hi, On Thu, 15 Apr 2021 17:00:07 -0400 Steven Rostedt wrote: > > [ > Added Masami, as I didn't realize he wasn't on Cc. He's the maintainer of > kretprobes. > > Masami, you may want to use lore.kernel.org to read the history of this > thread. > ] > > On Thu, 15 Apr 2021 13:45:06 -0700

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Steven Rostedt
On Thu, 15 Apr 2021 23:49:43 +0200 Jiri Olsa wrote: > right, I quickly checked on that and it looks exactly like > the thing we need > > I'll try to rebase that on the current code and try to use > it with the bpf ftrace probe to see how it fits > > any chance you could plan on reposting it? ;

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Jiri Olsa
On Thu, Apr 15, 2021 at 02:21:20PM -0400, Steven Rostedt wrote: > On Thu, 15 Apr 2021 14:18:31 -0400 > Steven Rostedt wrote: > > > My last release of that code is here: > > > > https://lore.kernel.org/lkml/20190525031633.811342...@goodmis.org/ > > > > It allows you to "reserve data" to pass f

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Steven Rostedt
[ Added Masami, as I didn't realize he wasn't on Cc. He's the maintainer of kretprobes. Masami, you may want to use lore.kernel.org to read the history of this thread. ] On Thu, 15 Apr 2021 13:45:06 -0700 Andrii Nakryiko wrote: > > I don't know how the BPF code does it, but if you are

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Andrii Nakryiko
On Thu, Apr 15, 2021 at 8:10 AM Steven Rostedt wrote: > > On Wed, 14 Apr 2021 15:46:49 -0700 > Andrii Nakryiko wrote: > > > On Wed, Apr 14, 2021 at 5:19 AM Jiri Olsa wrote: > > > > > > On Tue, Apr 13, 2021 at 06:04:05PM -0700, Andrii Nakryiko wrote: > > > > On Tue, Apr 13, 2021 at 7:57 AM Jiri O

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Yonghong Song
On 4/15/21 11:18 AM, Steven Rostedt wrote: On Thu, 15 Apr 2021 19:39:45 +0200 Jiri Olsa wrote: I don't know how the BPF code does it, but if you are tracing the exit of a function, I'm assuming that you hijack the return pointer and replace it with a call to a trampoline that has access to

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Steven Rostedt
On Thu, 15 Apr 2021 14:18:31 -0400 Steven Rostedt wrote: > My last release of that code is here: > > https://lore.kernel.org/lkml/20190525031633.811342...@goodmis.org/ > > It allows you to "reserve data" to pass from the caller to the return, and > that could hold the arguments. See patch 15

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Steven Rostedt
On Thu, 15 Apr 2021 19:39:45 +0200 Jiri Olsa wrote: > > I don't know how the BPF code does it, but if you are tracing the exit > > of a function, I'm assuming that you hijack the return pointer and replace > > it with a call to a trampoline that has access to the arguments. To do > > hi, > it'

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Jiri Olsa
On Thu, Apr 15, 2021 at 11:10:02AM -0400, Steven Rostedt wrote: SNIP > > > heya, > > > I had some initial prototypes trying this way, but always ended up > > > in complicated code, that's why I turned to ftrace_ops. > > > > > > let's see if it'll make any sense to you ;-) > > > > > > 1) so let's

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Steven Rostedt
On Wed, 14 Apr 2021 15:46:49 -0700 Andrii Nakryiko wrote: > On Wed, Apr 14, 2021 at 5:19 AM Jiri Olsa wrote: > > > > On Tue, Apr 13, 2021 at 06:04:05PM -0700, Andrii Nakryiko wrote: > > > On Tue, Apr 13, 2021 at 7:57 AM Jiri Olsa wrote: > > > > > > > > hi, > > > > sending another attempt on

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Jiri Olsa
On Wed, Apr 14, 2021 at 03:46:49PM -0700, Andrii Nakryiko wrote: > On Wed, Apr 14, 2021 at 5:19 AM Jiri Olsa wrote: > > > > On Tue, Apr 13, 2021 at 06:04:05PM -0700, Andrii Nakryiko wrote: > > > On Tue, Apr 13, 2021 at 7:57 AM Jiri Olsa wrote: > > > > > > > > hi, > > > > sending another attempt o

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-14 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 5:19 AM Jiri Olsa wrote: > > On Tue, Apr 13, 2021 at 06:04:05PM -0700, Andrii Nakryiko wrote: > > On Tue, Apr 13, 2021 at 7:57 AM Jiri Olsa wrote: > > > > > > hi, > > > sending another attempt on speeding up load of multiple probes > > > for bpftrace and possibly other too

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-14 Thread Jiri Olsa
On Tue, Apr 13, 2021 at 06:04:05PM -0700, Andrii Nakryiko wrote: > On Tue, Apr 13, 2021 at 7:57 AM Jiri Olsa wrote: > > > > hi, > > sending another attempt on speeding up load of multiple probes > > for bpftrace and possibly other tools (first post in [1]). > > > > This patchset adds support to at

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-13 Thread Andrii Nakryiko
On Tue, Apr 13, 2021 at 7:57 AM Jiri Olsa wrote: > > hi, > sending another attempt on speeding up load of multiple probes > for bpftrace and possibly other tools (first post in [1]). > > This patchset adds support to attach bpf program directly to > ftrace probe as suggested by Steven and it speed

[PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-13 Thread Jiri Olsa
hi, sending another attempt on speeding up load of multiple probes for bpftrace and possibly other tools (first post in [1]). This patchset adds support to attach bpf program directly to ftrace probe as suggested by Steven and it speeds up loading for bpftrace commands like: # bpftrace -e 'kfu