aboutsummaryrefslogtreecommitdiffstats
path: root/trace-graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-graph.c')
-rw-r--r--trace-graph.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/trace-graph.c b/trace-graph.c
index f63c202..de29e45 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -55,6 +55,7 @@
55#define PLOT_GIVE 2 55#define PLOT_GIVE 2
56#define PLOT_BEGIN 80 56#define PLOT_BEGIN 80
57#define PLOT_SEP 50 57#define PLOT_SEP 50
58#define MAX_TRI_TIME 50000000
58#define PLOT_LINE(plot) (PLOT_SEP * (plot) + PLOT_BEGIN + PLOT_SIZE) 59#define PLOT_LINE(plot) (PLOT_SEP * (plot) + PLOT_BEGIN + PLOT_SIZE)
59#define PLOT_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE * 2) 60#define PLOT_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE * 2)
60#define PLOT_BOX_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE) 61#define PLOT_BOX_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE)
@@ -86,6 +87,11 @@ static guint64 convert_x_to_time(struct graph_info *ginfo, gint x)
86 return (guint64)(d / ginfo->resolution) + ginfo->view_start_time; 87 return (guint64)(d / ginfo->resolution) + ginfo->view_start_time;
87} 88}
88 89
90static int convert_dist_to_time(struct graph_info *ginfo, int dist)
91{
92 return convert_x_to_time(ginfo, dist) - convert_x_to_time(ginfo, 0);
93}
94
89static void print_time(unsigned long long time) 95static void print_time(unsigned long long time)
90{ 96{
91 unsigned long sec, usec; 97 unsigned long sec, usec;
@@ -1697,9 +1703,11 @@ static void draw_plot_release(struct graph_info *ginfo, int i,
1697 tpoints[2].x = x + PLOT_TRI_SIZE/2; 1703 tpoints[2].x = x + PLOT_TRI_SIZE/2;
1698 tpoints[2].y = tbase; 1704 tpoints[2].y = tbase;
1699 1705
1700 gdk_draw_line(ginfo->curr_pixmap, gc, 1706 if (convert_dist_to_time(ginfo, PLOT_TRI_SIZE) < MAX_TRI_TIME) {
1701 x, tbase, x, PLOT_BOX_BOTTOM(i)); 1707 gdk_draw_line(ginfo->curr_pixmap, gc,
1702 gdk_draw_polygon(ginfo->curr_pixmap, gc, FALSE, tpoints, 3); 1708 x, tbase, x, PLOT_BOX_BOTTOM(i));
1709 gdk_draw_polygon(ginfo->curr_pixmap, gc, FALSE, tpoints, 3);
1710 }
1703} 1711}
1704 1712
1705static void draw_plot_deadline(struct graph_info *ginfo, int i, 1713static void draw_plot_deadline(struct graph_info *ginfo, int i,
@@ -1715,9 +1723,11 @@ static void draw_plot_deadline(struct graph_info *ginfo, int i,
1715 tpoints[2].x = x + PLOT_TRI_SIZE/2; 1723 tpoints[2].x = x + PLOT_TRI_SIZE/2;
1716 tpoints[2].y = tbase; 1724 tpoints[2].y = tbase;
1717 1725
1718 gdk_draw_line(ginfo->curr_pixmap, gc, 1726 if (convert_dist_to_time(ginfo, PLOT_TRI_SIZE) < MAX_TRI_TIME) {
1719 x, PLOT_BOX_TOP(i), x, tbase); 1727 gdk_draw_line(ginfo->curr_pixmap, gc,
1720 gdk_draw_polygon(ginfo->curr_pixmap, gc, FALSE, tpoints, 3); 1728 x, PLOT_BOX_TOP(i), x, tbase);
1729 gdk_draw_polygon(ginfo->curr_pixmap, gc, FALSE, tpoints, 3);
1730 }
1721} 1731}
1722 1732
1723static void draw_plot_completion(struct graph_info *ginfo, int i, 1733static void draw_plot_completion(struct graph_info *ginfo, int i,
@@ -1733,7 +1743,9 @@ static void draw_plot_completion(struct graph_info *ginfo, int i,
1733 tpoints[2].x = x + PLOT_BTRI_SIZE/2; 1743 tpoints[2].x = x + PLOT_BTRI_SIZE/2;
1734 tpoints[2].y = tbase; 1744 tpoints[2].y = tbase;
1735 1745
1736 gdk_draw_polygon(ginfo->curr_pixmap, gc, TRUE, tpoints, 3); 1746 if (convert_dist_to_time(ginfo, PLOT_BTRI_SIZE) < MAX_TRI_TIME) {
1747 gdk_draw_polygon(ginfo->curr_pixmap, gc, TRUE, tpoints, 3);
1748 }
1737} 1749}
1738 1750
1739static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot, 1751static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot,