Title: [7361] trunk/arch/blackfin/kernel/ftrace-entry.S: bug [#5431] - As commented by Mike, the early part of the mcount checks whether ftrace is enabled and this code path is frequently excecuted.
- Revision
- 7361
- Author
- adamliyi
- Date
- 2009-09-16 06:23:19 -0400 (Wed, 16 Sep 2009)
Log Message
bug [#5431] - As commented by Mike, the early part of the mcount checks whether ftrace is enabled and this code path is frequently excecuted. Do not save r1 to stack there for performance consideration.
Modified Paths
Diff
Modified: trunk/arch/blackfin/kernel/ftrace-entry.S (7360 => 7361)
--- trunk/arch/blackfin/kernel/ftrace-entry.S 2009-09-16 07:47:18 UTC (rev 7360)
+++ trunk/arch/blackfin/kernel/ftrace-entry.S 2009-09-16 10:23:19 UTC (rev 7361)
@@ -21,12 +21,6 @@
* will be waiting there. mmmm pie.
*/
ENTRY(__mcount)
- /* __mcount is called this way:
- * parent_ip: [--sp] = rets; call __mcount; rets = [sp++]
- */
- [--sp] = r1;
- r1 = [sp + 4];
-
/* save third function arg early so we can do testing below */
[--sp] = r2;
@@ -64,12 +58,13 @@
#endif
r2 = [sp++];
- r1 = [sp++]
rts;
.Ldo_trace:
+ /* save first/second function arg and the return register */
[--sp] = r0;
+ [--sp] = r1;
[--sp] = rets;
/* setup the tracer function */
@@ -83,15 +78,22 @@
r0 = rets;
r0 += -MCOUNT_INSN_SIZE;
+ /*
+ * parent_ip:
+ * __mcount is called this way:
+ * [--sp] = rets; call __mcount; rets = [sp++]
+ * currently on stack: rets, r2, r0, r1, rets
+ */
+ r1 = [sp + 16];
/* call the tracer */
call (p0);
/* restore state and get out of dodge */
.Lfinish_trace:
rets = [sp++];
+ r1 = [sp++];
r0 = [sp++];
r2 = [sp++];
- r1 = [sp++];
.globl _ftrace_stub
_ftrace_stub:
@@ -107,12 +109,13 @@
ENTRY(_ftrace_graph_caller)
/* save first/second function arg and the return register */
[--sp] = r0;
+ [--sp] = r1;
[--sp] = rets;
/* prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) */
r0 = sp;
r1 = rets;
- /* currently on the stack: r1, r2, r0, rets */
+ /* currently on the stack: rets, r2, r0, r1, rets */
r0 += 16;
r1 += -MCOUNT_INSN_SIZE;
call _prepare_ftrace_return;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits