Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

Peter Zijlstra
2023-11-06T12:53:04Z

On Mon, Nov 06, 2023 at 09:47:08PM +0900, Masami Hiramatsu wrote:
> On Mon, 6 Nov 2023 11:19:32 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote:
> > > On Sun, 5 Nov 2023 18:34:09 -0500
> > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > > On Sun, 5 Nov 2023 18:33:01 -0500
> > > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > > >
> > > > > For x86_64, that would be:
> > > > >
> > > > > rdi, rsi, rdx, r8, r9, rsp
> > > >
> > > > I missed rcx.
> > >
> > > I would like to add rax to the list so that it can handle the return value too. :)
> >
> > So something like so?
> >
> >
> > diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> > index 897cf02c20b1..71bfe27594a5 100644
> > --- a/arch/x86/include/asm/ftrace.h
> > +++ b/arch/x86/include/asm/ftrace.h
> > @@ -36,6 +36,10 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
> >
> > #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> > struct ftrace_regs {
> > + /*
> > + * Partial, filled with:
> > + * rax, rcx, rdx, rdi, rsi, r8, r9, rsp
>
> Don't we need rbp too? (for frame pointer)

/me goes stare at ftrace_64.S, and yes it appears it fills out rbp too.