All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/4] powerpc/ftrace: Refactor ftrace_{regs_}caller
Date: Thu, 03 Mar 2022 22:29:50 +0530	[thread overview]
Message-ID: <1646326634.jzerx009p9.naveen@linux.ibm.com> (raw)
In-Reply-To: <9d7df9e4fc98a86051489f61d3c9bc67f92f7e27.1645099283.git.christophe.leroy@csgroup.eu>

Christophe Leroy wrote:
> ftrace_caller() and frace_regs_caller() have now a lot in common.
> 
> Refactor them using GAS macros.

Thanks for doing this - this looks much better.

> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/kernel/trace/ftrace_mprofile.S | 147 ++++++--------------
>  1 file changed, 45 insertions(+), 102 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/trace/ftrace_mprofile.S b/arch/powerpc/kernel/trace/ftrace_mprofile.S
> index 76dab07fd8fd..630b2de9957b 100644
> --- a/arch/powerpc/kernel/trace/ftrace_mprofile.S
> +++ b/arch/powerpc/kernel/trace/ftrace_mprofile.S
> @@ -32,7 +32,7 @@
>   * Our job is to save the register state into a struct pt_regs (on the stack)
>   * and then arrange for the ftrace function to be called.
>   */
> -_GLOBAL(ftrace_regs_caller)
> +.macro	ftrace_regs_entry allregs
>  	/* Save the original return address in A's stack frame */
>  #ifdef CONFIG_MPROFILE_KERNEL
>  	PPC_STL	r0,LRSAVE(r1)
> @@ -43,7 +43,7 @@ _GLOBAL(ftrace_regs_caller)
> 
>  	/* Save all gprs to pt_regs */
>  	SAVE_GPR(0, r1)
> -	SAVE_GPRS(2, 11, r1)
> +	SAVE_GPRS(3, 10, r1)
> 
>  #ifdef CONFIG_PPC64
>  	/* Ok to continue? */
> @@ -52,17 +52,29 @@ _GLOBAL(ftrace_regs_caller)
>  	beq	ftrace_no_trace
>  #endif

The ability to disable ftrace in certain code paths through 
paca_struct->ftrace_enabled will also be relevant on ppc32 - it will be 
nice if it can be introduced there.

For this series though:
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>


- Naveen


WARNING: multiple messages have this Message-ID (diff)
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v1 2/4] powerpc/ftrace: Refactor ftrace_{regs_}caller
Date: Thu, 03 Mar 2022 22:29:50 +0530	[thread overview]
Message-ID: <1646326634.jzerx009p9.naveen@linux.ibm.com> (raw)
In-Reply-To: <9d7df9e4fc98a86051489f61d3c9bc67f92f7e27.1645099283.git.christophe.leroy@csgroup.eu>

Christophe Leroy wrote:
> ftrace_caller() and frace_regs_caller() have now a lot in common.
> 
> Refactor them using GAS macros.

Thanks for doing this - this looks much better.

> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/kernel/trace/ftrace_mprofile.S | 147 ++++++--------------
>  1 file changed, 45 insertions(+), 102 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/trace/ftrace_mprofile.S b/arch/powerpc/kernel/trace/ftrace_mprofile.S
> index 76dab07fd8fd..630b2de9957b 100644
> --- a/arch/powerpc/kernel/trace/ftrace_mprofile.S
> +++ b/arch/powerpc/kernel/trace/ftrace_mprofile.S
> @@ -32,7 +32,7 @@
>   * Our job is to save the register state into a struct pt_regs (on the stack)
>   * and then arrange for the ftrace function to be called.
>   */
> -_GLOBAL(ftrace_regs_caller)
> +.macro	ftrace_regs_entry allregs
>  	/* Save the original return address in A's stack frame */
>  #ifdef CONFIG_MPROFILE_KERNEL
>  	PPC_STL	r0,LRSAVE(r1)
> @@ -43,7 +43,7 @@ _GLOBAL(ftrace_regs_caller)
> 
>  	/* Save all gprs to pt_regs */
>  	SAVE_GPR(0, r1)
> -	SAVE_GPRS(2, 11, r1)
> +	SAVE_GPRS(3, 10, r1)
> 
>  #ifdef CONFIG_PPC64
>  	/* Ok to continue? */
> @@ -52,17 +52,29 @@ _GLOBAL(ftrace_regs_caller)
>  	beq	ftrace_no_trace
>  #endif

The ability to disable ftrace in certain code paths through 
paca_struct->ftrace_enabled will also be relevant on ppc32 - it will be 
nice if it can be introduced there.

For this series though:
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>


- Naveen


  reply	other threads:[~2022-03-03 17:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 12:01 [PATCH v1 1/4] powerpc/ftrace: Don't use lmw/stmw in ftrace_regs_caller() Christophe Leroy
2022-02-17 12:01 ` Christophe Leroy
2022-02-17 12:01 ` [PATCH v1 2/4] powerpc/ftrace: Refactor ftrace_{regs_}caller Christophe Leroy
2022-02-17 12:01   ` Christophe Leroy
2022-03-03 16:59   ` Naveen N. Rao [this message]
2022-03-03 16:59     ` Naveen N. Rao
2022-03-03 17:39     ` Christophe Leroy
2022-03-03 17:39       ` Christophe Leroy
2022-03-09 11:35       ` Naveen N. Rao
2022-03-09 11:35         ` Naveen N. Rao
2022-02-17 12:01 ` [PATCH v1 3/4] powerpc/ftrace: Regroup PPC64 specific operations in ftrace_mprofile.S Christophe Leroy
2022-02-17 12:01   ` Christophe Leroy
2022-02-17 12:01 ` [PATCH v1 4/4] powerpc/ftrace: Use STK_GOT " Christophe Leroy
2022-02-17 12:01   ` Christophe Leroy
2022-03-08 12:08 ` [PATCH v1 1/4] powerpc/ftrace: Don't use lmw/stmw in ftrace_regs_caller() Michael Ellerman
2022-03-08 12:08   ` Michael Ellerman

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=1646326634.jzerx009p9.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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.