netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC][PATCH 1/2] ftrace: Add modify_ftrace_direct()
       [not found]     ` <20191117171835.35af6c0e@gandalf.local.home>
@ 2019-11-19  6:04       ` Alexei Starovoitov
  2019-11-19 14:13         ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Alexei Starovoitov @ 2019-11-19  6:04 UTC (permalink / raw)
  To: Steven Rostedt, bpf, Network Development; +Cc: LKML, Ingo Molnar

On Sun, Nov 17, 2019 at 2:18 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 15 Nov 2019 13:51:26 -0800
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > Thanks a lot for implementing it.
> > Switching to iterator just to modify the call.. hmm.
> > So "call direct_bpf_A" gets replaced to "call ftrace_stub" to do the iterator
> > only to patch "call direct_bpf_B" later. I'm struggling to see why do that when
> > arch can provide call to call rewrite easily. x86 and others have such ability
> > already. I don't understand why you want to sacrifice simplicity here.
> > Anyway with all 3 apis (register, modify, unreg) it looks complete.
> > I'll start playing with it on Monday.
>
> Now if you take my latest for-next branch, and add the patch below,

I took your for-next without the extra patch and used it from bpf trampoline.
It's looking good so far. Passed basic testing. Will add more stress tests.

Do you mind doing:
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 73eb2e93593f..6ddb203ca550 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -256,16 +256,16 @@ struct ftrace_direct_func
*ftrace_find_direct_func(unsigned long addr);
 # define ftrace_direct_func_count 0
 static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)
 {
-       return -ENODEV;
+       return -ENOTSUPP;
 }
 static inline int unregister_ftrace_direct(unsigned long ip, unsigned
long addr)
 {
-       return -ENODEV;
+       return -ENOTSUPP;
 }
 static inline int modify_ftrace_direct(unsigned long ip,
                                       unsigned long old_addr,
unsigned long new_addr)
 {
-       return -ENODEV;
+       return -ENOTSUPP;
 }

otherwise ENODEV is a valid error when ip is incorrect which is
indistinguishable from ftrace not compiled in.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH 1/2] ftrace: Add modify_ftrace_direct()
  2019-11-19  6:04       ` [RFC][PATCH 1/2] ftrace: Add modify_ftrace_direct() Alexei Starovoitov
@ 2019-11-19 14:13         ` Steven Rostedt
  2019-11-19 15:37           ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2019-11-19 14:13 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: bpf, Network Development, LKML, Ingo Molnar

On Mon, 18 Nov 2019 22:04:28 -0800
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:

> I took your for-next without the extra patch and used it from bpf trampoline.
> It's looking good so far. Passed basic testing. Will add more stress tests.
> 
> Do you mind doing:
> diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> index 73eb2e93593f..6ddb203ca550 100644
> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -256,16 +256,16 @@ struct ftrace_direct_func
> *ftrace_find_direct_func(unsigned long addr);
>  # define ftrace_direct_func_count 0
>  static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)
>  {
> -       return -ENODEV;
> +       return -ENOTSUPP;
>  }
>  static inline int unregister_ftrace_direct(unsigned long ip, unsigned
> long addr)
>  {
> -       return -ENODEV;
> +       return -ENOTSUPP;
>  }
>  static inline int modify_ftrace_direct(unsigned long ip,
>                                        unsigned long old_addr,
> unsigned long new_addr)
>  {
> -       return -ENODEV;
> +       return -ENOTSUPP;
>  }
> 
> otherwise ENODEV is a valid error when ip is incorrect which is
> indistinguishable from ftrace not compiled in.

Sure I can add this. Want to add a Signed-off-by to it, and I'll just
pull it in directly? I can write up the change log.

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH 1/2] ftrace: Add modify_ftrace_direct()
  2019-11-19 14:13         ` Steven Rostedt
@ 2019-11-19 15:37           ` Alexei Starovoitov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2019-11-19 15:37 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: bpf, Network Development, LKML, Ingo Molnar

On Tue, Nov 19, 2019 at 6:13 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Mon, 18 Nov 2019 22:04:28 -0800
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > I took your for-next without the extra patch and used it from bpf trampoline.
> > It's looking good so far. Passed basic testing. Will add more stress tests.
> >
> > Do you mind doing:
> > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> > index 73eb2e93593f..6ddb203ca550 100644
> > --- a/include/linux/ftrace.h
> > +++ b/include/linux/ftrace.h
> > @@ -256,16 +256,16 @@ struct ftrace_direct_func
> > *ftrace_find_direct_func(unsigned long addr);
> >  # define ftrace_direct_func_count 0
> >  static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)
> >  {
> > -       return -ENODEV;
> > +       return -ENOTSUPP;
> >  }
> >  static inline int unregister_ftrace_direct(unsigned long ip, unsigned
> > long addr)
> >  {
> > -       return -ENODEV;
> > +       return -ENOTSUPP;
> >  }
> >  static inline int modify_ftrace_direct(unsigned long ip,
> >                                        unsigned long old_addr,
> > unsigned long new_addr)
> >  {
> > -       return -ENODEV;
> > +       return -ENOTSUPP;
> >  }
> >
> > otherwise ENODEV is a valid error when ip is incorrect which is
> > indistinguishable from ftrace not compiled in.
>
> Sure I can add this. Want to add a Signed-off-by to it, and I'll just
> pull it in directly? I can write up the change log.

Whichever way is easier for you.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Thanks!

> -- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-19 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191114194636.811109457@goodmis.org>
     [not found] ` <20191114194738.938540273@goodmis.org>
     [not found]   ` <20191115215125.mbqv7taqnx376yed@ast-mbp.dhcp.thefacebook.com>
     [not found]     ` <20191117171835.35af6c0e@gandalf.local.home>
2019-11-19  6:04       ` [RFC][PATCH 1/2] ftrace: Add modify_ftrace_direct() Alexei Starovoitov
2019-11-19 14:13         ` Steven Rostedt
2019-11-19 15:37           ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).