aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-17 14:54:09 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-17 22:54:46 -0500
commit540cf9cdbfaa7190f07d5c20a4a2d720601858b4 (patch)
tree329cb5f6875bb98e72508c7dbd433b86c09cfb75
parent84d8f979716e4fec0e8df7e32776c60b5c10f40d (diff)
trace-graph: Fix missing lines at start and end of graph
The start and end of the graph did not add task lines if the running task was not idle at either the start or end of the trace. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-graph.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/trace-graph.c b/trace-graph.c
index dd99b4b..b2ff3b2 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -661,7 +661,7 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
661 struct record *record; 661 struct record *record;
662 static GdkGC *gc; 662 static GdkGC *gc;
663 guint64 ts; 663 guint64 ts;
664 gint last_pid = 0; 664 gint last_pid = -1;
665 gint last_x = 0; 665 gint last_x = 0;
666 gint pid; 666 gint pid;
667 gint x; 667 gint x;
@@ -690,6 +690,10 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
690 pid = pevent_data_pid(ginfo->pevent, record); 690 pid = pevent_data_pid(ginfo->pevent, record);
691 691
692 if (last_pid != pid) { 692 if (last_pid != pid) {
693
694 if (last_pid < 0)
695 last_pid = pid;
696
693 if (last_pid) { 697 if (last_pid) {
694 gdk_draw_line(ginfo->curr_pixmap, gc, 698 gdk_draw_line(ginfo->curr_pixmap, gc,
695 last_x, CPU_TOP(cpu), 699 last_x, CPU_TOP(cpu),
@@ -710,6 +714,18 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
710 free(record); 714 free(record);
711 } 715 }
712 716
717
718 if (last_pid > 0) {
719 x = ginfo->draw_width;
720
721 gdk_draw_line(ginfo->curr_pixmap, gc,
722 last_x, CPU_TOP(cpu),
723 x, CPU_TOP(cpu));
724 gdk_draw_line(ginfo->curr_pixmap, gc,
725 last_x, CPU_BOTTOM(cpu),
726 x, CPU_BOTTOM(cpu));
727 }
728
713 if (record) 729 if (record)
714 free(record); 730 free(record);
715} 731}