aboutsummaryrefslogtreecommitdiffstats
path: root/rt-plot-container.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt-plot-container.c')
-rw-r--r--rt-plot-container.c46
1 files changed, 3 insertions, 43 deletions
diff --git a/rt-plot-container.c b/rt-plot-container.c
index f36e2f8..97e9fd8 100644
--- a/rt-plot-container.c
+++ b/rt-plot-container.c
@@ -4,40 +4,6 @@
4#include "trace-hash.h" 4#include "trace-hash.h"
5#include "trace-filter.h" 5#include "trace-filter.h"
6 6
7struct vtask_info {
8 struct rt_task_info task_info;
9 struct cont_list *cont;
10};
11
12static void insert_vtask(struct graph_info *ginfo, struct cont_list *cont,
13 struct vcpu_list *vcpu_info)
14{
15 struct graph_plot *plot;
16 struct vtask_info *vtask;
17 char *label;
18 int len;
19
20 vtask = malloc_or_die(sizeof(*vtask));
21 vtask->task_info.pid = vcpu_info->sid;
22 vtask->task_info.wcet = vcpu_info->params.wcet;
23 vtask->task_info.period = vcpu_info->params.period;
24 vtask->task_info.label = malloc_or_die(LLABEL);
25 vtask->cont = cont;
26
27 g_assert(cont);
28
29 len = strlen(cont->name) + 100;
30 label = malloc_or_die(len);
31 snprintf(label, len, "%s-%d\n(%1.1f, %1.1f)",
32 cont->name, -vtask->task_info.pid,
33 nano_as_milli(vtask->task_info.wcet),
34 nano_as_milli(vtask->task_info.period));
35
36 plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_SERVER_TASK,
37 TIME_TYPE_RT, &rt_task_cb, vtask);
38 trace_graph_plot_add_all_recs(ginfo, plot);
39}
40
41int rt_plot_get_containers(struct graph_info *ginfo, gint **conts, 7int rt_plot_get_containers(struct graph_info *ginfo, gint **conts,
42 gboolean plotted_only) 8 gboolean plotted_only)
43{ 9{
@@ -122,7 +88,7 @@ void rt_plot_container(struct graph_info *ginfo, int cid)
122 cont->plotted = TRUE; 88 cont->plotted = TRUE;
123 89
124 for (vlist = cont->vcpus; vlist; vlist = vlist->next) { 90 for (vlist = cont->vcpus; vlist; vlist = vlist->next) {
125 /* insert_vtask(ginfo, cont, vlist); */ 91 insert_vtask(ginfo, cont, vlist);
126 insert_vcpu(ginfo, cont, vlist); 92 insert_vcpu(ginfo, cont, vlist);
127 } 93 }
128} 94}
@@ -185,7 +151,6 @@ static void do_container_filter(struct graph_info *ginfo,
185 struct cont_filter_helper *helper, gpointer data) 151 struct cont_filter_helper *helper, gpointer data)
186{ 152{
187 struct graph_plot *plot; 153 struct graph_plot *plot;
188 struct vtask_info *vtask;
189 struct vcpu_info *vcpu; 154 struct vcpu_info *vcpu;
190 struct cont_list *cont; 155 struct cont_list *cont;
191 int i, c, *append; 156 int i, c, *append;
@@ -201,13 +166,8 @@ static void do_container_filter(struct graph_info *ginfo,
201 plot->type != PLOT_TYPE_SERVER_CPU) 166 plot->type != PLOT_TYPE_SERVER_CPU)
202 continue; 167 continue;
203 168
204 if (plot->type == PLOT_TYPE_SERVER_TASK) { 169 vcpu = plot->private;
205 vtask = plot->private; 170 cont = vcpu->cont;
206 cont = vtask->cont;
207 } else {
208 vcpu = plot->private;
209 cont = vcpu->cont;
210 }
211 171
212 for (c = 0; c < helper->num_conts; c++) { 172 for (c = 0; c < helper->num_conts; c++) {
213 if (helper->conts[c] == cont->cid) 173 if (helper->conts[c] == cont->cid)