aboutsummaryrefslogtreecommitdiffstats
path: root/rt-plot-vtask.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt-plot-vtask.c')
-rw-r--r--rt-plot-vtask.c98
1 files changed, 46 insertions, 52 deletions
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
32try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 32try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
33 struct record *record, struct plot_info *info) 33 struct record *record, struct plot_info *info)
34{ 34{
35 int job, sid, tid, match, ret = 0; 35 int job, sid, tid, tjob, match, ret = 0;
36 unsigned long long ts; 36 unsigned long long ts;
37 37
38 match = rt_graph_check_server_switch_away(ginfo, record, 38 match = rt_graph_check_server_switch_away(ginfo, record,
39 &sid, &job, 39 &sid, &job,
40 &tid, &ts); 40 &tid, &tjob, &ts);
41 if (match && sid == vcpu_info->sid) { 41 if (match && tid == vcpu_info->sid) {
42 /* update_job(vcpu_info, job); */ 42 update_job(vcpu_info, tjob);
43 43
44 if (vcpu_info->run_time < ts) { 44 if (vcpu_info->run_time && vcpu_info->run_time < ts) {
45 info->box = TRUE; 45 info->box = TRUE;
46 info->bcolor = hash_pid(sid); 46 info->bcolor = hash_cpu(sid - 1);
47 info->bfill = TRUE; 47 info->bfill = TRUE;
48 info->bstart = vcpu_info->run_time; 48 info->bstart = vcpu_info->run_time;
49 info->bend = ts; 49 info->bend = ts;
@@ -65,13 +65,13 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
65static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 65static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
66 struct record *record, struct plot_info *info) 66 struct record *record, struct plot_info *info)
67{ 67{
68 int job, sid, tid, match, ret = 0; 68 int job, sid, tid, tjob, match, ret = 0;
69 unsigned long long ts; 69 unsigned long long ts;
70 70
71 match = rt_graph_check_server_switch_to(ginfo, record, 71 match = rt_graph_check_server_switch_to(ginfo, record,
72 &sid, &job, &tid, &ts); 72 &sid, &job, &tid, &tjob, &ts);
73 if (match && sid == vcpu_info->sid) { 73 if (match && tid == vcpu_info->sid) {
74 update_job(vcpu_info, job); 74 update_job(vcpu_info, tjob);
75 vcpu_info->run_time = ts; 75 vcpu_info->run_time = ts;
76 vcpu_info->run_cpu = record->cpu; 76 vcpu_info->run_cpu = record->cpu;
77 vcpu_info->run_tid = tid; 77 vcpu_info->run_tid = tid;
@@ -82,40 +82,40 @@ static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu
82 return ret; 82 return ret;
83} 83}
84 84
85static int try_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 85/* static int try_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */
86 struct record *record, struct plot_info *info) 86/* struct record *record, struct plot_info *info) */
87{ 87/* { */
88 int job, pid, match, ret = 0; 88/* int job, pid, match, ret = 0; */
89 unsigned long long ts; 89/* unsigned long long ts; */
90 90
91 match = rt_graph_check_switch_to(ginfo, record, &pid, &job, &ts); 91/* match = rt_graph_check_switch_to(ginfo, record, &pid, &job, &ts); */
92 if (match && pid && pid == vcpu_info->run_tid && vcpu_info->run_time) { 92/* if (match && pid && pid == vcpu_info->run_tid && vcpu_info->run_time) { */
93 info->line = TRUE; 93/* info->line = TRUE; */
94 info->lcolor = hash_pid(pid); 94/* info->lcolor = hash_pid(pid); */
95 ret = 1; 95/* ret = 1; */
96 } 96/* } */
97 return ret; 97/* return ret; */
98} 98/* } */
99 99
100static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 100/* static int try_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */
101 struct record *record, struct plot_info *info) 101/* struct record *record, struct plot_info *info) */
102{ 102/* { */
103 int job, pid, match, ret = 0; 103/* int job, pid, match, ret = 0; */
104 unsigned long long ts; 104/* unsigned long long ts; */
105 105
106 match = rt_graph_check_switch_away(ginfo, record, &pid, &job, &ts); 106/* match = rt_graph_check_switch_away(ginfo, record, &pid, &job, &ts); */
107 if (match && pid && pid == vcpu_info->run_tid) { 107/* if (match && pid && pid == vcpu_info->run_tid) { */
108 info->line = TRUE; 108/* info->line = TRUE; */
109 info->lcolor = hash_pid(pid); 109/* info->lcolor = hash_pid(pid); */
110 ret = 1; 110/* ret = 1; */
111 } 111/* } */
112 return ret; 112/* return ret; */
113} 113/* } */
114 114
115static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 115static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
116 struct plot_info *info) 116 struct plot_info *info)
117{ 117{
118 int tid, job, is_running; 118 int tid, job, is_running, tjob;
119 unsigned long long deadline, release; 119 unsigned long long deadline, release;
120 struct record *record; 120 struct record *record;
121 121
@@ -135,7 +135,7 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
135 vcpu_info->sid, 135 vcpu_info->sid,
136 ginfo->view_end_time, 136 ginfo->view_end_time,
137 &release, &deadline, 137 &release, &deadline,
138 &job, &tid, &record); 138 &job, &tid, &tjob, &record);
139 if (is_running) { 139 if (is_running) {
140 update_job(vcpu_info, job); 140 update_job(vcpu_info, job);
141 info->box = TRUE; 141 info->box = TRUE;
@@ -164,9 +164,9 @@ static int rt_vtask_plot_event(struct graph_info *ginfo, struct graph_plot *plot
164 /* vcpu_try_block(ginfo, vcpu_info, record, info) || */ 164 /* vcpu_try_block(ginfo, vcpu_info, record, info) || */
165 /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */ 165 /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */
166 vcpu_try_release(ginfo, vcpu_info, record, info) || 166 vcpu_try_release(ginfo, vcpu_info, record, info) ||
167 vcpu_try_completion(ginfo, vcpu_info, record, info) || 167 vcpu_try_completion(ginfo, vcpu_info, record, info);
168 try_switch_to(ginfo, vcpu_info, record, info) || 168 /* try_switch_to(ginfo, vcpu_info, record, info) || */
169 try_switch_away(ginfo, vcpu_info, record, info); 169 /* try_switch_away(ginfo, vcpu_info, record, info); */
170 return match; 170 return match;
171} 171}
172 172
@@ -186,7 +186,6 @@ void insert_vtask(struct graph_info *ginfo, struct cont_list *cont,
186 struct graph_plot *plot; 186 struct graph_plot *plot;
187 struct vcpu_info *vtask; 187 struct vcpu_info *vtask;
188 char *label; 188 char *label;
189 int len;
190 189
191 vtask = malloc_or_die(sizeof(*vtask)); 190 vtask = malloc_or_die(sizeof(*vtask));
192 vtask->sid = vcpu_info->sid; 191 vtask->sid = vcpu_info->sid;
@@ -197,13 +196,8 @@ void insert_vtask(struct graph_info *ginfo, struct cont_list *cont,
197 vtask->common.is_drawn = rt_vcpu_plot_is_drawn; 196 vtask->common.is_drawn = rt_vcpu_plot_is_drawn;
198 vtask->common.write_header = rt_vcpu_plot_write_header; 197 vtask->common.write_header = rt_vcpu_plot_write_header;
199 198
200 199 label = malloc_or_die(1);
201 len = strlen(cont->name) + 100; 200 snprintf(label, 2, " ");
202 label = malloc_or_die(len);
203 snprintf(label, len, "%s - %d\n(%1.1f, %1.1f)",
204 cont->name, -vtask->sid,
205 nano_as_milli(vcpu_info->params.wcet),
206 nano_as_milli(vcpu_info->params.period));
207 201
208 plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_SERVER_TASK, 202 plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_SERVER_TASK,
209 TIME_TYPE_RT, &rt_vtask_cb, vtask); 203 TIME_TYPE_RT, &rt_vtask_cb, vtask);