aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-11-26 00:16:26 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-26 00:52:56 -0500
commit660c7f9be96321fc80026d76411bd15e6f418a72 (patch)
tree5ae61fa51c9e9ce7b42f64cfaa168cd09439ac3d /kernel/trace/trace_functions_graph.c
parente53a6319cca69111c1643dc9f18f4465d7f1cbf0 (diff)
ftrace: add thread comm to function graph tracer
Impact: enhancement to function graph tracer Export the trace_find_cmdline so the function graph tracer can use it to print the comms of the threads. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
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