Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200819
b: refs/heads/master
c: cbe555b
h: refs/heads/master
i:
  200817: d612960
  200815: 5a83b11
v: v3
  • Loading branch information
Wu Zhangjin authored and Ralf Baechle committed Jul 5, 2010
1 parent 5bc32f6 commit c071d56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27b118342f2dcd6f0c2cd64453cc5a0289c4b3c9
refs/heads/master: cbe555b01b0da9e89afa4babf3b8942d2b052fb8
36 changes: 22 additions & 14 deletions trunk/arch/mips/kernel/mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -132,35 +132,43 @@ ftrace_stub:
#ifdef CONFIG_FUNCTION_GRAPH_TRACER

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 */
#endif
#else
#ifndef CONFIG_DYNAMIC_FTRACE
MCOUNT_SAVE_REGS
move a1, ra /* arg2: next ip, selfaddr */
#endif

/* arg1: Get the location of the parent's return address */
#ifdef KBUILD_MCOUNT_RA_ADDRESS
bnez t0, 1f /* non-leaf func: t0 saved the location of the return address */
#ifdef CONFIG_DYNAMIC_FTRACE
PTR_L a0, PT_R12(sp)
#else
move a0, t0
#endif
bnez a0, 1f /* non-leaf func: stored in t0 */
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 */
#endif
PTR_LA a0, PT_R1(sp) /* leaf func: the location in current stack */
1:

/* arg2: Get self return address */
#ifdef CONFIG_DYNAMIC_FTRACE
PTR_L a1, PT_R31(sp)
#else
PTR_LA a0, PT_R1(sp) /* arg1: &AT -> a0 */
move a1, ra
#endif
jal prepare_ftrace_return

/* arg3: Get frame pointer of current stack */
#ifdef CONFIG_FRAME_POINTER
move a2, fp /* arg3: frame pointer */
#else
move a2, fp
#else /* ! CONFIG_FRAME_POINTER */
#ifdef CONFIG_64BIT
PTR_LA a2, PT_SIZE(sp)
#else
PTR_LA a2, (PT_SIZE+8)(sp)
#endif
#endif

jal prepare_ftrace_return
nop
MCOUNT_RESTORE_REGS
RETURN_BACK
END(ftrace_graph_caller)
Expand Down

0 comments on commit c071d56

Please sign in to comment.