aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-09-17 20:08:25 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-09-17 20:22:21 -0400
commit16a0cfc7747b20b9f9825a7de6fdea34a3548e32 (patch)
tree3adec7fabf8df7bbf4ef26f2b910f50372e74791
parenta8f2fd9a33c07f2f528137db4c46820749c8a444 (diff)
trace-graph: Show CPU not task on task plot display
The plot of a task, we already know what task it is. It would be nice to know what CPU a task is on at a given location. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-plot-task.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index f341493..6ba4fb1 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -684,7 +684,9 @@ int task_plot_display_info(struct graph_info *ginfo,
684 struct pevent *pevent; 684 struct pevent *pevent;
685 unsigned long sec, usec; 685 unsigned long sec, usec;
686 const char *comm; 686 const char *comm;
687 int cpu;
687 int type; 688 int type;
689 int sched_pid = -1;
688 int pid; 690 int pid;
689 691
690 pid = task_info->pid; 692 pid = task_info->pid;
@@ -695,7 +697,7 @@ int task_plot_display_info(struct graph_info *ginfo,
695 pevent = ginfo->pevent; 697 pevent = ginfo->pevent;
696 698
697 pid = pevent_data_pid(ginfo->pevent, record); 699 pid = pevent_data_pid(ginfo->pevent, record);
698 comm = pevent_data_comm_from_pid(ginfo->pevent, pid); 700 cpu = record->cpu;
699 701
700 convert_nano(record->ts, &sec, &usec); 702 convert_nano(record->ts, &sec, &usec);
701 703
@@ -713,16 +715,12 @@ int task_plot_display_info(struct graph_info *ginfo,
713 trace_seq_putc(s, '\n'); 715 trace_seq_putc(s, '\n');
714 } else 716 } else
715 trace_seq_printf(s, "UNKNOW EVENT %d\n", type); 717 trace_seq_printf(s, "UNKNOW EVENT %d\n", type);
716 } else {
717 if (record->ts < time)
718 trace_graph_check_sched_switch(ginfo, record, &pid, &comm);
719 } 718 }
719 trace_graph_check_sched_switch(ginfo, record, &sched_pid, &comm);
720 720
721 trace_seq_printf(s, "%lu.%06lu", sec, usec); 721 trace_seq_printf(s, "%lu.%06lu", sec, usec);
722 if (pid) 722 if (pid == task_info->pid || sched_pid == task_info->pid)
723 trace_seq_printf(s, " %s-%d", comm, pid); 723 trace_seq_printf(s, " CPU: %03d", cpu);
724 else
725 trace_seq_puts(s, " <idle>");
726 724
727 free_record(record); 725 free_record(record);
728 726