summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/ftrace.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2012-07-18 20:15:25 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-07-31 11:30:42 +0200
commit4c36595ec87115f2f876f7d4fdec8ca284a42b9c (patch)
treec2700142f13685ab8d5671284344044bc38e2ebc /arch/arm/kernel/ftrace.c
parentARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+ (diff)
downloadlinux-4c36595ec87115f2f876f7d4fdec8ca284a42b9c.tar.xz
linux-4c36595ec87115f2f876f7d4fdec8ca284a42b9c.zip
ARM: 7468/1: 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. Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/ftrace.c')
-rw-r--r--arch/arm/kernel/ftrace.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index df0bf0c8cb79..34e56647dcee 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -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;
}
}