Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138467
b: refs/heads/master
c: fad4f47
h: refs/heads/master
i:
  138465: 12f03c6
  138463: a5c8210
v: v3
  • Loading branch information
Steven Rostedt authored and Benjamin Herrenschmidt committed Feb 22, 2009
1 parent c80bb8f commit 2b1dfa3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 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: bf528a3a9bd11b6ae39684b18c9c0678f23924fd
refs/heads/master: fad4f47cc8b2b8f7e7d062c40c66188cdf783137
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ config PPC
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER if PPC64
select HAVE_FUNCTION_GRAPH_TRACER if PPC64 || !DYNAMIC_FTRACE
select ARCH_WANT_OPTIONAL_GPIOLIB
select HAVE_IDE
select HAVE_IOREMAP_PROT
Expand Down
43 changes: 42 additions & 1 deletion trunk/arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -1199,9 +1199,11 @@ _GLOBAL(_mcount)

mtctr r5
bctrl

nop

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
b ftrace_graph_caller
#endif
MCOUNT_RESTORE_FRAME

bctr
Expand All @@ -1210,4 +1212,43 @@ _GLOBAL(_mcount)
_GLOBAL(ftrace_stub)
blr

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
_GLOBAL(ftrace_graph_caller)
/* load r4 with local address */
lwz r4, 44(r1)
subi r4, r4, MCOUNT_INSN_SIZE

/* get the parent address */
addi r3, r1, 52

bl prepare_ftrace_return
nop

MCOUNT_RESTORE_FRAME
/* old link register ends up in ctr reg */
bctr

_GLOBAL(return_to_handler)
/* need to save return values */
stwu r1, -32(r1)
stw r3, 20(r1)
stw r4, 16(r1)
stw r31, 12(r1)
mr r31, r1

bl ftrace_return_to_handler
nop

/* return value has real return address */
mtlr r3

lwz r3, 20(r1)
lwz r4, 16(r1)
lwz r31,12(r1)
lwz r1, 0(r1)

/* Jump back to real return address */
blr
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */

#endif /* CONFIG_MCOUNT */
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
"1: " PPC_LL "%[old], 0(%[parent])\n"
"2: " PPC_STL "%[return_hooker], 0(%[parent])\n"
" li %[faulted], 0\n"
"3:"
"3:\n"

".section .fixup, \"ax\"\n"
"4: li %[faulted], 1\n"
Expand Down

0 comments on commit 2b1dfa3

Please sign in to comment.