From ce75da68ec7f4b8a8ea5e66459d0828633af67fe Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Tue, 10 Apr 2012 12:24:53 -0400 Subject: containers: now working with real task systems --- rt-graph.c | 21 ++++++++---- rt-graph.h | 6 ++-- rt-plot-container.c | 10 +++--- rt-plot-container.h | 2 +- rt-plot-cpu.c | 4 --- rt-plot-task.c | 18 +++------- rt-plot-vcpu.c | 74 ++++++++++++++++++++++++---------------- rt-plot-vtask.c | 98 +++++++++++++++++++++++++---------------------------- rt-plot.c | 15 ++++---- rt-plot.h | 8 ++--- trace-graph.c | 2 +- 11 files changed, 132 insertions(+), 126 deletions(-) diff --git a/rt-graph.c b/rt-graph.c index 3a5949c..74a6aab 100644 --- a/rt-graph.c +++ b/rt-graph.c @@ -255,7 +255,7 @@ int rt_graph_check_task_param(struct graph_info *ginfo, if (id == rtg_info->task_param_id) { LOAD_INT(rtg_info, record, param, pid, pid); LOAD_LONG(rtg_info, record, param, wcet, &wcet); - LOAD_LONG(rtg_info, record, param, wcet, &period); + LOAD_LONG(rtg_info, record, param, period, &period); ret = 1; dprintf(3, "Read task_param record for task %d (%llu, %llu)\n", @@ -433,6 +433,7 @@ int rt_graph_check_task_completion(struct graph_info *ginfo, if (id == rtg_info->task_completion_id) { LOAD_INT(rtg_info, record, completion, pid, pid); LOAD_INT(rtg_info, record, completion, job, job); + *ts = get_rts(ginfo, record); ret = 1; dprintf(3, "Read task_completion (%d) record for job %d:%d " @@ -618,7 +619,8 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, */ int rt_graph_check_server_switch_to(struct graph_info *ginfo, struct record *record, - gint *sid, gint *job, gint *tid, + gint *sid, gint *job, + gint *tid, gint *tjob, unsigned long long *ts) { struct rt_graph_info *rtg_info = &ginfo->rtg_info; @@ -637,6 +639,7 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, STORE_FIELD(rtg_info, event, sswitch_to, sid); STORE_FIELD(rtg_info, event, sswitch_to, job); STORE_FIELD(rtg_info, event, sswitch_to, tid); + STORE_FIELD(rtg_info, event, sswitch_to, tjob); } id = pevent_data_type(pevent, record); @@ -644,9 +647,10 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, LOAD_INT(rtg_info, record, sswitch_to, sid, sid); LOAD_INT(rtg_info, record, sswitch_to, job, job); LOAD_INT(rtg_info, record, sswitch_to, tid, tid); + LOAD_INT(rtg_info, record, sswitch_to, tjob, tjob); *ts = get_rts(ginfo, record); - dprintf(3, "Read server_switch_to(job(%d, %d)): %d", + dprintf(3, "Read server_switch_to(job(%d, %d)): %d\n", *sid, *job, *tid); ret = 1; } @@ -660,7 +664,8 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, */ int rt_graph_check_server_switch_away(struct graph_info *ginfo, struct record *record, - gint *sid, gint *job, gint *tid, + gint *sid, gint *job, + gint *tid, gint *tjob, unsigned long long *ts) { struct rt_graph_info *rtg_info = &ginfo->rtg_info; @@ -679,6 +684,7 @@ int rt_graph_check_server_switch_away(struct graph_info *ginfo, STORE_FIELD(rtg_info, event, sswitch_away, sid); STORE_FIELD(rtg_info, event, sswitch_away, job); STORE_FIELD(rtg_info, event, sswitch_away, tid); + STORE_FIELD(rtg_info, event, sswitch_away, tjob); } id = pevent_data_type(pevent, record); @@ -686,10 +692,11 @@ int rt_graph_check_server_switch_away(struct graph_info *ginfo, LOAD_INT(rtg_info, record, sswitch_away, sid, sid); LOAD_INT(rtg_info, record, sswitch_away, job, job); LOAD_INT(rtg_info, record, sswitch_away, tid, tid); + LOAD_INT(rtg_info, record, sswitch_away, tjob, tjob); *ts = get_rts(ginfo, record); - dprintf(3, "Read server_switch_away(job(%d, %d)): %d", + dprintf(3, "Read server_switch_away(job(%d, %d)): %d\n", *sid, *job, *tid); ret = 1; } @@ -719,7 +726,7 @@ int rt_graph_check_server_release(struct graph_info *ginfo, if (!event) goto out; rtg_info->server_release_id = event->id; - dprintf(2, "Found server_switch_away id %d\n", event->id); + dprintf(2, "Found server_release id %d\n", event->id); STORE_FIELD(rtg_info, event, srelease, sid); STORE_FIELD(rtg_info, event, srelease, job); STORE_FIELD(rtg_info, event, srelease, release); @@ -762,7 +769,7 @@ int rt_graph_check_server_completion(struct graph_info *ginfo, if (!event) goto out; rtg_info->server_completion_id = event->id; - dprintf(2, "Found server_switch_away id %d\n", event->id); + dprintf(2, "Found server_completion id %d\n", event->id); STORE_FIELD(rtg_info, event, scompletion, sid); STORE_FIELD(rtg_info, event, scompletion, job); } diff --git a/rt-graph.h b/rt-graph.h index c44cf5b..853ffc6 100644 --- a/rt-graph.h +++ b/rt-graph.h @@ -76,11 +76,13 @@ struct rt_graph_info { struct format_field *sswitch_to_sid_field; struct format_field *sswitch_to_job_field; struct format_field *sswitch_to_tid_field; + struct format_field *sswitch_to_tjob_field; gint server_switch_away_id; struct format_field *sswitch_away_sid_field; struct format_field *sswitch_away_job_field; struct format_field *sswitch_away_tid_field; + struct format_field *sswitch_away_tjob_field; gint server_release_id; struct format_field *srelease_sid_field; @@ -180,11 +182,11 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, unsigned long long *period); int rt_graph_check_server_switch_to(struct graph_info *ginfo, struct record *record, - gint *sid, gint *job, gint *tid, + gint *sid, gint *job, gint *tid, gint *tjob, unsigned long long *when); int rt_graph_check_server_switch_away(struct graph_info *ginfo, struct record *record, - gint *sid, gint *job, gint *tid, + gint *sid, gint *job, gint *tid, gint *tjob, unsigned long long *when); int rt_graph_check_server_release(struct graph_info *ginfo, struct record *record, diff --git a/rt-plot-container.c b/rt-plot-container.c index 97e9fd8..cb814fa 100644 --- a/rt-plot-container.c +++ b/rt-plot-container.c @@ -26,11 +26,11 @@ int get_server_info(struct graph_info *ginfo, struct rt_plot_common *rt, int match_sid, unsigned long long time, unsigned long long *out_release, unsigned long long *out_deadline, - int *out_job, int *out_tid, + int *out_job, int *out_tid, int *out_tjob, struct record **out_record) { struct record *record; - int sid, job, tid, match, next_cpu, is_running = 0; + int sid, job, tid, tjob, match, next_cpu, is_running = 0; unsigned long long when, max_ts; *out_record = find_rt_record(ginfo, rt, time); @@ -55,10 +55,11 @@ int get_server_info(struct graph_info *ginfo, struct rt_plot_common *rt, break; match = rt_graph_check_server_switch_away(ginfo, record, - &sid, &job, &tid, + &sid, &job, &tid, &tjob, &when); if (match && sid == match_sid) { *out_tid = tid; + *out_tjob = tjob; is_running = 1; break; } @@ -88,8 +89,9 @@ void rt_plot_container(struct graph_info *ginfo, int cid) cont->plotted = TRUE; for (vlist = cont->vcpus; vlist; vlist = vlist->next) { - insert_vtask(ginfo, cont, vlist); insert_vcpu(ginfo, cont, vlist); + if (vlist->params.wcet && vlist->params.period) + insert_vtask(ginfo, cont, vlist); } } diff --git a/rt-plot-container.h b/rt-plot-container.h index cde5c2f..c96d6e9 100644 --- a/rt-plot-container.h +++ b/rt-plot-container.h @@ -17,6 +17,6 @@ int get_server_info(struct graph_info *ginfo, struct rt_plot_common *rt, int match_sid, unsigned long long time, unsigned long long *release, unsigned long long *deadline, - int *job, int *tid, struct record **record); + int *job, int *tid, int *tjob, struct record **record); #endif diff --git a/rt-plot-cpu.c b/rt-plot-cpu.c index ba380fb..cfc19c3 100644 --- a/rt-plot-cpu.c +++ b/rt-plot-cpu.c @@ -57,10 +57,6 @@ is_displayed(struct graph_info *ginfo, int eid) struct rt_graph_info *rtg_info = &ginfo->rtg_info; return (eid == rtg_info->switch_away_id || eid == rtg_info->switch_to_id || - eid == rtg_info->task_completion_id || - eid == rtg_info->task_block_id || - eid == rtg_info->task_resume_id || - eid == rtg_info->task_release_id || eid == ginfo->event_sched_switch_id); } diff --git a/rt-plot-task.c b/rt-plot-task.c index 94c60f1..63f4f20 100644 --- a/rt-plot-task.c +++ b/rt-plot-task.c @@ -3,7 +3,7 @@ #include "trace-graph.h" #include "trace-filter.h" -#define DEBUG_LEVEL 5 +#define DEBUG_LEVEL 4 #if DEBUG_LEVEL > 0 #define dprintf(l, x...) \ do { \ @@ -237,9 +237,7 @@ static int try_block(struct graph_info *ginfo, struct rt_task_info *rtt_info, dprintf(3, "Block for %d on %d at %llu\n", pid, record->cpu, ts); ret = 1; - } else { - dprintf(3, "%d does not match my pid %d\n", pid, rtt_info->pid); - } + } return ret; } @@ -259,9 +257,7 @@ static int try_resume(struct graph_info *ginfo, struct rt_task_info *rtt_info, info->bstart = rtt_info->block_time; info->bend = ts; - printf("drawing block\n"); if (lid) { - printf("Adding label %s\n", rtt_info->block_label); info->blabel = rtt_info->block_label; } @@ -328,6 +324,7 @@ static int try_switch_to(struct graph_info *ginfo, struct rt_task_info *rtt_info pid, job, record->cpu, ts); ret = 1; } + return ret; } @@ -417,8 +414,6 @@ static int rt_task_plot_event(struct graph_info *ginfo, struct graph_plot *plot, struct rt_task_info *rtt_info = plot->private; int match; - dprintf(4,"%s\n", __FUNCTION__); - /* No more records, finish what we started */ if (!record) { do_plot_end(ginfo, rtt_info, info); @@ -443,8 +438,6 @@ static void rt_task_plot_start(struct graph_info *ginfo, struct graph_plot *plot int i; struct rt_task_info *rtt_info = plot->private; - dprintf(4,"%s\n", __FUNCTION__); - rtt_info->run_time = time; rtt_info->block_time = time; rtt_info->run_cpu = NO_CPU; @@ -454,14 +447,13 @@ static void rt_task_plot_start(struct graph_info *ginfo, struct graph_plot *plot for (i = 0; i < 3; i++) rtt_info->first_rels[i] = 0ULL; rtt_info->last_job = -1; - update_job(rtt_info, 0); + update_job(rtt_info, -1); update_lid(rtt_info, 0); } static void rt_task_plot_destroy(struct graph_info *ginfo, struct graph_plot *plot) { struct rt_task_info *rtt_info = plot->private; - dprintf(4,"%s\n", __FUNCTION__); trace_graph_plot_remove_all_recs(ginfo, plot); free(rtt_info->label); free(rtt_info); @@ -507,8 +499,6 @@ rt_task_plot_write_header(struct rt_plot_common *rt, unsigned long long release, deadline; struct rt_task_info *rtt_info = (struct rt_task_info*)rt; - dprintf(4,"%s\n", __FUNCTION__); - found = get_time_info(ginfo, rtt_info, time, &job, &release, &deadline, &record); if (!found) diff --git a/rt-plot-vcpu.c b/rt-plot-vcpu.c index f327f57..0867ff7 100644 --- a/rt-plot-vcpu.c +++ b/rt-plot-vcpu.c @@ -19,6 +19,7 @@ static void update_tid(struct vcpu_info *info, int tid) if (tid != info->run_tid) { info->run_tid = tid; snprintf(info->label, LLABEL, "%d", tid); + printf("Upated label to %s\n", info->label); } } @@ -26,16 +27,16 @@ static int try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct record *record, struct plot_info *info) { - int job, sid, tid, match, ret = 0; + int job, sid, tid, tjob, match, ret = 0; unsigned long long ts; match = rt_graph_check_server_switch_away(ginfo, record, &sid, &job, - &tid, &ts); + &tid, &tjob, &ts); if (match && sid == vcpu_info->sid) { update_tid(vcpu_info, tid); - if (vcpu_info->run_time < ts) { + if (vcpu_info->run_time && vcpu_info->run_time < ts) { info->box = TRUE; info->bcolor = hash_pid(tid); info->bfill = vcpu_info->running; @@ -48,7 +49,7 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, tid, sid, job, ts); vcpu_info->run_time = 0ULL; vcpu_info->run_cpu = NO_CPU; - vcpu_info->run_tid = 0; + vcpu_info->run_tid = -1; vcpu_info->running = FALSE; ret = 1; @@ -60,11 +61,11 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct record *record, struct plot_info *info) { - int job, sid, tid, match, ret = 0; + int job, sid, tid, tjob, match, ret = 0; unsigned long long ts; match = rt_graph_check_server_switch_to(ginfo, record, - &sid, &job, &tid, &ts); + &sid, &job, &tid, &tjob, &ts); if (match && sid == vcpu_info->sid) { update_tid(vcpu_info, tid); vcpu_info->run_time = ts; @@ -111,12 +112,14 @@ static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info if (match && pid && pid == vcpu_info->run_tid && vcpu_info->running) { vcpu_info->running = FALSE; - info->box = TRUE; - info->bcolor = hash_pid(pid); - info->bfill = TRUE; - info->bstart = vcpu_info->run_time; - info->bend = ts; - info->blabel = vcpu_info->label; + if (vcpu_info->run_time && vcpu_info->run_time < ts) { + info->box = TRUE; + info->bcolor = hash_pid(pid); + info->bfill = TRUE; + info->bstart = vcpu_info->run_time; + info->bend = ts; + info->blabel = vcpu_info->label; + } vcpu_info->run_time = ts; ret = 1; @@ -127,7 +130,7 @@ static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct plot_info *info) { - int tid, job, is_running; + int tid, job, tjob, is_running; unsigned long long deadline, release; struct record *record; @@ -147,7 +150,7 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, vcpu_info->sid, ginfo->view_end_time, &release, &deadline, - &job, &tid, &record); + &job, &tid, &tjob, &record); if (is_running) { update_tid(vcpu_info, tid); info->box = TRUE; @@ -175,8 +178,8 @@ static int rt_vcpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot, try_server_switch_to(ginfo, vcpu_info, record, info) || /* vcpu_try_block(ginfo, vcpu_info, record, info) || */ /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */ - vcpu_try_release(ginfo, vcpu_info, record, info) || - vcpu_try_completion(ginfo, vcpu_info, record, info) || + /* vcpu_try_release(ginfo, vcpu_info, record, info) || */ + /* vcpu_try_completion(ginfo, vcpu_info, record, info) || */ try_switch_to(ginfo, vcpu_info, record, info) || try_switch_away(ginfo, vcpu_info, record, info); return match; @@ -199,6 +202,7 @@ void insert_vcpu(struct graph_info *ginfo, struct cont_list *cont, struct graph_plot *plot; struct vcpu_info *vcpu; char *label; + int len; vcpu = malloc_or_die(sizeof(*vcpu)); vcpu->sid = vcpu_info->sid; @@ -211,8 +215,19 @@ void insert_vcpu(struct graph_info *ginfo, struct cont_list *cont, g_assert(cont); - label = malloc_or_die(1); - snprintf(label, 2, " "); + + len = strlen(cont->name) + 100; + label = malloc_or_die(len); + + if (vcpu_info->params.wcet) + snprintf(label, len, "%s - %d\nServer %d\n(%1.1f, %1.1f)", + cont->name, cont->cid, vcpu_info->sid, + nano_as_milli(vcpu_info->params.wcet), + nano_as_milli(vcpu_info->params.period)); + else + snprintf(label, len, "%s - %d\nServer %d", + cont->name, cont->cid, vcpu_info->sid); + plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_SERVER_CPU, TIME_TYPE_RT, &rt_vcpu_cb, vcpu); trace_graph_plot_add_all_recs(ginfo, plot); @@ -231,15 +246,14 @@ void rt_vcpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot, vcpu_info->run_time = time; vcpu_info->block_time = time; vcpu_info->run_cpu = NO_CPU; - vcpu_info->run_tid = 0; + vcpu_info->run_tid = -1; vcpu_info->block_cpu = NO_CPU; vcpu_info->fresh = FALSE; vcpu_info->fresh = TRUE; vcpu_info->running = FALSE; vcpu_info->last_job = -1; - - vcpu_info->run_tid = 0; + update_tid(vcpu_info, 0); } /** @@ -265,10 +279,10 @@ int rt_vcpu_plot_record_matches(struct rt_plot_common *rt, unsigned long long dull; #define ARG ginfo, record, &sid - 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, &dint, &dull) || - rt_graph_check_server_release(ARG, &dint, &dull, &dull); + 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); */ #undef ARG @@ -300,19 +314,19 @@ rt_vcpu_plot_write_header(struct rt_plot_common *rt, struct trace_seq *s, unsigned long long time) { - int is_running, job, tid; + int is_running, job, tid, tjob; unsigned long long release, deadline; struct vcpu_info *vcpu_info = (struct vcpu_info*)rt; struct record *record; is_running = get_server_info(ginfo, rt, vcpu_info->sid, time, - &release, &deadline, - &job, &tid, &record); + &release, &deadline, + &job, &tid, &tjob, &record); - trace_seq_printf(s, "%s-%d\n%d", vcpu_info->cont->name, + trace_seq_printf(s, "%s\nServer: %d:%d\n", vcpu_info->cont->name, vcpu_info->sid, job); if (is_running) { - trace_seq_printf(s, " - %d", tid); + trace_seq_printf(s, "Running: %d:%d", tid, tjob); } trace_seq_putc(s, '\n'); return record; diff --git a/rt-plot-vtask.c b/rt-plot-vtask.c index 5000873..91eeb19 100644 --- a/rt-plot-vtask.c +++ b/rt-plot-vtask.c @@ -32,18 +32,18 @@ static int try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct record *record, struct plot_info *info) { - int job, sid, tid, match, ret = 0; + int job, sid, tid, tjob, match, ret = 0; unsigned long long ts; match = rt_graph_check_server_switch_away(ginfo, record, &sid, &job, - &tid, &ts); - if (match && sid == vcpu_info->sid) { - /* update_job(vcpu_info, job); */ + &tid, &tjob, &ts); + if (match && tid == vcpu_info->sid) { + update_job(vcpu_info, tjob); - if (vcpu_info->run_time < ts) { + if (vcpu_info->run_time && vcpu_info->run_time < ts) { info->box = TRUE; - info->bcolor = hash_pid(sid); + info->bcolor = hash_cpu(sid - 1); info->bfill = TRUE; info->bstart = vcpu_info->run_time; info->bend = ts; @@ -65,13 +65,13 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct record *record, struct plot_info *info) { - int job, sid, tid, match, ret = 0; + int job, sid, tid, tjob, match, ret = 0; unsigned long long ts; match = rt_graph_check_server_switch_to(ginfo, record, - &sid, &job, &tid, &ts); - if (match && sid == vcpu_info->sid) { - update_job(vcpu_info, job); + &sid, &job, &tid, &tjob, &ts); + if (match && tid == vcpu_info->sid) { + update_job(vcpu_info, tjob); vcpu_info->run_time = ts; vcpu_info->run_cpu = record->cpu; vcpu_info->run_tid = tid; @@ -82,40 +82,40 @@ static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu return ret; } -static int try_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, - struct record *record, struct plot_info *info) -{ - int job, pid, match, ret = 0; - unsigned long long ts; - - match = rt_graph_check_switch_to(ginfo, record, &pid, &job, &ts); - if (match && pid && pid == vcpu_info->run_tid && vcpu_info->run_time) { - info->line = TRUE; - info->lcolor = hash_pid(pid); - ret = 1; - } - return ret; -} - -static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, - struct record *record, struct plot_info *info) -{ - int job, pid, match, ret = 0; - unsigned long long ts; - - match = rt_graph_check_switch_away(ginfo, record, &pid, &job, &ts); - if (match && pid && pid == vcpu_info->run_tid) { - info->line = TRUE; - info->lcolor = hash_pid(pid); - ret = 1; - } - return ret; -} +/* static int try_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */ +/* struct record *record, struct plot_info *info) */ +/* { */ +/* int job, pid, match, ret = 0; */ +/* unsigned long long ts; */ + +/* match = rt_graph_check_switch_to(ginfo, record, &pid, &job, &ts); */ +/* if (match && pid && pid == vcpu_info->run_tid && vcpu_info->run_time) { */ +/* info->line = TRUE; */ +/* info->lcolor = hash_pid(pid); */ +/* ret = 1; */ +/* } */ +/* return ret; */ +/* } */ + +/* static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */ +/* struct record *record, struct plot_info *info) */ +/* { */ +/* int job, pid, match, ret = 0; */ +/* unsigned long long ts; */ + +/* match = rt_graph_check_switch_away(ginfo, record, &pid, &job, &ts); */ +/* if (match && pid && pid == vcpu_info->run_tid) { */ +/* info->line = TRUE; */ +/* info->lcolor = hash_pid(pid); */ +/* ret = 1; */ +/* } */ +/* return ret; */ +/* } */ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, struct plot_info *info) { - int tid, job, is_running; + int tid, job, is_running, tjob; unsigned long long deadline, release; struct record *record; @@ -135,7 +135,7 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, vcpu_info->sid, ginfo->view_end_time, &release, &deadline, - &job, &tid, &record); + &job, &tid, &tjob, &record); if (is_running) { update_job(vcpu_info, job); info->box = TRUE; @@ -164,9 +164,9 @@ static int rt_vtask_plot_event(struct graph_info *ginfo, struct graph_plot *plot /* vcpu_try_block(ginfo, vcpu_info, record, info) || */ /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */ vcpu_try_release(ginfo, vcpu_info, record, info) || - vcpu_try_completion(ginfo, vcpu_info, record, info) || - try_switch_to(ginfo, vcpu_info, record, info) || - try_switch_away(ginfo, vcpu_info, record, info); + vcpu_try_completion(ginfo, vcpu_info, record, info); + /* try_switch_to(ginfo, vcpu_info, record, info) || */ + /* try_switch_away(ginfo, vcpu_info, record, info); */ return match; } @@ -186,7 +186,6 @@ void insert_vtask(struct graph_info *ginfo, struct cont_list *cont, struct graph_plot *plot; struct vcpu_info *vtask; char *label; - int len; vtask = malloc_or_die(sizeof(*vtask)); vtask->sid = vcpu_info->sid; @@ -197,13 +196,8 @@ void insert_vtask(struct graph_info *ginfo, struct cont_list *cont, vtask->common.is_drawn = rt_vcpu_plot_is_drawn; vtask->common.write_header = rt_vcpu_plot_write_header; - - len = strlen(cont->name) + 100; - label = malloc_or_die(len); - snprintf(label, len, "%s - %d\n(%1.1f, %1.1f)", - cont->name, -vtask->sid, - nano_as_milli(vcpu_info->params.wcet), - nano_as_milli(vcpu_info->params.period)); + label = malloc_or_die(1); + snprintf(label, 2, " "); plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_SERVER_TASK, TIME_TYPE_RT, &rt_vtask_cb, vtask); diff --git a/rt-plot.c b/rt-plot.c index 36682a4..37506ba 100644 --- a/rt-plot.c +++ b/rt-plot.c @@ -287,8 +287,9 @@ set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu) */ do { seek_time = seek_time - 1.5 * (rts - rt_target); + last_rts = rts; rts = next_rts(ginfo, cpu, seek_time); - } while (rts > rt_target); + } while (rts > rt_target && rts != last_rts); } /* Get to first record at or after time */ @@ -368,11 +369,11 @@ int is_task_running(struct graph_info *ginfo, * Returns release record and @out_job, @out_release, and @out_deadline if a * release was found for @tid before @time. */ -struct record* get_previous_release(struct graph_info *ginfo, int match_tid, - unsigned long long time, - int *out_job, - unsigned long long *out_release, - unsigned long long *out_deadline) +void get_previous_release(struct graph_info *ginfo, int match_tid, + unsigned long long time, + int *out_job, + unsigned long long *out_release, + unsigned long long *out_deadline) { int tid, cpu, match, job; unsigned long long release, deadline, min_ts; @@ -424,5 +425,5 @@ struct record* get_previous_release(struct graph_info *ginfo, int match_tid, loop_end: free_record(last_rec); } - return ret; + free_record(ret); } diff --git a/rt-plot.h b/rt-plot.h index 1b04547..e84bbf9 100644 --- a/rt-plot.h +++ b/rt-plot.h @@ -60,9 +60,9 @@ void set_cpus_to_rts(struct graph_info *ginfo, int is_task_running(struct graph_info *ginfo, unsigned long long time, int pid); -struct record* get_previous_release(struct graph_info *ginfo, int tid, - unsigned long long time, int *job, - unsigned long long *release, - unsigned long long *deadline); +void get_previous_release(struct graph_info *ginfo, int tid, + unsigned long long time, int *job, + unsigned long long *release, + unsigned long long *deadline); #endif diff --git a/trace-graph.c b/trace-graph.c index b20aabe..1ce3d47 100644 --- a/trace-graph.c +++ b/trace-graph.c @@ -55,7 +55,7 @@ #define PLOT_GIVE 2 #define PLOT_BEGIN 80 #define PLOT_SEP 50 -#define MAX_TRI_TIME 1000000 +#define MAX_TRI_TIME 10000000 #define PLOT_LINE(plot) (PLOT_SEP * (plot) + PLOT_BEGIN + PLOT_SIZE) #define PLOT_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE * 2) #define PLOT_BOX_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE) -- cgit v1.2.2