Re: [PATCH 2/3 v4] ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default

2020-11-10 Thread Peter Zijlstra
On Mon, Nov 09, 2020 at 06:16:10PM -0500, Steven Rostedt wrote: > ftrace_caller: > [..] > movq $0, CS(%rsp) <- loads zero into pt_regs->cs for internal use only. > [..] Argh, I missed that. I failed to spot it in the patch. No worries then.

Re: [PATCH 2/3 v4] ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default

2020-11-09 Thread Steven Rostedt
On Mon, 9 Nov 2020 12:10:43 +0100 Peter Zijlstra wrote: > > SYM_INNER_LABEL(ftrace_caller_op_ptr, SYM_L_GLOBAL) > > /* Load the ftrace_ops into the 3rd parameter */ > > movq function_trace_op(%rip), %rdx > > > > - /* regs go into 4th parameter (but make it NULL) */ > > - movq $0,

Re: [PATCH 2/3 v4] ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default

2020-11-09 Thread Peter Zijlstra
On Fri, Nov 06, 2020 at 04:42:36PM -0500, Steven Rostedt wrote: > +static __always_inline struct pt_regs * > +arch_ftrace_get_regs(struct ftrace_regs *fregs) > +{ > + /* Only when FL_SAVE_REGS is set, cs will be non zero */ > + if (!fregs->regs.cs) > + return NULL; > +

[PATCH 2/3 v4] ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default

2020-11-06 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Currently, the only way to get access to the registers of a function via a ftrace callback is to set the "FL_SAVE_REGS" bit in the ftrace_ops. But as this saves all regs as if a breakpoint were to trigger (for use with kprobes), it is expensive. The regs are