Skip to content

Commit b73faf7

Browse files
committed
Blackfin: support new ftrace frame pointer semantics
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1 parent aebfef0 commit b73faf7

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎arch/blackfin/kernel/ftrace-entry.S‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,12 @@ ENTRY(_ftrace_graph_caller)
115115
[--sp] = r1;
116116
[--sp] = rets;
117117

118-
/* prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) */
119-
r0 = sp;
120-
r1 = rets;
118+
/* prepare_ftrace_return(parent, self_addr, frame_pointer) */
119+
r0 = sp; /* unsigned long *parent */
120+
r1 = rets; /* unsigned long self_addr */
121+
#ifdef CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST
122+
r2 = fp; /* unsigned long frame_pointer */
123+
#endif
121124
r0 += 16; /* skip the 4 local regs on stack */
122125
r1 += -MCOUNT_INSN_SIZE;
123126
call _prepare_ftrace_return;
@@ -136,6 +139,9 @@ ENTRY(_return_to_handler)
136139
[--sp] = r1;
137140

138141
/* get original return address */
142+
#ifdef CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST
143+
r0 = fp; /* Blackfin is sane, so omit this */
144+
#endif
139145
call _ftrace_return_to_handler;
140146
rets = r0;
141147

‎arch/blackfin/kernel/ftrace.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
* Hook the return address and push it in the stack of return addrs
1717
* in current thread info.
1818
*/
19-
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
19+
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
20+
unsigned long frame_pointer)
2021
{
2122
struct ftrace_graph_ent trace;
2223
unsigned long return_hooker = (unsigned long)&return_to_handler;
2324

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

27-
if (ftrace_push_return_trace(*parent, self_addr, &trace.depth, 0) == -EBUSY)
28+
if (ftrace_push_return_trace(*parent, self_addr, &trace.depth,
29+
frame_pointer) == -EBUSY)
2830
return;
2931

3032
trace.func = self_addr;

0 commit comments

Comments
 (0)