aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-02-10 19:54:59 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-02-10 19:54:59 -0500
commit685beb7106e87cf620724ad39b2246b8bf50a7ad (patch)
tree0fdb4567b16804ad56db96b128289def748d6f9b
parent7f6c3bd40c02cbbf25831ab64efae2f560875888 (diff)
trace-graph: Show comm name for task plots
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-plot-task.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index 98a0301..eb302fb 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -569,13 +569,19 @@ void graph_plot_task(struct graph_info *ginfo, int pid)
569{ 569{
570 struct task_plot_info *task_info; 570 struct task_plot_info *task_info;
571 struct graph_plot *plot; 571 struct graph_plot *plot;
572 char label[100]; 572 const char *comm;
573 char *label;
574 int len;
573 575
574 task_info = malloc_or_die(sizeof(*task_info)); 576 task_info = malloc_or_die(sizeof(*task_info));
575 task_info->pid = pid; 577 task_info->pid = pid;
578 comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
576 579
577 snprintf(label, 100, "TASK %d", pid); 580 len = strlen(comm) + 100;
581 label = malloc_or_die(len);
582 snprintf(label, len, "%s-%d", comm, pid);
578 plot = trace_graph_plot_append(ginfo, label, &task_plot_cb, task_info); 583 plot = trace_graph_plot_append(ginfo, label, &task_plot_cb, task_info);
584 free(label);
579 585
580 trace_graph_plot_add_all_recs(ginfo, plot); 586 trace_graph_plot_add_all_recs(ginfo, plot);
581} 587}