ARM: ftrace: Trace function entry before updating index
Subsystems (2)
PATCH 1/1 ARM: ftrace: Trace function entry before updating index
Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to avoid tracing all functions called from irqs when function graph was used with a filter. Port the same fix to ARM.
---
It looks like the same issue affects blackfin, microblaze, mips, parisc, powerpc, s390, sh, and sparc, but I don't have patches to fix those.
arch/arm/kernel/ftrace.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)
arch/arm/kernel/ftrace.c +9 -8
@@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, old = *parent; *parent = return_hooker; - err =ftrace_push_return_trace (old, self_addr, &trace.depth, - frame_pointer); -if (err == -EBUSY ) { - *parent = old; -return ; - } - trace.func = self_addr; + trace.depth = current->curr_ret_stack +1 ;/* Only trace if the calling function expects to */ if (!ftrace_graph_entry (&trace)) { - current->curr_ret_stack--; *parent = old; +return ; + } + + err =ftrace_push_return_trace (old, self_addr, &trace.depth, + frame_pointer); +if (err == -EBUSY ) { + *parent = old; +return ; } }
Signature · 1 line
1.7.7.3
Quoted 5 lines · Colin Cross
Commit
722b3c74695377d11d18a52f3da08114d37f3f37modified x86 ftrace to avoid tracing all functions called from irqs when function graph was used with a filter. Port the same fix to ARM.Cc Steven Rostedt <[email protected]>
Someone on the ARM side needs to pull this in.
I'll look into fixing this for PPC.
Thanks!
-- Steve
Quoted 43 lines
Signed-off-by Colin Cross <[email protected]>---
It looks like the same issue affects blackfin, microblaze, mips, parisc, powerpc, s390, sh, and sparc, but I don't have patches to fix those.
arch/arm/kernel/ftrace.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)arch/arm/kernel/ftrace.c +9
-8@@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, old = *parent; *parent = return_hooker; - err =ftrace_push_return_trace (old, self_addr, &trace.depth, - frame_pointer); -if (err == -EBUSY ) { - *parent = old; -return ; - } - trace.func = self_addr; + trace.depth = current->curr_ret_stack +1 ;/* Only trace if the calling function expects to */ if (!ftrace_graph_entry (&trace)) { - current->curr_ret_stack--; *parent = old; +return ; + } + + err =ftrace_push_return_trace (old, self_addr, &trace.depth, + frame_pointer); +if (err == -EBUSY ) { + *parent = old; +return ; } }
Quoted 7 lines · Steven Rostedt
Quoted 5 lines · Colin Cross
Commit
722b3c74695377d11d18a52f3da08114d37f3f37modified x86 ftrace to avoid tracing all functions called from irqs when function graph was used with a filter. Port the same fix to ARM.Cc Steven Rostedt <[email protected]>
Quoted 7 lines
Acked-by Steven Rostedt <[email protected]>Someone on the ARM side needs to pull this in.
I'll look into fixing this for PPC.
Thanks!
Thanks, I'll put it in Russell's patch tracker.