diff options
Diffstat (limited to 'trace-graph.c')
-rw-r--r-- | trace-graph.c | 18 |
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 | } |