summaryrefslogtreecommitdiff
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 06:52:56 +0100
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;
static int graph_trace_init(struct trace_array *tr)
{
- int cpu;
+ int cpu, ret;
+
for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
- return register_ftrace_graph(&trace_graph_return,
+ ret = register_ftrace_graph(&trace_graph_return,
&trace_graph_entry);
+ if (ret)
+ return ret;
+ tracing_start_cmdline_record();
+
+ return 0;
}
static void graph_trace_reset(struct trace_array *tr)
{
- unregister_ftrace_graph();
+ tracing_stop_cmdline_record();
+ unregister_ftrace_graph();
}
/* If the pid changed since the last trace, output this event */
static int verif_pid(struct trace_seq *s, pid_t pid)
{
+ char *comm;
+
if (last_pid != -1 && last_pid == pid)
return 1;
last_pid = pid;
- return trace_seq_printf(s, "\n------------8<---------- thread %d"
+ comm = trace_find_cmdline(pid);
+
+ return trace_seq_printf(s, "\n------------8<---------- thread %s-%d"
" ------------8<----------\n\n",
- pid);
+ comm, pid);
}
static enum print_line_t