From: Steven Rostedt <rostedt@goodmis.org>
To: Markos Chandras <markos.chandras@imgtec.com>
Cc: <linux-mips@linux-mips.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] MIPS: mcount: Fix selfpc address for static trace
Date: Mon, 22 Sep 2014 14:26:42 -0400 [thread overview]
Message-ID: <20140922142642.7f70fb0f@gandalf.local.home> (raw)
In-Reply-To: <1411392779-9554-3-git-send-email-markos.chandras@imgtec.com>
On Mon, 22 Sep 2014 14:32:59 +0100
Markos Chandras <markos.chandras@imgtec.com> wrote:
> According to Documentation/trace/ftrace-design.txt, the selfpc
> should be the return address minus the mcount overhead (8 bytes).
> This brings static trace in line with the dynamic trace regarding
> the selfpc argument to the tracing function.
>
> This also removes the magic number '8' with the proper
> MCOUNT_INSN_SIZE.
I could also update the generic code to handle delay slots.
-- Steve
>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
> ---
> arch/mips/kernel/mcount.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
> index 2f7c734771f4..3af48b7c7a47 100644
> --- a/arch/mips/kernel/mcount.S
> +++ b/arch/mips/kernel/mcount.S
> @@ -79,7 +79,7 @@ _mcount:
> PTR_S MCOUNT_RA_ADDRESS_REG, PT_R12(sp)
> #endif
>
> - PTR_SUBU a0, ra, 8 /* arg1: self address */
> + PTR_SUBU a0, ra, MCOUNT_INSN_SIZE /* arg1: self address */
> PTR_LA t1, _stext
> sltu t2, a0, t1 /* t2 = (a0 < _stext) */
> PTR_LA t1, _etext
> @@ -138,7 +138,7 @@ NESTED(_mcount, PT_SIZE, ra)
> static_trace:
> MCOUNT_SAVE_REGS
>
> - move a0, ra /* arg1: self return address */
> + PTR_SUBU a0, ra, MCOUNT_INSN_SIZE /* arg1: self address */
> jalr t2 /* (1) call *ftrace_trace_function */
> move a1, AT /* arg2: parent's return address */
>
next prev parent reply other threads:[~2014-09-22 18:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 13:32 [PATCH 0/2] Minor MIPS ftrace fixes Markos Chandras
2014-09-22 13:32 ` [PATCH 1/2] MIPS: ftrace.h: Fix the MCOUNT_INSN_SIZE definition Markos Chandras
2014-09-22 16:55 ` David Daney
2014-09-22 18:25 ` Steven Rostedt
2014-09-23 10:46 ` Markos Chandras
2014-09-22 13:32 ` [PATCH 2/2] MIPS: mcount: Fix selfpc address for static trace Markos Chandras
2014-09-22 18:26 ` Steven Rostedt [this message]
2014-09-23 10:47 ` Markos Chandras
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=20140922142642.7f70fb0f@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=markos.chandras@imgtec.com \
/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
all inboxes | Powered by JetHome®