diff options
author | Jonathan <hermanjl@hermanjl-Aspire-5553G.(none)> | 2012-03-08 16:02:28 -0500 |
---|---|---|
committer | Jonathan <hermanjl@hermanjl-Aspire-5553G.(none)> | 2012-03-08 16:02:28 -0500 |
commit | f63a8fd5b4c431f1e271829af0760939f226f72c (patch) | |
tree | 67dfe7708cd0fde2359f6bb8dede885a07430233 | |
parent | 974e24aaa13b710713b1654b11ffeefafef3723e (diff) |
rt-graph: triangles only appear when their width < 50ms
-rw-r--r-- | rt-plot-task.c | 2 | ||||
-rw-r--r-- | trace-graph.c | 26 |
2 files changed, 20 insertions, 8 deletions
diff --git a/rt-plot-task.c b/rt-plot-task.c index 57662b7..1e2cd5d 100644 --- a/rt-plot-task.c +++ b/rt-plot-task.c | |||
@@ -768,7 +768,7 @@ void rt_plot_task(struct graph_info *ginfo, int pid, int pos) | |||
768 | len = strlen(comm) + 100; | 768 | len = strlen(comm) + 100; |
769 | plot_label = malloc_or_die(len); | 769 | plot_label = malloc_or_die(len); |
770 | snprintf(plot_label, len, | 770 | snprintf(plot_label, len, |
771 | "*%s-%d\n(%llu.%1llu, %llu.%1llu)", | 771 | "%s-%d\n(%llu.%1llu, %llu.%1llu)", |
772 | comm, pid, wm, wn, pm, pn); | 772 | comm, pid, wm, wn, pm, pn); |
773 | plot = trace_graph_plot_insert(ginfo, pos, plot_label, PLOT_TYPE_RT_TASK, | 773 | plot = trace_graph_plot_insert(ginfo, pos, plot_label, PLOT_TYPE_RT_TASK, |
774 | &rt_task_cb, rtt_info); | 774 | &rt_task_cb, rtt_info); |
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 | ||
90 | static 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 | |||
89 | static void print_time(unsigned long long time) | 95 | static 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 | ||
1705 | static void draw_plot_deadline(struct graph_info *ginfo, int i, | 1713 | static 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 | ||
1723 | static void draw_plot_completion(struct graph_info *ginfo, int i, | 1733 | static 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 | ||
1739 | static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot, | 1751 | static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot, |