aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index b6f0cc2a00cb..bbb81e7b6c40 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -32,29 +32,40 @@ static pid_t last_pid = -1;
32 32
33static int graph_trace_init(struct trace_array *tr) 33static int graph_trace_init(struct trace_array *tr)
34{ 34{
35 int cpu; 35 int cpu, ret;
36
36 for_each_online_cpu(cpu) 37 for_each_online_cpu(cpu)
37 tracing_reset(tr, cpu); 38 tracing_reset(tr, cpu);
38 39
39 return register_ftrace_graph(&trace_graph_return, 40 ret = register_ftrace_graph(&trace_graph_return,
40 &trace_graph_entry); 41 &trace_graph_entry);
42 if (ret)
43 return ret;
44 tracing_start_cmdline_record();
45
46 return 0;
41} 47}
42 48
43static void graph_trace_reset(struct trace_array *tr) 49static void graph_trace_reset(struct trace_array *tr)
44{ 50{
45 unregister_ftrace_graph(); 51 tracing_stop_cmdline_record();
52 unregister_ftrace_graph();
46} 53}
47 54
48/* If the pid changed since the last trace, output this event */ 55/* If the pid changed since the last trace, output this event */
49static int verif_pid(struct trace_seq *s, pid_t pid) 56static int verif_pid(struct trace_seq *s, pid_t pid)
50{ 57{
58 char *comm;
59
51 if (last_pid != -1 && last_pid == pid) 60 if (last_pid != -1 && last_pid == pid)
52 return 1; 61 return 1;
53 62
54 last_pid = pid; 63 last_pid = pid;
55 return trace_seq_printf(s, "\n------------8<---------- thread %d" 64 comm = trace_find_cmdline(pid);
65
66 return trace_seq_printf(s, "\n------------8<---------- thread %s-%d"
56 " ------------8<----------\n\n", 67 " ------------8<----------\n\n",
57 pid); 68 comm, pid);
58} 69}
59 70
60static enum print_line_t 71static enum print_line_t