Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Josh Poimboeuf
On Fri, Jun 14, 2019 at 08:31:53AM -0700, Alexei Starovoitov wrote: > On Fri, Jun 14, 2019 at 6:34 AM Josh Poimboeuf wrote: > > > > On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > > > > + if (src_reg == BPF_REG_FP) { > > > > + /* > > > > +* If the valu

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Alexei Starovoitov
On Fri, Jun 14, 2019 at 6:34 AM Josh Poimboeuf wrote: > > On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > > > + if (src_reg == BPF_REG_FP) { > > > + /* > > > +* If the value was copied from RBP (real frame pointer), > > > +* adjust it to th

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Alexei Starovoitov
On Fri, Jun 14, 2019 at 12:41 AM Peter Zijlstra wrote: > > On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > > > There is something wrong with > > commit d15d356887e7 ("perf/x86: Make perf callchains work without > > CONFIG_FRAME_POINTER") > > It assumes we can always unwind s

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Josh Poimboeuf
On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > > + if (src_reg == BPF_REG_FP) { > > + /* > > +* If the value was copied from RBP (real frame pointer), > > +* adjust it to the BPF program's frame pointer value. > > +* > > +

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Josh Poimboeuf
On Fri, Jun 14, 2019 at 09:41:37AM +0200, Peter Zijlstra wrote: > On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > > > There is something wrong with > > commit d15d356887e7 ("perf/x86: Make perf callchains work without > > CONFIG_FRAME_POINTER") > > It assumes we can always

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-14 Thread Peter Zijlstra
On Thu, Jun 13, 2019 at 11:00:09PM -0700, Alexei Starovoitov wrote: > There is something wrong with > commit d15d356887e7 ("perf/x86: Make perf callchains work without > CONFIG_FRAME_POINTER") It assumes we can always unwind stack, which is, imo, not a weird thing. > If I simply revert it and h

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Alexei Starovoitov
On Thu, Jun 13, 2019 at 11:50:37PM -0500, Josh Poimboeuf wrote: > On Thu, Jun 13, 2019 at 09:28:48PM -0500, Josh Poimboeuf wrote: > > On Thu, Jun 13, 2019 at 08:58:48PM -0500, Josh Poimboeuf wrote: > > > On Thu, Jun 13, 2019 at 06:42:45PM -0700, Alexei Starovoitov wrote: > > > > On Thu, Jun 13, 201

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Josh Poimboeuf
On Thu, Jun 13, 2019 at 09:28:48PM -0500, Josh Poimboeuf wrote: > On Thu, Jun 13, 2019 at 08:58:48PM -0500, Josh Poimboeuf wrote: > > On Thu, Jun 13, 2019 at 06:42:45PM -0700, Alexei Starovoitov wrote: > > > On Thu, Jun 13, 2019 at 08:30:51PM -0500, Josh Poimboeuf wrote: > > > > On Thu, Jun 13, 201

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Josh Poimboeuf
On Thu, Jun 13, 2019 at 08:58:48PM -0500, Josh Poimboeuf wrote: > On Thu, Jun 13, 2019 at 06:42:45PM -0700, Alexei Starovoitov wrote: > > On Thu, Jun 13, 2019 at 08:30:51PM -0500, Josh Poimboeuf wrote: > > > On Thu, Jun 13, 2019 at 03:00:55PM -0700, Alexei Starovoitov wrote: > > > > > @@ -392,8 +40

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Josh Poimboeuf
On Thu, Jun 13, 2019 at 06:42:45PM -0700, Alexei Starovoitov wrote: > On Thu, Jun 13, 2019 at 08:30:51PM -0500, Josh Poimboeuf wrote: > > On Thu, Jun 13, 2019 at 03:00:55PM -0700, Alexei Starovoitov wrote: > > > > @@ -392,8 +402,16 @@ bool unwind_next_frame(struct unwind_state *state) > > > >

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Alexei Starovoitov
On Thu, Jun 13, 2019 at 08:30:51PM -0500, Josh Poimboeuf wrote: > On Thu, Jun 13, 2019 at 03:00:55PM -0700, Alexei Starovoitov wrote: > > > @@ -392,8 +402,16 @@ bool unwind_next_frame(struct unwind_state *state) > > >* calls and calls to noreturn functions. > > >*/ > > > orc = orc_find(st

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Josh Poimboeuf
On Thu, Jun 13, 2019 at 03:00:55PM -0700, Alexei Starovoitov wrote: > > @@ -392,8 +402,16 @@ bool unwind_next_frame(struct unwind_state *state) > > * calls and calls to noreturn functions. > > */ > > orc = orc_find(state->signal ? state->ip : state->ip - 1); > > - if (!orc) > > -

Re: [PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Alexei Starovoitov
On Thu, Jun 13, 2019 at 08:21:04AM -0500, Josh Poimboeuf wrote: > The ORC unwinder can't unwind through BPF JIT generated code because > there are no ORC entries associated with the code. > > If an ORC entry isn't available, try to fall back to frame pointers. If > BPF and other generated code al

[PATCH 7/9] x86/unwind/orc: Fall back to using frame pointers for generated code

2019-06-13 Thread Josh Poimboeuf
The ORC unwinder can't unwind through BPF JIT generated code because there are no ORC entries associated with the code. If an ORC entry isn't available, try to fall back to frame pointers. If BPF and other generated code always do frame pointer setup (even with CONFIG_FRAME_POINTERS=n) then this