]>
Commit | Line | Data |
---|---|---|
91d67d0f GKH |
1 | From 18588e1487b19e45bd90bd55ec8d3a1d44f3257f Mon Sep 17 00:00:00 2001 |
2 | From: "Steven Rostedt (VMware)" <rostedt@goodmis.org> | |
3 | Date: Sun, 18 Nov 2018 17:33:17 -0500 | |
4 | Subject: s390/function_graph: Simplify with function_graph_enter() | |
5 | ||
6 | From: Steven Rostedt (VMware) <rostedt@goodmis.org> | |
7 | ||
8 | commit 18588e1487b19e45bd90bd55ec8d3a1d44f3257f upstream. | |
9 | ||
10 | The function_graph_enter() function does the work of calling the function | |
11 | graph hook function and the management of the shadow stack, simplifying the | |
12 | work done in the architecture dependent prepare_ftrace_return(). | |
13 | ||
14 | Have s390 use the new code, and remove the shadow stack management as well as | |
15 | having to set up the trace structure. | |
16 | ||
17 | This is needed to prepare for a fix of a design bug on how the curr_ret_stack | |
18 | is used. | |
19 | ||
20 | Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> | |
21 | Cc: Heiko Carstens <heiko.carstens@de.ibm.com> | |
22 | Cc: Julian Wiedmann <jwi@linux.ibm.com> | |
23 | Cc: linux-s390@vger.kernel.org | |
24 | Cc: stable@kernel.org | |
25 | Fixes: 03274a3ffb449 ("tracing/fgraph: Adjust fgraph depth before calling trace return callback") | |
26 | Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> | |
27 | Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
29 | ||
30 | --- | |
31 | arch/s390/kernel/ftrace.c | 13 ++----------- | |
32 | 1 file changed, 2 insertions(+), 11 deletions(-) | |
33 | ||
34 | --- a/arch/s390/kernel/ftrace.c | |
35 | +++ b/arch/s390/kernel/ftrace.c | |
36 | @@ -203,22 +203,13 @@ device_initcall(ftrace_plt_init); | |
37 | */ | |
38 | unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip) | |
39 | { | |
40 | - struct ftrace_graph_ent trace; | |
41 | - | |
42 | if (unlikely(ftrace_graph_is_dead())) | |
43 | goto out; | |
44 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | |
45 | goto out; | |
46 | ip -= MCOUNT_INSN_SIZE; | |
47 | - trace.func = ip; | |
48 | - trace.depth = current->curr_ret_stack + 1; | |
49 | - /* Only trace if the calling function expects to. */ | |
50 | - if (!ftrace_graph_entry(&trace)) | |
51 | - goto out; | |
52 | - if (ftrace_push_return_trace(parent, ip, &trace.depth, 0, | |
53 | - NULL) == -EBUSY) | |
54 | - goto out; | |
55 | - parent = (unsigned long) return_to_handler; | |
56 | + if (!function_graph_enter(parent, ip, 0, NULL)) | |
57 | + parent = (unsigned long) return_to_handler; | |
58 | out: | |
59 | return parent; | |
60 | } |