From: Markos Chandras <markos.chandras@imgtec.com>
To: <linux-mips@linux-mips.org>
Cc: Markos Chandras <markos.chandras@imgtec.com>,
Steven Rostedt <rostedt@goodmis.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] MIPS: mcount: Fix selfpc address for static trace
Date: Mon, 22 Sep 2014 14:32:59 +0100 [thread overview]
Message-ID: <1411392779-9554-3-git-send-email-markos.chandras@imgtec.com> (raw)
In-Reply-To: <1411392779-9554-1-git-send-email-markos.chandras@imgtec.com>
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.
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 */
--
2.1.0
next prev parent reply other threads:[~2014-09-22 13:33 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 ` Markos Chandras [this message]
2014-09-22 18:26 ` [PATCH 2/2] MIPS: mcount: Fix selfpc address for static trace Steven Rostedt
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=1411392779-9554-3-git-send-email-markos.chandras@imgtec.com \
--to=markos.chandras@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@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
Powered by JetHome