Skip to content

Commit

Permalink
Blackfin: support new ftrace frame pointer semantics
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Mike Frysinger committed Mar 9, 2010
1 parent aebfef0 commit b73faf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions arch/blackfin/kernel/ftrace-entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,12 @@ ENTRY(_ftrace_graph_caller)
[--sp] = r1;
[--sp] = rets;

/* prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) */
r0 = sp;
r1 = rets;
/* prepare_ftrace_return(parent, self_addr, frame_pointer) */
r0 = sp; /* unsigned long *parent */
r1 = rets; /* unsigned long self_addr */
#ifdef CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST
r2 = fp; /* unsigned long frame_pointer */
#endif
r0 += 16; /* skip the 4 local regs on stack */
r1 += -MCOUNT_INSN_SIZE;
call _prepare_ftrace_return;
Expand All @@ -136,6 +139,9 @@ ENTRY(_return_to_handler)
[--sp] = r1;

/* get original return address */
#ifdef CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST
r0 = fp; /* Blackfin is sane, so omit this */
#endif
call _ftrace_return_to_handler;
rets = r0;

Expand Down
6 changes: 4 additions & 2 deletions arch/blackfin/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
* Hook the return address and push it in the stack of return addrs
* in current thread info.
*/
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
unsigned long frame_pointer)
{
struct ftrace_graph_ent trace;
unsigned long return_hooker = (unsigned long)&return_to_handler;

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

if (ftrace_push_return_trace(*parent, self_addr, &trace.depth, 0) == -EBUSY)
if (ftrace_push_return_trace(*parent, self_addr, &trace.depth,
frame_pointer) == -EBUSY)
return;

trace.func = self_addr;
Expand Down

0 comments on commit b73faf7

Please sign in to comment.