diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-28 17:41:17 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-03-28 17:41:17 -0400 |
commit | 7ebeccc383b15c3aea44a00fe2e920c395378613 (patch) | |
tree | f02a9ebf1ace413a14d9b3fe48982f17178c4560 | |
parent | 57672aa4f46311a82d4a9437d512adb099a7f8bf (diff) |
containers: virtual cpu drawing refinemenets
-rw-r--r-- | rt-plot-vcpu.c | 39 | ||||
-rw-r--r-- | rt-plot-vcpu.h | 4 | ||||
-rw-r--r-- | rt-plot.h | 3 |
3 files changed, 38 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) |
diff --git a/rt-plot-vcpu.h b/rt-plot-vcpu.h index 14add34..9c50a63 100644 --- a/rt-plot-vcpu.h +++ b/rt-plot-vcpu.h | |||
@@ -6,13 +6,17 @@ struct vcpu_info { | |||
6 | struct rt_plot_common common; | 6 | struct rt_plot_common common; |
7 | 7 | ||
8 | int sid; | 8 | int sid; |
9 | |||
9 | int run_tid; | 10 | int run_tid; |
10 | int run_cpu; | 11 | int run_cpu; |
11 | unsigned long long run_time; | 12 | unsigned long long run_time; |
13 | |||
12 | int block_cpu; | 14 | int block_cpu; |
13 | unsigned long long block_time; | 15 | unsigned long long block_time; |
16 | |||
14 | gboolean fresh; | 17 | gboolean fresh; |
15 | gboolean running; | 18 | gboolean running; |
19 | |||
16 | char *label; | 20 | char *label; |
17 | 21 | ||
18 | struct cont_list *cont; | 22 | struct cont_list *cont; |
@@ -57,6 +57,9 @@ void set_cpu_to_rts(struct graph_info *ginfo, | |||
57 | unsigned long long rt_target, int cpu); | 57 | unsigned long long rt_target, int cpu); |
58 | void set_cpus_to_rts(struct graph_info *ginfo, | 58 | void set_cpus_to_rts(struct graph_info *ginfo, |
59 | unsigned long long rt_target); | 59 | unsigned long long rt_target); |
60 | int is_task_running(struct graph_info *ginfo, | ||
61 | unsigned long long time, | ||
62 | int pid); | ||
60 | struct record* get_previous_release(struct graph_info *ginfo, int tid, | 63 | struct record* get_previous_release(struct graph_info *ginfo, int tid, |
61 | unsigned long long time, int *job, | 64 | unsigned long long time, int *job, |
62 | unsigned long long *release, | 65 | unsigned long long *release, |