From 93290e83d330653f090b3780e59ea5d2bf1e3bca Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Fri, 5 Oct 2012 17:14:37 -0400 Subject: Rewrote set_cpu_to_rts() and iterate() for increased performance and accuracy. Container job information functions, like displaying the job in the server's boxes or the currently running task in pop-ups, rewritten to take advantage of these changes. --- rt-plot-vcpu.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'rt-plot-vcpu.c') diff --git a/rt-plot-vcpu.c b/rt-plot-vcpu.c index 8f850b9..e39ae19 100644 --- a/rt-plot-vcpu.c +++ b/rt-plot-vcpu.c @@ -13,12 +13,12 @@ #define dprintf(l, x...) do { if (0) printf(x); } while (0) #endif -static void update_tid(struct vcpu_info *info, int tid) +static void update_label(struct vcpu_info *info, int tid, int tjob) { info->fresh = FALSE; if (tid != info->run_tid) { info->run_tid = tid; - snprintf(info->label, LLABEL, "%d", tid); + snprintf(info->label, LLABEL, "%d:%d", tid, tjob); } } @@ -33,7 +33,7 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, &sid, &job, &tid, &tjob, &ts); if (match && sid == vcpu_info->sid) { - update_tid(vcpu_info, tid); + update_label(vcpu_info, tid, tjob); if (vcpu_info->run_time && vcpu_info->run_time < ts) { info->box = TRUE; @@ -66,7 +66,7 @@ static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu match = rt_graph_check_server_switch_to(ginfo, record, &sid, &job, &tid, &tjob, &ts); if (match && sid == vcpu_info->sid) { - update_tid(vcpu_info, tid); + update_label(vcpu_info, tid, tjob); vcpu_info->run_time = ts; vcpu_info->run_cpu = record->cpu; vcpu_info->run_tid = tid; @@ -151,7 +151,7 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, &release, &deadline, &job, &tid, &tjob, &record); if (is_running) { - update_tid(vcpu_info, tid); + update_label(vcpu_info, tid, tjob); info->box = TRUE; info->bcolor = hash_pid(vcpu_info->run_tid); info->bfill = is_task_running(ginfo, ginfo->view_end_time, tid); @@ -251,7 +251,7 @@ void rt_vcpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot, vcpu_info->fresh = TRUE; vcpu_info->running = FALSE; vcpu_info->last_job = -1; - update_tid(vcpu_info, 0); + update_label(vcpu_info, 0, 0); } /** @@ -276,15 +276,15 @@ int rt_vcpu_plot_record_matches(struct rt_plot_common *rt, int dint, sid, match; unsigned long long dull; -#define ARG ginfo, record, &sid - match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dint, &dull) || - rt_graph_check_server_switch_away(ARG, &dint, &dint, &dint, &dull); - /* rt_graph_check_server_completion(ARG, &dint, &dull) || */ - /* rt_graph_check_server_release(ARG, &dint, &dull, &dull); */ - /* rt_graph_check_server_block(ARG, &dull) || */ - /* rt_graph_check_server_resume(ARG, &dull); */ +#define ARG ginfo, record, &sid, &dint + match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dull) || + rt_graph_check_server_switch_away(ARG,&dint, &dint, &dull); + rt_graph_check_server_completion(ARG, &dull) || + rt_graph_check_server_release(ARG, &dull, &dull); + rt_graph_check_server_block(ARG, &dull) || + rt_graph_check_server_resume(ARG, &dull); #undef ARG - return (sid == vcpu_info->sid); + return (match && sid == vcpu_info->sid); } /** -- cgit v1.2.2