aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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