* [PATCH] MIPS: ftrace: Reword prepare_ftrace_return() comment block
@ 2019-06-07 11:36 Geert Uytterhoeven
2019-06-11 22:30 ` Paul Burton
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2019-06-07 11:36 UTC (permalink / raw)
To: Ralf Baechle, Paul Burton, James Hogan, Steven Rostedt, Ingo Molnar
Cc: linux-mips, linux-kernel, Geert Uytterhoeven
Improve the comment block for prepare_ftrace_return().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/mips/kernel/ftrace.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 4b5e1f2bfbcea85f..2625232bfe526a84 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -333,20 +333,21 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra,
return;
/*
- * "parent_ra_addr" is the stack address saved the return address of
- * the caller of _mcount.
+ * "parent_ra_addr" is the stack address where the return address of
+ * the caller of _mcount is saved.
*
- * if the gcc < 4.5, a leaf function does not save the return address
- * in the stack address, so, we "emulate" one in _mcount's stack space,
- * and hijack it directly, but for a non-leaf function, it save the
- * return address to the its own stack space, we can not hijack it
- * directly, but need to find the real stack address,
- * ftrace_get_parent_addr() does it!
+ * If gcc < 4.5, a leaf function does not save the return address
+ * in the stack address, so we "emulate" one in _mcount's stack space,
+ * and hijack it directly.
+ * For a non-leaf function, it does save the return address to its own
+ * stack space, so we can not hijack it directly, but need to find the
+ * real stack address, which is done by ftrace_get_parent_addr().
*
- * if gcc>= 4.5, with the new -mmcount-ra-address option, for a
+ * If gcc >= 4.5, with the new -mmcount-ra-address option, for a
* non-leaf function, the location of the return address will be saved
- * to $12 for us, and for a leaf function, only put a zero into $12. we
- * do it in ftrace_graph_caller of mcount.S.
+ * to $12 for us.
+ * For a leaf function, it just puts a zero into $12, so we handle
+ * it in ftrace_graph_caller() of mcount.S.
*/
/* old_parent_ra = *parent_ra_addr; */
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: ftrace: Reword prepare_ftrace_return() comment block
2019-06-07 11:36 [PATCH] MIPS: ftrace: Reword prepare_ftrace_return() comment block Geert Uytterhoeven
@ 2019-06-11 22:30 ` Paul Burton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-06-11 22:30 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ralf Baechle, Paul Burton, James Hogan, Steven Rostedt,
Ingo Molnar, linux-mips, linux-kernel, Geert Uytterhoeven,
linux-mips
Hello,
Geert Uytterhoeven wrote:
> Improve the comment block for prepare_ftrace_return().
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied to mips-next.
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-11 22:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 11:36 [PATCH] MIPS: ftrace: Reword prepare_ftrace_return() comment block Geert Uytterhoeven
2019-06-11 22:30 ` Paul Burton
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.