Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH -v5] MIPS: tracing: Optimize the implementation
Date: Mon, 19 Apr 2010 17:36:08 +0800	[thread overview]
Message-ID: <1271669768.25163.2.camel@falcon> (raw)
In-Reply-To: <1271537514-19584-1-git-send-email-wuzhangjin@gmail.com>

On Sun, 2010-04-18 at 04:51 +0800, Wu Zhangjin wrote:
[...]
> diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
[...]
>  
> @@ -45,8 +46,6 @@
>  	PTR_L	a5, PT_R9(sp)
>  	PTR_L	a6, PT_R10(sp)
>  	PTR_L	a7, PT_R11(sp)
> -#endif
> -#ifdef CONFIG_64BIT
>  	PTR_ADDIU	sp, PT_SIZE
>  #else
>  	PTR_ADDIU	sp, (PT_SIZE + 8)
> @@ -71,7 +70,7 @@ _mcount:
>  
>  	MCOUNT_SAVE_REGS
>  #ifdef KBUILD_MCOUNT_RA_ADDRESS
> -	PTR_S	t0, PT_R12(sp)	/* t0 saved the location of the return address(at) by -mmcount-ra-address */
> +	PTR_S	$12, PT_R12(sp)	/* $12 saved the location of the return address(at) */
>  #endif
>  
>  	move	a0, ra		/* arg1: next ip, selfaddr */
> @@ -137,25 +136,22 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
>  #ifdef CONFIG_DYNAMIC_FTRACE
>  	PTR_L	a1, PT_R31(sp)	/* load the original ra from the stack */
>  #ifdef KBUILD_MCOUNT_RA_ADDRESS
> -	PTR_L	t0, PT_R12(sp)	/* load the original t0 from the stack */
> +	PTR_L	a0, PT_R12(sp)	/* arg1: the location of the return address */
>  #endif
> -#else
> +#else /* ! CONFIG_DYNAMIC_FTRACE */
>  	MCOUNT_SAVE_REGS
>  	move	a1, ra		/* arg2: next ip, selfaddr */
>  #endif
>  
>  #ifdef KBUILD_MCOUNT_RA_ADDRESS
> -	bnez	t0, 1f		/* non-leaf func: t0 saved the location of the return address */
> +	bnez	a0, 1f		/* non-leaf func: get the location of the return address from saved $12 */
>  	 nop
> -	PTR_LA	t0, PT_R1(sp)	/* leaf func: get the location of at(old ra) from our own stack */
> -1:	move	a0, t0		/* arg1: the location of the return address */
> -#else
> -	PTR_LA	a0, PT_R1(sp)	/* arg1: &AT -> a0 */
>  #endif
> -	jal	prepare_ftrace_return

The above change has broken the static function graph tracer with
-mmcount-ra-address for it did not consider the argument 1 for static
function graph tracer, a new revision of this patch will be sent out as
"MIPS: tracing: adds misc cleanups and fixups".

Regards,
	Wu Zhangjin

      reply	other threads:[~2010-04-19  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 20:51 [PATCH -v5] MIPS: tracing: Optimize the implementation Wu Zhangjin
2010-04-19  9:36 ` Wu Zhangjin [this message]

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=1271669768.25163.2.camel@falcon \
    --to=wuzhangjin@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox