]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.140/tracing-fix-missing-return-symbol-in-function_graph-output.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.140 / tracing-fix-missing-return-symbol-in-function_graph-output.patch
1 From 1fe4293f4b8de75824935f8d8e9a99c7fc6873da Mon Sep 17 00:00:00 2001
2 From: Changbin Du <changbin.du@intel.com>
3 Date: Wed, 31 Jan 2018 23:48:49 +0800
4 Subject: tracing: Fix missing return symbol in function_graph output
5
6 From: Changbin Du <changbin.du@intel.com>
7
8 commit 1fe4293f4b8de75824935f8d8e9a99c7fc6873da upstream.
9
10 The function_graph tracer does not show the interrupt return marker for the
11 leaf entry. On leaf entries, we see an unbalanced interrupt marker (the
12 interrupt was entered, but nevern left).
13
14 Before:
15 1) | SyS_write() {
16 1) | __fdget_pos() {
17 1) 0.061 us | __fget_light();
18 1) 0.289 us | }
19 1) | vfs_write() {
20 1) 0.049 us | rw_verify_area();
21 1) + 15.424 us | __vfs_write();
22 1) ==========> |
23 1) 6.003 us | smp_apic_timer_interrupt();
24 1) 0.055 us | __fsnotify_parent();
25 1) 0.073 us | fsnotify();
26 1) + 23.665 us | }
27 1) + 24.501 us | }
28
29 After:
30 0) | SyS_write() {
31 0) | __fdget_pos() {
32 0) 0.052 us | __fget_light();
33 0) 0.328 us | }
34 0) | vfs_write() {
35 0) 0.057 us | rw_verify_area();
36 0) | __vfs_write() {
37 0) ==========> |
38 0) 8.548 us | smp_apic_timer_interrupt();
39 0) <========== |
40 0) + 36.507 us | } /* __vfs_write */
41 0) 0.049 us | __fsnotify_parent();
42 0) 0.066 us | fsnotify();
43 0) + 50.064 us | }
44 0) + 50.952 us | }
45
46 Link: http://lkml.kernel.org/r/1517413729-20411-1-git-send-email-changbin.du@intel.com
47
48 Cc: stable@vger.kernel.org
49 Fixes: f8b755ac8e0cc ("tracing/function-graph-tracer: Output arrows signal on hardirq call/return")
50 Signed-off-by: Changbin Du <changbin.du@intel.com>
51 Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
52 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
53
54 ---
55 kernel/trace/trace_functions_graph.c | 5 ++++-
56 1 file changed, 4 insertions(+), 1 deletion(-)
57
58 --- a/kernel/trace/trace_functions_graph.c
59 +++ b/kernel/trace/trace_functions_graph.c
60 @@ -768,6 +768,7 @@ print_graph_entry_leaf(struct trace_iter
61 struct ftrace_graph_ret *graph_ret;
62 struct ftrace_graph_ent *call;
63 unsigned long long duration;
64 + int cpu = iter->cpu;
65 int i;
66
67 graph_ret = &ret_entry->ret;
68 @@ -776,7 +777,6 @@ print_graph_entry_leaf(struct trace_iter
69
70 if (data) {
71 struct fgraph_cpu_data *cpu_data;
72 - int cpu = iter->cpu;
73
74 cpu_data = per_cpu_ptr(data->cpu_data, cpu);
75
76 @@ -806,6 +806,9 @@ print_graph_entry_leaf(struct trace_iter
77
78 trace_seq_printf(s, "%ps();\n", (void *)call->func);
79
80 + print_graph_irq(iter, graph_ret->func, TRACE_GRAPH_RET,
81 + cpu, iter->ent->pid, flags);
82 +
83 return trace_handle_return(s);
84 }
85