aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-10-11 02:55:57 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 11:17:03 -0400
commit05e0baaf9ba5a2d173c026530154388f0d2da72c (patch)
treee65a96f6a3e986b0b1f41a815dbb31721db24383
parent5ff4212f194f97b3a0f41745f231525c5c50dcbb (diff)
s390/ftrace: prepare_ftrace_return() function call order
Steven Rostedt noted that s390 is the only architecture which calls ftrace_push_return_trace() before ftrace_graph_entry() and therefore has the small advantage that trace.depth gets initialized automatically. However this small advantage isn't worth the difference and possible subtle breakage that may result from this. So change s390 to have the same function call order like all other architectures: first ftrace_graph_entry(), then ftrace_push_return_trace() Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/kernel/ftrace.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index 1014ad5f7693..224db03e9518 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -151,14 +151,13 @@ unsigned long __kprobes prepare_ftrace_return(unsigned long parent,
151 if (unlikely(atomic_read(&current->tracing_graph_pause))) 151 if (unlikely(atomic_read(&current->tracing_graph_pause)))
152 goto out; 152 goto out;
153 ip = (ip & PSW_ADDR_INSN) - MCOUNT_INSN_SIZE; 153 ip = (ip & PSW_ADDR_INSN) - MCOUNT_INSN_SIZE;
154 if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
155 goto out;
156 trace.func = ip; 154 trace.func = ip;
155 trace.depth = current->curr_ret_stack + 1;
157 /* Only trace if the calling function expects to. */ 156 /* Only trace if the calling function expects to. */
158 if (!ftrace_graph_entry(&trace)) { 157 if (!ftrace_graph_entry(&trace))
159 current->curr_ret_stack--; 158 goto out;
159 if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
160 goto out; 160 goto out;
161 }
162 parent = (unsigned long) return_to_handler; 161 parent = (unsigned long) return_to_handler;
163out: 162out:
164 return parent; 163 return parent;