diff options
Diffstat (limited to 'rt-plot-vcpu.c')
-rw-r--r-- | rt-plot-vcpu.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/rt-plot-vcpu.c b/rt-plot-vcpu.c index fb1cf8d..7951ad4 100644 --- a/rt-plot-vcpu.c +++ b/rt-plot-vcpu.c | |||
@@ -2,7 +2,7 @@ | |||
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include "trace-graph.h" | 3 | #include "trace-graph.h" |
4 | 4 | ||
5 | #define DEBUG_LEVEL 0 | 5 | #define DEBUG_LEVEL 4 |
6 | #if DEBUG_LEVEL > 0 | 6 | #if DEBUG_LEVEL > 0 |
7 | #define dprintf(l, x...) \ | 7 | #define dprintf(l, x...) \ |
8 | do { \ | 8 | do { \ |
@@ -124,8 +124,7 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | |||
124 | if (match && sid == vcpu_info->sid) { | 124 | if (match && sid == vcpu_info->sid) { |
125 | update_tid(vcpu_info, tid); | 125 | update_tid(vcpu_info, tid); |
126 | 126 | ||
127 | if (vcpu_info->run_time && vcpu_info->run_time < ts && | 127 | if (vcpu_info->run_time < ts) { |
128 | job != 1) { | ||
129 | info->box = TRUE; | 128 | info->box = TRUE; |
130 | info->bcolor = hash_pid(tid); | 129 | info->bcolor = hash_pid(tid); |
131 | info->bfill = vcpu_info->running; | 130 | info->bfill = vcpu_info->running; |
@@ -214,13 +213,38 @@ static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info | |||
214 | return ret; | 213 | return ret; |
215 | } | 214 | } |
216 | 215 | ||
217 | |||
218 | static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | 216 | static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, |
219 | struct plot_info *info) | 217 | struct plot_info *info) |
220 | { | 218 | { |
221 | /* TODO: me */ | 219 | int tid, job, is_running; |
222 | } | 220 | unsigned long long deadline, release; |
221 | struct record *record; | ||
223 | 222 | ||
223 | if (vcpu_info->run_time && vcpu_info->run_cpu != NO_CPU) { | ||
224 | info->box = TRUE; | ||
225 | info->bcolor = hash_pid(vcpu_info->run_tid); | ||
226 | info->bfill = vcpu_info->running; | ||
227 | info->bstart = vcpu_info->run_time; | ||
228 | info->bend = ginfo->view_end_time; | ||
229 | info->blabel = vcpu_info->label; | ||
230 | } else if (vcpu_info->fresh) { | ||
231 | is_running = get_server_info(ginfo, | ||
232 | (struct rt_plot_common*)vcpu_info, | ||
233 | vcpu_info->sid, | ||
234 | ginfo->view_end_time, | ||
235 | &release, &deadline, | ||
236 | &job, &tid, &record); | ||
237 | if (is_running) { | ||
238 | update_tid(vcpu_info, tid); | ||
239 | info->box = TRUE; | ||
240 | info->bcolor = hash_pid(vcpu_info->run_tid); | ||
241 | info->bfill = is_task_running(ginfo, ginfo->view_end_time, tid); | ||
242 | info->bstart = vcpu_info->run_time; | ||
243 | info->bend = ginfo->view_end_time; | ||
244 | info->blabel = vcpu_info->label; | ||
245 | } | ||
246 | } | ||
247 | } | ||
224 | 248 | ||
225 | static int rt_vcpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot, | 249 | static int rt_vcpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot, |
226 | struct record *record, struct plot_info *info) | 250 | struct record *record, struct plot_info *info) |
@@ -261,8 +285,7 @@ static void rt_vcpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot | |||
261 | vcpu_info->fresh = TRUE; | 285 | vcpu_info->fresh = TRUE; |
262 | vcpu_info->running = FALSE; | 286 | vcpu_info->running = FALSE; |
263 | 287 | ||
264 | vcpu_info->run_tid = -1; | 288 | vcpu_info->run_tid = 0; |
265 | update_tid(vcpu_info, 0); | ||
266 | } | 289 | } |
267 | 290 | ||
268 | static void rt_vcpu_plot_destroy(struct graph_info *ginfo, struct graph_plot *plot) | 291 | static void rt_vcpu_plot_destroy(struct graph_info *ginfo, struct graph_plot *plot) |