Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Abel Vesa
On Fri, Feb 10, 2017 at 02:57:38PM +0100, Jean-Jacques Hiblot wrote: > 2017-02-10 13:03 GMT+01:00 Abel Vesa : > > On Fri, Feb 10, 2017 at 11:36:12AM +0100, Jean-Jacques Hiblot wrote: > >> 2017-02-09 17:29 GMT+01:00 Russell King - ARM Linux > >> : > >> > On Tue, Feb 07, 2017 at 10:57:55PM +, Ab

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Abel Vesa
On Fri, Feb 10, 2017 at 02:28:47PM +, Russell King - ARM Linux wrote: > On Fri, Feb 10, 2017 at 12:03:06PM +, Abel Vesa wrote: > > The only problem I don't have a solution for at this point is OLD_LR (or > > previous LR as it is called in this patch). > > If you want the context at functio

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Jean-Jacques Hiblot
2017-02-10 13:03 GMT+01:00 Abel Vesa : > On Fri, Feb 10, 2017 at 11:36:12AM +0100, Jean-Jacques Hiblot wrote: >> 2017-02-09 17:29 GMT+01:00 Russell King - ARM Linux : >> > On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: >> >> +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS >> >> + >> >> +.macro

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Russell King - ARM Linux
On Fri, Feb 10, 2017 at 12:03:06PM +, Abel Vesa wrote: > The only problem I don't have a solution for at this point is OLD_LR (or > previous LR as it is called in this patch). If you want the context at function entry, then you need to save the registers as they were at that point. The stacki

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Abel Vesa
On Fri, Feb 10, 2017 at 11:36:12AM +0100, Jean-Jacques Hiblot wrote: > 2017-02-09 17:29 GMT+01:00 Russell King - ARM Linux : > > On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: > >> +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > >> + > >> +.macro __ftrace_regs_caller > >> + > >> + add

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-10 Thread Jean-Jacques Hiblot
2017-02-09 17:29 GMT+01:00 Russell King - ARM Linux : > On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: >> +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS >> + >> +.macro __ftrace_regs_caller >> + >> + add ip, sp, #4 @ move in IP the value of SP as it was >> +

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Jean-Jacques Hiblot
2017-02-07 23:57 GMT+01:00 Abel Vesa : > The DYNAMIC_FTRACE_WITH_REGS configuration makes it possible for a ftrace > operation to specify if registers need to saved/restored by the ftrace > handler. > This is needed by kgraft and possibly other ftrace-based tools, and the ARM > architecture is cur

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Abel Vesa
On Thu, Feb 09, 2017 at 07:01:10PM +, Abel Vesa wrote: > On Thu, Feb 09, 2017 at 01:14:52PM -0500, Steven Rostedt wrote: > > > > [ sending again with Masami Cc'd ] > > > > On Thu, 9 Feb 2017 13:14:14 -0500 > > Steven Rostedt wrote: > > > > > On Thu, 9 Feb 2017 18:06:44 + > > > Russell K

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Abel Vesa
On Thu, Feb 09, 2017 at 01:14:52PM -0500, Steven Rostedt wrote: > > [ sending again with Masami Cc'd ] > > On Thu, 9 Feb 2017 13:14:14 -0500 > Steven Rostedt wrote: > > > On Thu, 9 Feb 2017 18:06:44 + > > Russell King - ARM Linux wrote: > > > > > On Thu, Feb 09, 2017 at 12:13:22PM -0500,

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Abel Vesa
On Thu, Feb 09, 2017 at 04:29:56PM +, Russell King - ARM Linux wrote: > On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: > > +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > > + > > +.macro __ftrace_regs_caller > > + > > + add ip, sp, #4 @ move in IP the value of SP as it was > >

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Abel Vesa
On Thu, Feb 09, 2017 at 06:06:44PM +, Russell King - ARM Linux wrote: > On Thu, Feb 09, 2017 at 12:13:22PM -0500, Steven Rostedt wrote: > > Then came along live kernel patching, which I believe this series is > > trying to support. What is needed by pt_regs is a way to "hijack" the > > function

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Russell King - ARM Linux
On Thu, Feb 09, 2017 at 12:13:22PM -0500, Steven Rostedt wrote: > Then came along live kernel patching, which I believe this series is > trying to support. What is needed by pt_regs is a way to "hijack" the > function being called to instead call the patched function. That is, > ftrace is not being

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Steven Rostedt
On Thu, 9 Feb 2017 18:06:44 + Russell King - ARM Linux wrote: > On Thu, Feb 09, 2017 at 12:13:22PM -0500, Steven Rostedt wrote: > > Then came along live kernel patching, which I believe this series is > > trying to support. What is needed by pt_regs is a way to "hijack" the > > function being

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Steven Rostedt
[ sending again with Masami Cc'd ] On Thu, 9 Feb 2017 13:14:14 -0500 Steven Rostedt wrote: > On Thu, 9 Feb 2017 18:06:44 + > Russell King - ARM Linux wrote: > > > On Thu, Feb 09, 2017 at 12:13:22PM -0500, Steven Rostedt wrote: > > > Then came along live kernel patching, which I believe

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Steven Rostedt
On Thu, 9 Feb 2017 16:29:56 + Russell King - ARM Linux wrote: > On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: > > +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > > + > > +.macro __ftrace_regs_caller > > + > > + add ip, sp, #4 @ move in IP the value of SP as it was > > +

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Russell King - ARM Linux
On Tue, Feb 07, 2017 at 10:57:55PM +, Abel Vesa wrote: > +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > + > +.macro __ftrace_regs_caller > + > + add ip, sp, #4 @ move in IP the value of SP as it was > + @ before the push {lr} of the mcount mechanism > + s

Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-09 Thread Russell King - ARM Linux
On Thu, Feb 09, 2017 at 04:38:32PM +0100, Jean-Jacques Hiblot wrote: > 2017-02-07 23:57 GMT+01:00 Abel Vesa : > > +#ifdef CONFIG_FUNCTION_GRAPH_TRACER > > +.macro __ftrace_graph_regs_caller > > + > > + sub r0, fp, #4 @ lr of instrumented routine > > (parent) > > + > > +

[PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS

2017-02-07 Thread Abel Vesa
The DYNAMIC_FTRACE_WITH_REGS configuration makes it possible for a ftrace operation to specify if registers need to saved/restored by the ftrace handler. This is needed by kgraft and possibly other ftrace-based tools, and the ARM architecture is currently lacking this feature. It would also be the