Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138465
b: refs/heads/master
c: bb72534
h: refs/heads/master
i:
  138463: a5c8210
v: v3
  • Loading branch information
Steven Rostedt authored and Benjamin Herrenschmidt committed Feb 22, 2009
1 parent 6c29fd7 commit 12f03c6
Show file tree
Hide file tree
Showing 3 changed files with 38 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: 465428884765b43d642a967915e16c6c7cacbe8e
refs/heads/master: bb7253403f7a4670a128e4c080fd8ea1bd4d5029
27 changes: 26 additions & 1 deletion trunk/arch/powerpc/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,28 @@ _GLOBAL(ftrace_graph_caller)
blr

_GLOBAL(return_to_handler)
/* need to save return values */
std r4, -24(r1)
std r3, -16(r1)
std r31, -8(r1)
mr r31, r1
stdu r1, -112(r1)

bl .ftrace_return_to_handler
nop

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

ld r1, 0(r1)
ld r4, -24(r1)
ld r3, -16(r1)
ld r31, -8(r1)

/* Jump back to real return address */
blr

_GLOBAL(mod_return_to_handler)
/* need to save return values */
std r4, -32(r1)
std r3, -24(r1)
Expand All @@ -979,7 +1001,10 @@ _GLOBAL(return_to_handler)
mr r31, r1
stdu r1, -112(r1)

/* update the TOC */
/*
* We are in a module using the module's TOC.
* Switch to our TOC to run inside the core kernel.
*/
LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
ld r2, 8(r4)

Expand Down
13 changes: 11 additions & 2 deletions trunk/arch/powerpc/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ int ftrace_disable_ftrace_graph_caller(void)
}
#endif /* CONFIG_DYNAMIC_FTRACE */

#ifdef CONFIG_PPC64
extern void mod_return_to_handler(void);
#endif

/*
* Hook the return address and push it in the stack of return addrs
* in current thread info.
Expand All @@ -577,12 +581,17 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
unsigned long long calltime;
int faulted;
struct ftrace_graph_ent trace;
unsigned long return_hooker = (unsigned long)
&return_to_handler;
unsigned long return_hooker = (unsigned long)&return_to_handler;

if (unlikely(atomic_read(&current->tracing_graph_pause)))
return;

#if CONFIG_PPC64
/* non core kernel code needs to save and restore the TOC */
if (REGION_ID(self_addr) != KERNEL_REGION_ID)
return_hooker = (unsigned long)&mod_return_to_handler;
#endif

return_hooker = GET_ADDR(return_hooker);

/*
Expand Down

0 comments on commit 12f03c6

Please sign in to comment.