All of lore.kernel.org
 help / color / mirror / Atom feed
From: abelvesa@gmail.com (Abel Vesa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS
Date: Thu, 12 Jan 2017 02:19:57 +0200	[thread overview]
Message-ID: <20170112001957.GA5458@nuc> (raw)
In-Reply-To: <20170110155112.GB14894@pathway.suse.cz>

On Tue, Jan 10, 2017 at 04:51:12PM +0100, Petr Mladek wrote:
> On Thu 2016-12-08 22:46:55, Abel Vesa wrote:
> > On Thu, Dec 08, 2016 at 09:46:35PM +0000, Abel Vesa wrote:
> > > From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > > 
> > > From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > 
> > >From statement twice in the commit message. Will resend.
> > > 
> > > 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 first step
> > > to support the "Kprobes-on-ftrace" optimization on ARM.
> > > 
> > > This patch introduces a new ftrace handler that stores the registers on the
> > > stack before calling the next stage. The registers are restored from the stack
> > > before going back to the instrumented function.
> > > 
> > > A side-effect of this patch is to activate the support for ftrace_modify_call()
> > > as it defines ARCH_SUPPORTS_FTRACE_OPS for the ARM architecture
> > > 
> > > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > > Signed-off-by: Abel Vesa <abelvesa@linux.com>
> > > ---
> > >  arch/arm/Kconfig               |  2 ++
> > >  arch/arm/include/asm/ftrace.h  |  4 +++
> > >  arch/arm/kernel/entry-ftrace.S | 78 ++++++++++++++++++++++++++++++++++++++++++
> > >  arch/arm/kernel/ftrace.c       | 33 ++++++++++++++++++
> > >  4 files changed, 117 insertions(+)
> > > 
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > index b5d529f..87f1a9f 100644
> > > --- a/arch/arm/Kconfig
> > > +++ b/arch/arm/Kconfig
> > > @@ -50,6 +50,7 @@ config ARM
> > >  	select HAVE_DMA_API_DEBUG
> > >  	select HAVE_DMA_CONTIGUOUS if MMU
> > >  	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
> > > +	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
> > >  	select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
> > >  	select HAVE_EXIT_THREAD
> > >  	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
> > > @@ -90,6 +91,7 @@ config ARM
> > >  	select PERF_USE_VMALLOC
> > >  	select RTC_LIB
> > >  	select SYS_SUPPORTS_APM_EMULATION
> > > +	select FRAME_POINTER if DYNAMIC_FTRACE_WITH_REGS && FUNCTION_GRAPH_TRACER
Hi Petr,
> 
> FRAME_POINTER is not for free. It takes space on the stack. Also there
> is a performance penalty. Do we really need to depend on it? If so,
> it might be worth a note in the commit message.

I was trying to create my own patch when I found this work done by 
Jean-Jacques, so I haven't looked specifically for the FRAME_POINTER 
part. I looked now at it and you seem to be right, FRAME_POINTER is 
not needed. 

I will get rid of the FRAME_POINTER part, change the authorship and
send it again in the following days.
>
> I made only a quick look at the patch. It looks reasonable. But I do
> not have enough knowledge about the arm architecture, assembly, and
> ftrace-specifics. Also I cannot test it easily. So issues might
> be hidden to my eyes.
> 
> Best Regards,
> Petr
Thanks,
Abel

WARNING: multiple messages have this Message-ID (diff)
From: Abel Vesa <abelvesa@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Abel Vesa <abelvesa@linux.com>,
	linux@armlinux.org.uk, rostedt@goodmis.org, mingo@redhat.com,
	viro@zeniv.linux.org.uk, jjhiblot@traphandler.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robin.murphy@arm.com,
	zhouchengming1@huawei.com
Subject: Re: [PATCH] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS
Date: Thu, 12 Jan 2017 02:19:57 +0200	[thread overview]
Message-ID: <20170112001957.GA5458@nuc> (raw)
In-Reply-To: <20170110155112.GB14894@pathway.suse.cz>

On Tue, Jan 10, 2017 at 04:51:12PM +0100, Petr Mladek wrote:
> On Thu 2016-12-08 22:46:55, Abel Vesa wrote:
> > On Thu, Dec 08, 2016 at 09:46:35PM +0000, Abel Vesa wrote:
> > > From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > > 
> > > From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > 
> > >From statement twice in the commit message. Will resend.
> > > 
> > > 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 first step
> > > to support the "Kprobes-on-ftrace" optimization on ARM.
> > > 
> > > This patch introduces a new ftrace handler that stores the registers on the
> > > stack before calling the next stage. The registers are restored from the stack
> > > before going back to the instrumented function.
> > > 
> > > A side-effect of this patch is to activate the support for ftrace_modify_call()
> > > as it defines ARCH_SUPPORTS_FTRACE_OPS for the ARM architecture
> > > 
> > > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > > Signed-off-by: Abel Vesa <abelvesa@linux.com>
> > > ---
> > >  arch/arm/Kconfig               |  2 ++
> > >  arch/arm/include/asm/ftrace.h  |  4 +++
> > >  arch/arm/kernel/entry-ftrace.S | 78 ++++++++++++++++++++++++++++++++++++++++++
> > >  arch/arm/kernel/ftrace.c       | 33 ++++++++++++++++++
> > >  4 files changed, 117 insertions(+)
> > > 
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > index b5d529f..87f1a9f 100644
> > > --- a/arch/arm/Kconfig
> > > +++ b/arch/arm/Kconfig
> > > @@ -50,6 +50,7 @@ config ARM
> > >  	select HAVE_DMA_API_DEBUG
> > >  	select HAVE_DMA_CONTIGUOUS if MMU
> > >  	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
> > > +	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
> > >  	select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
> > >  	select HAVE_EXIT_THREAD
> > >  	select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
> > > @@ -90,6 +91,7 @@ config ARM
> > >  	select PERF_USE_VMALLOC
> > >  	select RTC_LIB
> > >  	select SYS_SUPPORTS_APM_EMULATION
> > > +	select FRAME_POINTER if DYNAMIC_FTRACE_WITH_REGS && FUNCTION_GRAPH_TRACER
Hi Petr,
> 
> FRAME_POINTER is not for free. It takes space on the stack. Also there
> is a performance penalty. Do we really need to depend on it? If so,
> it might be worth a note in the commit message.

I was trying to create my own patch when I found this work done by 
Jean-Jacques, so I haven't looked specifically for the FRAME_POINTER 
part. I looked now at it and you seem to be right, FRAME_POINTER is 
not needed. 

I will get rid of the FRAME_POINTER part, change the authorship and
send it again in the following days.
>
> I made only a quick look at the patch. It looks reasonable. But I do
> not have enough knowledge about the arm architecture, assembly, and
> ftrace-specifics. Also I cannot test it easily. So issues might
> be hidden to my eyes.
> 
> Best Regards,
> Petr
Thanks,
Abel

  reply	other threads:[~2017-01-12  0:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 21:46 [PATCH] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS Abel Vesa
2016-12-08 21:46 ` Abel Vesa
2016-12-08 22:46 ` Abel Vesa
2016-12-08 22:46   ` Abel Vesa
2017-01-10 15:51   ` Petr Mladek
2017-01-10 15:51     ` Petr Mladek
2017-01-12  0:19     ` Abel Vesa [this message]
2017-01-12  0:19       ` Abel Vesa
2017-01-12 14:30       ` Jean-Jacques Hiblot
2017-01-12 14:30         ` Jean-Jacques Hiblot
2017-01-13  8:30         ` Jean-Jacques Hiblot
2017-01-13  8:30           ` Jean-Jacques Hiblot
2017-01-24  0:43           ` Abel Vesa
2017-01-24  0:43             ` Abel Vesa
  -- strict thread matches above, loose matches on Subject: below --
2016-12-08 22:49 Abel Vesa
2016-12-08 22:49 ` Abel Vesa
2017-05-12 20:38 abelvesa at gmail.com
2017-05-12 20:38 ` abelvesa
2017-05-12 21:05 ` Abel Vesa
2017-05-12 21:05   ` Abel Vesa
2017-05-12 21:06 Abel Vesa
2017-05-12 21:06 ` Abel Vesa
2017-05-23 19:53 ` Russell King - ARM Linux
2017-05-23 19:53   ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170112001957.GA5458@nuc \
    --to=abelvesa@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.