aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-03-30 16:48:55 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-03-30 16:48:55 -0400
commit7c67b2cdcd779525a88a9f7173c6d628a98c01c5 (patch)
tree92bce220cbe32ec657aee09f19647e18a33a52d5
parentf340ebe290d85f6aae234b44ca43aecb106c1e75 (diff)
rt-graph: blockign with ids
-rw-r--r--rt-graph.c30
-rw-r--r--rt-graph.h12
-rw-r--r--rt-plot-cpu.c7
-rw-r--r--rt-plot-task.c79
-rw-r--r--rt-plot-task.h3
-rw-r--r--rt-plot-vcpu.c113
-rw-r--r--rt-plot-vtask.c7
-rw-r--r--trace-graph.c16
-rw-r--r--trace-graph.h8
9 files changed, 177 insertions, 98 deletions
diff --git a/rt-graph.c b/rt-graph.c
index e291245..3a5949c 100644
--- a/rt-graph.c
+++ b/rt-graph.c
@@ -448,7 +448,8 @@ int rt_graph_check_task_completion(struct graph_info *ginfo,
448 */ 448 */
449int rt_graph_check_task_block(struct graph_info *ginfo, 449int rt_graph_check_task_block(struct graph_info *ginfo,
450 struct record *record, 450 struct record *record,
451 gint *pid, unsigned long long *ts) 451 gint *pid, gint *lid,
452 unsigned long long *ts)
452{ 453{
453 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 454 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
454 struct pevent *pevent = ginfo->pevent; 455 struct pevent *pevent = ginfo->pevent;
@@ -464,16 +465,18 @@ int rt_graph_check_task_block(struct graph_info *ginfo,
464 dprintf(2, "Found task_block id %d\n", event->id); 465 dprintf(2, "Found task_block id %d\n", event->id);
465 rtg_info->task_block_id = event->id; 466 rtg_info->task_block_id = event->id;
466 STORE_FIELD(rtg_info, event, block, pid); 467 STORE_FIELD(rtg_info, event, block, pid);
468 STORE_FIELD(rtg_info, event, block, lid);
467 } 469 }
468 470
469 id = pevent_data_type(pevent, record); 471 id = pevent_data_type(pevent, record);
470 if (id == rtg_info->task_block_id) { 472 if (id == rtg_info->task_block_id) {
471 LOAD_INT(rtg_info, record, block, pid, pid); 473 LOAD_INT(rtg_info, record, block, pid, pid);
474 LOAD_INT(rtg_info, record, block, lid, lid);
472 *ts = get_rts(ginfo, record); 475 *ts = get_rts(ginfo, record);
473 476
474 ret = 1; 477 ret = 1;
475 dprintf(3, "Read task_block (%d) record for task %d\n", 478 dprintf(3, "Read task_block (%d) record on %d for task %d\n",
476 id, *pid); 479 id, *lid, *pid);
477 } 480 }
478 out: 481 out:
479 return ret; 482 return ret;
@@ -485,7 +488,8 @@ int rt_graph_check_task_block(struct graph_info *ginfo,
485 */ 488 */
486int rt_graph_check_task_resume(struct graph_info *ginfo, 489int rt_graph_check_task_resume(struct graph_info *ginfo,
487 struct record *record, 490 struct record *record,
488 gint *pid, unsigned long long *ts) 491 gint *pid, gint *lid,
492 unsigned long long *ts)
489{ 493{
490 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 494 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
491 struct pevent *pevent = ginfo->pevent; 495 struct pevent *pevent = ginfo->pevent;
@@ -501,16 +505,18 @@ int rt_graph_check_task_resume(struct graph_info *ginfo,
501 dprintf(2, "Found task_resume id %d\n", event->id); 505 dprintf(2, "Found task_resume id %d\n", event->id);
502 rtg_info->task_resume_id = event->id; 506 rtg_info->task_resume_id = event->id;
503 STORE_FIELD(rtg_info, event, resume, pid); 507 STORE_FIELD(rtg_info, event, resume, pid);
508 STORE_FIELD(rtg_info, event, resume, lid);
504 } 509 }
505 510
506 id = pevent_data_type(pevent, record); 511 id = pevent_data_type(pevent, record);
507 if (id == rtg_info->task_resume_id) { 512 if (id == rtg_info->task_resume_id) {
508 LOAD_INT(rtg_info, record, resume, pid, pid); 513 LOAD_INT(rtg_info, record, resume, pid, pid);
514 LOAD_INT(rtg_info, record, resume, lid, lid);
509 *ts = get_rts(ginfo, record); 515 *ts = get_rts(ginfo, record);
510 516
511 ret = 1; 517 ret = 1;
512 dprintf(3, "Read task_resume (%d) record for task %d\n", 518 dprintf(3, "Read task_resume (%d) record on %d for task %d\n",
513 id, *pid); 519 id, *lid, *pid);
514 } 520 }
515 out: 521 out:
516 return ret; 522 return ret;
@@ -781,7 +787,8 @@ int rt_graph_check_server_completion(struct graph_info *ginfo,
781 */ 787 */
782int rt_graph_check_server_block(struct graph_info *ginfo, 788int rt_graph_check_server_block(struct graph_info *ginfo,
783 struct record *record, 789 struct record *record,
784 gint *sid, unsigned long long *ts) 790 gint *sid, gint *lid,
791 unsigned long long *ts)
785{ 792{
786 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 793 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
787 struct pevent *pevent = ginfo->pevent; 794 struct pevent *pevent = ginfo->pevent;
@@ -795,12 +802,15 @@ int rt_graph_check_server_block(struct graph_info *ginfo,
795 if (!event) 802 if (!event)
796 goto out; 803 goto out;
797 dprintf(2, "Found server_block id %d\n", event->id); 804 dprintf(2, "Found server_block id %d\n", event->id);
805 rtg_info->server_block_id = event->id;
798 STORE_FIELD(rtg_info, event, sblock, sid); 806 STORE_FIELD(rtg_info, event, sblock, sid);
807 STORE_FIELD(rtg_info, event, sblock, lid);
799 } 808 }
800 809
801 id = pevent_data_type(pevent, record); 810 id = pevent_data_type(pevent, record);
802 if (id == rtg_info->server_block_id) { 811 if (id == rtg_info->server_block_id) {
803 LOAD_INT(rtg_info, record, sblock, sid, sid); 812 LOAD_INT(rtg_info, record, sblock, sid, sid);
813 LOAD_INT(rtg_info, record, sblock, lid, lid);
804 *ts = get_rts(ginfo, record); 814 *ts = get_rts(ginfo, record);
805 815
806 ret = 1; 816 ret = 1;
@@ -816,7 +826,8 @@ int rt_graph_check_server_block(struct graph_info *ginfo,
816 */ 826 */
817int rt_graph_check_server_resume(struct graph_info *ginfo, 827int rt_graph_check_server_resume(struct graph_info *ginfo,
818 struct record *record, 828 struct record *record,
819 gint *sid, unsigned long long *ts) 829 gint *sid, gint *lid,
830 unsigned long long *ts)
820{ 831{
821 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 832 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
822 struct pevent *pevent = ginfo->pevent; 833 struct pevent *pevent = ginfo->pevent;
@@ -830,12 +841,15 @@ int rt_graph_check_server_resume(struct graph_info *ginfo,
830 if (!event) 841 if (!event)
831 goto out; 842 goto out;
832 dprintf(2, "Found server_resume id %d\n", event->id); 843 dprintf(2, "Found server_resume id %d\n", event->id);
844 rtg_info->server_resume_id = event->id;
833 STORE_FIELD(rtg_info, event, sresume, sid); 845 STORE_FIELD(rtg_info, event, sresume, sid);
846 STORE_FIELD(rtg_info, event, sresume, lid);
834 } 847 }
835 848
836 id = pevent_data_type(pevent, record); 849 id = pevent_data_type(pevent, record);
837 if (id == rtg_info->server_resume_id) { 850 if (id == rtg_info->server_resume_id) {
838 LOAD_INT(rtg_info, record, sresume, sid, sid); 851 LOAD_INT(rtg_info, record, sresume, sid, sid);
852 LOAD_INT(rtg_info, record, sresume, lid, lid);
839 *ts = get_rts(ginfo, record); 853 *ts = get_rts(ginfo, record);
840 854
841 ret = 1; 855 ret = 1;
diff --git a/rt-graph.h b/rt-graph.h
index 27aeb88..c44cf5b 100644
--- a/rt-graph.h
+++ b/rt-graph.h
@@ -56,9 +56,11 @@ struct rt_graph_info {
56 56
57 gint task_block_id; 57 gint task_block_id;
58 struct format_field *block_pid_field; 58 struct format_field *block_pid_field;
59 struct format_field *block_lid_field;
59 60
60 gint task_resume_id; 61 gint task_resume_id;
61 struct format_field *resume_pid_field; 62 struct format_field *resume_pid_field;
63 struct format_field *resume_lid_field;
62 64
63 gint container_param_id; 65 gint container_param_id;
64 struct format_field *cparam_cid_field; 66 struct format_field *cparam_cid_field;
@@ -92,9 +94,11 @@ struct rt_graph_info {
92 94
93 gint server_block_id; 95 gint server_block_id;
94 struct format_field *sblock_sid_field; 96 struct format_field *sblock_sid_field;
97 struct format_field *sblock_lid_field;
95 98
96 gint server_resume_id; 99 gint server_resume_id;
97 struct format_field *sresume_sid_field; 100 struct format_field *sresume_sid_field;
101 struct format_field *sresume_lid_field;
98 102
99 103
100 /* Cache of ts fields for non-litmus events */ 104 /* Cache of ts fields for non-litmus events */
@@ -163,10 +167,10 @@ int rt_graph_check_task_completion(struct graph_info *ginfo,
163 struct record *record, gint *pid, gint *job, 167 struct record *record, gint *pid, gint *job,
164 unsigned long long *when); 168 unsigned long long *when);
165int rt_graph_check_task_block(struct graph_info *ginfo, 169int rt_graph_check_task_block(struct graph_info *ginfo,
166 struct record *record, gint *pid, 170 struct record *record, gint *pid, gint *lid,
167 unsigned long long *when); 171 unsigned long long *when);
168int rt_graph_check_task_resume(struct graph_info *ginfo, struct record *record, 172int rt_graph_check_task_resume(struct graph_info *ginfo, struct record *record,
169 gint *pid, unsigned long long *when); 173 gint *pid, gint *lid, unsigned long long *when);
170int rt_graph_check_container_param(struct graph_info *ginfo, 174int rt_graph_check_container_param(struct graph_info *ginfo,
171 struct record *record, 175 struct record *record,
172 gint *cid, char **name); 176 gint *cid, char **name);
@@ -192,10 +196,10 @@ int rt_graph_check_server_completion(struct graph_info *ginfo,
192 gint *sid, gint *job, 196 gint *sid, gint *job,
193 unsigned long long *when); 197 unsigned long long *when);
194int rt_graph_check_server_block(struct graph_info *ginfo, 198int rt_graph_check_server_block(struct graph_info *ginfo,
195 struct record *record, gint *pid, 199 struct record *record, gint *pid, gint *lid,
196 unsigned long long *when); 200 unsigned long long *when);
197int rt_graph_check_server_resume(struct graph_info *ginfo, struct record *record, 201int rt_graph_check_server_resume(struct graph_info *ginfo, struct record *record,
198 gint *pid, unsigned long long *when); 202 gint *pid, gint *lid, unsigned long long *when);
199void init_rt_event_cache(struct rt_graph_info *rtinfo); 203void init_rt_event_cache(struct rt_graph_info *rtinfo);
200 204
201unsigned long long get_rts(struct graph_info *ginfo, 205unsigned long long get_rts(struct graph_info *ginfo,
diff --git a/rt-plot-cpu.c b/rt-plot-cpu.c
index 28ae26b..ba380fb 100644
--- a/rt-plot-cpu.c
+++ b/rt-plot-cpu.c
@@ -276,6 +276,9 @@ static void do_plot_end(struct graph_info *ginfo, struct rt_cpu_info *rtc_info,
276 int pid; 276 int pid;
277 struct record *record; 277 struct record *record;
278 278
279 if (ginfo->view_end_time == ginfo->end_time)
280 return;
281
279 if (rtc_info->rt_run_time && rtc_info->run_pid) { 282 if (rtc_info->rt_run_time && rtc_info->run_pid) {
280 info->box = TRUE; 283 info->box = TRUE;
281 info->bcolor = hash_pid(rtc_info->run_pid); 284 info->bcolor = hash_pid(rtc_info->run_pid);
@@ -359,8 +362,8 @@ static int rt_cpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot,
359 rt_graph_check_container_param(ARG, &dchar); 362 rt_graph_check_container_param(ARG, &dchar);
360 rt_graph_check_server_param(ARG, &dint, &dull, &dull); 363 rt_graph_check_server_param(ARG, &dint, &dull, &dull);
361 rt_graph_check_task_release(ARG, &dint, &dull, &dull); 364 rt_graph_check_task_release(ARG, &dint, &dull, &dull);
362 rt_graph_check_task_block(ARG, &dull); 365 rt_graph_check_task_block(ARG, &dint, &dull);
363 rt_graph_check_task_resume(ARG, &dull); 366 rt_graph_check_task_resume(ARG, &dint, &dull);
364 rt_graph_check_any(ARG, &eid, &ts); 367 rt_graph_check_any(ARG, &eid, &ts);
365#undef ARG 368#undef ARG
366 369
diff --git a/rt-plot-task.c b/rt-plot-task.c
index de5d2a7..94c60f1 100644
--- a/rt-plot-task.c
+++ b/rt-plot-task.c
@@ -42,8 +42,8 @@ next_box_record(struct graph_info *ginfo, struct rt_task_info *rtt_info,
42#define ARG ginfo, record, &pid 42#define ARG ginfo, record, &pid
43 match = rt_graph_check_switch_to(ARG, &dint, &dull) || 43 match = rt_graph_check_switch_to(ARG, &dint, &dull) ||
44 rt_graph_check_switch_away(ARG, &dint, &dull) || 44 rt_graph_check_switch_away(ARG, &dint, &dull) ||
45 rt_graph_check_task_block(ARG, &dull) || 45 rt_graph_check_task_block(ARG, &dint, &dull) ||
46 rt_graph_check_task_resume(ARG, &dull); 46 rt_graph_check_task_resume(ARG, &dint, &dull);
47#undef ARG 47#undef ARG
48 eid = (match) ? pevent_data_type(pevent, record) : 0; 48 eid = (match) ? pevent_data_type(pevent, record) : 0;
49 49
@@ -75,6 +75,19 @@ static int update_job(struct rt_task_info *rtt_info, int job)
75 return 1; 75 return 1;
76} 76}
77 77
78static void update_lid(struct rt_task_info *rtt_info, int lid)
79{
80 if (rtt_info->block_lid != lid) {
81 rtt_info->block_lid = lid;
82
83 if (lid)
84 snprintf(rtt_info->block_label, LLABEL,
85 "%d", rtt_info->block_lid);
86 else
87 snprintf(rtt_info->block_label, LLABEL, " ");
88 }
89}
90
78static int rt_task_plot_is_drawn(struct graph_info *ginfo, int eid) 91static int rt_task_plot_is_drawn(struct graph_info *ginfo, int eid)
79{ 92{
80 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 93 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
@@ -82,8 +95,8 @@ static int rt_task_plot_is_drawn(struct graph_info *ginfo, int eid)
82 return (eid == rtg_info->switch_away_id || 95 return (eid == rtg_info->switch_away_id ||
83 eid == rtg_info->switch_to_id || 96 eid == rtg_info->switch_to_id ||
84 eid == rtg_info->task_completion_id || 97 eid == rtg_info->task_completion_id ||
85 /* eid == rtg_info->task_block_id || */ 98 eid == rtg_info->task_block_id ||
86 /* eid == rtg_info->task_resume_id || */ 99 eid == rtg_info->task_resume_id ||
87 eid == rtg_info->task_release_id); 100 eid == rtg_info->task_release_id);
88} 101}
89 102
@@ -208,14 +221,19 @@ static int try_completion(struct graph_info *ginfo,
208static int try_block(struct graph_info *ginfo, struct rt_task_info *rtt_info, 221static int try_block(struct graph_info *ginfo, struct rt_task_info *rtt_info,
209 struct record *record, struct plot_info *info) 222 struct record *record, struct plot_info *info)
210{ 223{
211 int pid, match, ret = 0; 224 int pid, match, lid, ret = 0;
212 unsigned long long ts; 225 unsigned long long ts;
213 226
214 match = rt_graph_check_task_block(ginfo, record, &pid, &ts); 227 match = rt_graph_check_task_block(ginfo, record, &pid, &lid, &ts);
215 if (match && pid == rtt_info->pid) { 228 if (match && pid == rtt_info->pid) {
216 rtt_info->fresh = FALSE; 229 if (lid || !rtt_info->block_lid) {
217 rtt_info->block_time = ts; 230 update_lid(rtt_info, lid);
218 rtt_info->block_cpu = record->cpu; 231 rtt_info->fresh = FALSE;
232 rtt_info->block_time = ts;
233 rtt_info->block_cpu = record->cpu;
234 rtt_info->block_lid = lid;
235 }
236
219 dprintf(3, "Block for %d on %d at %llu\n", 237 dprintf(3, "Block for %d on %d at %llu\n",
220 pid, record->cpu, ts); 238 pid, record->cpu, ts);
221 ret = 1; 239 ret = 1;
@@ -228,24 +246,34 @@ static int try_block(struct graph_info *ginfo, struct rt_task_info *rtt_info,
228static int try_resume(struct graph_info *ginfo, struct rt_task_info *rtt_info, 246static int try_resume(struct graph_info *ginfo, struct rt_task_info *rtt_info,
229 struct record *record, struct plot_info *info) 247 struct record *record, struct plot_info *info)
230{ 248{
231 int pid, match, ret = 0; 249 int pid, match, lid, ret = 0;
232 unsigned long long ts; 250 unsigned long long ts;
233 251
234 match = rt_graph_check_task_resume(ginfo, record, &pid, &ts); 252 match = rt_graph_check_task_resume(ginfo, record, &pid, &lid, &ts);
235 if (match && pid == rtt_info->pid) { 253 if (match && pid == rtt_info->pid) {
236 info->box = TRUE; 254 if (lid == rtt_info->block_lid) {
237 info->bcolor = 0x0; 255 info->box = TRUE;
238 info->bfill = TRUE; 256 info->bcolor = 0x0;
239 info->bthin = TRUE; 257 info->bfill = TRUE;
240 info->bstart = rtt_info->block_time; 258 info->bthin = TRUE;
241 info->bend = ts; 259 info->bstart = rtt_info->block_time;
242 rtt_info->fresh = FALSE; 260 info->bend = ts;
261
262 printf("drawing block\n");
263 if (lid) {
264 printf("Adding label %s\n", rtt_info->block_label);
265 info->blabel = rtt_info->block_label;
266 }
267
268 rtt_info->block_lid = 0;
269 rtt_info->fresh = FALSE;
270 rtt_info->block_time = 0ULL;
271 rtt_info->block_cpu = NO_CPU;
272
273 }
243 274
244 rtt_info->block_time = 0ULL;
245 rtt_info->block_cpu = NO_CPU;
246 dprintf(3, "Resume for %d on %d at %llu\n", 275 dprintf(3, "Resume for %d on %d at %llu\n",
247 pid, record->cpu, ts); 276 pid, record->cpu, ts);
248
249 ret = 1; 277 ret = 1;
250 } 278 }
251 return ret; 279 return ret;
@@ -335,6 +363,9 @@ static void do_plot_end(struct graph_info *ginfo, struct rt_task_info *rtt_info,
335 struct rt_graph_info *rtg_info = &ginfo->rtg_info; 363 struct rt_graph_info *rtg_info = &ginfo->rtg_info;
336 int eid; 364 int eid;
337 365
366 if (ginfo->view_end_time == ginfo->end_time)
367 return;
368
338 if (rtt_info->run_time && rtt_info->run_cpu != NO_CPU) { 369 if (rtt_info->run_time && rtt_info->run_cpu != NO_CPU) {
339 /* A box was started, finish it */ 370 /* A box was started, finish it */
340 info->box = TRUE; 371 info->box = TRUE;
@@ -424,6 +455,7 @@ static void rt_task_plot_start(struct graph_info *ginfo, struct graph_plot *plot
424 rtt_info->first_rels[i] = 0ULL; 455 rtt_info->first_rels[i] = 0ULL;
425 rtt_info->last_job = -1; 456 rtt_info->last_job = -1;
426 update_job(rtt_info, 0); 457 update_job(rtt_info, 0);
458 update_lid(rtt_info, 0);
427} 459}
428 460
429static void rt_task_plot_destroy(struct graph_info *ginfo, struct graph_plot *plot) 461static void rt_task_plot_destroy(struct graph_info *ginfo, struct graph_plot *plot)
@@ -455,8 +487,8 @@ rt_task_plot_record_matches(struct rt_plot_common *rt,
455 rt_graph_check_switch_away(ARG, &dint, &dull) || 487 rt_graph_check_switch_away(ARG, &dint, &dull) ||
456 rt_graph_check_task_release(ARG, &dint, &dull, &dull) || 488 rt_graph_check_task_release(ARG, &dint, &dull, &dull) ||
457 rt_graph_check_task_completion(ARG, &dint, &dull) || 489 rt_graph_check_task_completion(ARG, &dint, &dull) ||
458 rt_graph_check_task_block(ARG, &dull) || 490 rt_graph_check_task_block(ARG, &dint, &dull) ||
459 rt_graph_check_task_resume(ARG, &dull) || 491 rt_graph_check_task_resume(ARG, &dint, &dull) ||
460 rt_graph_check_any(ARG, &dint, &dull); 492 rt_graph_check_any(ARG, &dint, &dull);
461#undef ARG 493#undef ARG
462 return pid == match_pid; 494 return pid == match_pid;
@@ -617,6 +649,7 @@ void rt_plot_task(struct graph_info *ginfo, int pid, int pos)
617 rtt_info = malloc_or_die(sizeof(*rtt_info)); 649 rtt_info = malloc_or_die(sizeof(*rtt_info));
618 rtt_info->pid = pid; 650 rtt_info->pid = pid;
619 rtt_info->label = malloc_or_die(LLABEL); 651 rtt_info->label = malloc_or_die(LLABEL);
652 rtt_info->block_label = malloc_or_die(LLABEL);
620 rtt_info->wcet = params->wcet; 653 rtt_info->wcet = params->wcet;
621 rtt_info->period = params->period; 654 rtt_info->period = params->period;
622 655
diff --git a/rt-plot-task.h b/rt-plot-task.h
index ddbfb1c..0056434 100644
--- a/rt-plot-task.h
+++ b/rt-plot-task.h
@@ -13,8 +13,10 @@ struct rt_task_info {
13 /* For drawing squares */ 13 /* For drawing squares */
14 unsigned long long run_time; 14 unsigned long long run_time;
15 int run_cpu; 15 int run_cpu;
16
16 unsigned long long block_time; 17 unsigned long long block_time;
17 int block_cpu; 18 int block_cpu;
19 int block_lid;
18 20
19 /* For managing state */ 21 /* For managing state */
20 int last_job; 22 int last_job;
@@ -25,6 +27,7 @@ struct rt_task_info {
25 gboolean params_found; 27 gboolean params_found;
26 gboolean fresh; 28 gboolean fresh;
27 char *label; 29 char *label;
30 char *block_label;
28}; 31};
29 32
30const struct plot_callbacks rt_task_cb; 33const struct plot_callbacks rt_task_cb;
diff --git a/rt-plot-vcpu.c b/rt-plot-vcpu.c
index 54dc05f..f327f57 100644
--- a/rt-plot-vcpu.c
+++ b/rt-plot-vcpu.c
@@ -131,6 +131,9 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
131 unsigned long long deadline, release; 131 unsigned long long deadline, release;
132 struct record *record; 132 struct record *record;
133 133
134 if (ginfo->view_end_time == ginfo->end_time)
135 return;
136
134 if (vcpu_info->run_time && vcpu_info->run_cpu != NO_CPU) { 137 if (vcpu_info->run_time && vcpu_info->run_cpu != NO_CPU) {
135 info->box = TRUE; 138 info->box = TRUE;
136 info->bcolor = hash_pid(vcpu_info->run_tid); 139 info->bcolor = hash_pid(vcpu_info->run_tid);
@@ -170,8 +173,8 @@ static int rt_vcpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot,
170 173
171 match = try_server_switch_away(ginfo, vcpu_info, record, info) || 174 match = try_server_switch_away(ginfo, vcpu_info, record, info) ||
172 try_server_switch_to(ginfo, vcpu_info, record, info) || 175 try_server_switch_to(ginfo, vcpu_info, record, info) ||
173 vcpu_try_block(ginfo, vcpu_info, record, info) || 176 /* vcpu_try_block(ginfo, vcpu_info, record, info) || */
174 vcpu_try_resume(ginfo, vcpu_info, record, info) || 177 /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */
175 vcpu_try_release(ginfo, vcpu_info, record, info) || 178 vcpu_try_release(ginfo, vcpu_info, record, info) ||
176 vcpu_try_completion(ginfo, vcpu_info, record, info) || 179 vcpu_try_completion(ginfo, vcpu_info, record, info) ||
177 try_switch_to(ginfo, vcpu_info, record, info) || 180 try_switch_to(ginfo, vcpu_info, record, info) ||
@@ -265,9 +268,9 @@ int rt_vcpu_plot_record_matches(struct rt_plot_common *rt,
265 match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dull) || 268 match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dull) ||
266 rt_graph_check_server_switch_away(ARG, &dint, &dint, &dull) || 269 rt_graph_check_server_switch_away(ARG, &dint, &dint, &dull) ||
267 rt_graph_check_server_completion(ARG, &dint, &dull) || 270 rt_graph_check_server_completion(ARG, &dint, &dull) ||
268 rt_graph_check_server_release(ARG, &dint, &dull, &dull) || 271 rt_graph_check_server_release(ARG, &dint, &dull, &dull);
269 rt_graph_check_server_block(ARG, &dull) || 272 /* rt_graph_check_server_block(ARG, &dull) || */
270 rt_graph_check_server_resume(ARG, &dull); 273 /* rt_graph_check_server_resume(ARG, &dull); */
271#undef ARG 274#undef ARG
272 return (sid == vcpu_info->sid); 275 return (sid == vcpu_info->sid);
273} 276}
@@ -364,55 +367,55 @@ int vcpu_try_completion(struct graph_info *ginfo,
364 return ret; 367 return ret;
365} 368}
366 369
367/** 370/* /\** */
368 * vcpu_try_block - start block box if record matches 371/* * vcpu_try_block - start block box if record matches */
369 */ 372/* *\/ */
370int vcpu_try_block(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 373/* int vcpu_try_block(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */
371 struct record *record, struct plot_info *info) 374/* struct record *record, struct plot_info *info) */
372{ 375/* { */
373 int sid, match, ret = 0; 376/* int sid, match, ret = 0; */
374 unsigned long long ts; 377/* unsigned long long ts; */
375 378
376 match = rt_graph_check_server_block(ginfo, record, &sid, &ts); 379/* match = rt_graph_check_server_block(ginfo, record, &sid, &ts); */
377 if (match && sid == vcpu_info->sid) { 380/* if (match && sid == vcpu_info->sid) { */
378 vcpu_info->fresh = FALSE; 381/* vcpu_info->fresh = FALSE; */
379 vcpu_info->block_time = ts; 382/* vcpu_info->block_time = ts; */
380 vcpu_info->block_cpu = NO_CPU; 383/* vcpu_info->block_cpu = NO_CPU; */
381 dprintf(3, "VCPU resume for %d on %d at %llu\n", 384/* dprintf(3, "VCPU resume for %d on %d at %llu\n", */
382 sid, record->cpu, ts); 385/* sid, record->cpu, ts); */
383 ret = 1; 386/* ret = 1; */
384 } 387/* } */
385 return ret; 388/* return ret; */
386} 389/* } */
387 390
388/** 391/* /\** */
389 * vcpu_try_resume - end block box if record matches 392/* * vcpu_try_resume - end block box if record matches */
390 */ 393/* *\/ */
391int vcpu_try_resume(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 394/* int vcpu_try_resume(struct graph_info *ginfo, struct vcpu_info *vcpu_info, */
392 struct record *record, struct plot_info *info) 395/* struct record *record, struct plot_info *info) */
393{ 396/* { */
394 int sid, match, ret = 0; 397/* int sid, match, ret = 0; */
395 unsigned long long ts; 398/* unsigned long long ts; */
396 399
397 match = rt_graph_check_server_resume(ginfo, record, &sid, &ts); 400/* match = rt_graph_check_server_resume(ginfo, record, &sid, &ts); */
398 401
399 if (match && sid == vcpu_info->sid) { 402/* if (match && sid == vcpu_info->sid) { */
400 info->box = TRUE; 403/* info->box = TRUE; */
401 info->bcolor = 0x0; 404/* info->bcolor = 0x0; */
402 info->bfill = TRUE; 405/* info->bfill = TRUE; */
403 info->bthin = TRUE; 406/* info->bthin = TRUE; */
404 info->bstart = vcpu_info->block_time; 407/* info->bstart = vcpu_info->block_time; */
405 info->bend = ts; 408/* info->bend = ts; */
406 vcpu_info->fresh = FALSE; 409/* vcpu_info->fresh = FALSE; */
407 410
408 vcpu_info->block_time = 0ULL; 411/* vcpu_info->block_time = 0ULL; */
409 vcpu_info->block_cpu = NO_CPU; 412/* vcpu_info->block_cpu = NO_CPU; */
410 dprintf(3, "VCPU resume for %d on %d at %llu\n", 413/* dprintf(3, "VCPU resume for %d on %d at %llu\n", */
411 sid, record->cpu, ts); 414/* sid, record->cpu, ts); */
412 415
413 ret = 1; 416/* ret = 1; */
414 } 417/* } */
415 return ret; 418/* return ret; */
416} 419/* } */
417 420
418 421
diff --git a/rt-plot-vtask.c b/rt-plot-vtask.c
index 5b54343..5000873 100644
--- a/rt-plot-vtask.c
+++ b/rt-plot-vtask.c
@@ -119,6 +119,9 @@ static void do_plot_end(struct graph_info *ginfo, struct vcpu_info *vcpu_info,
119 unsigned long long deadline, release; 119 unsigned long long deadline, release;
120 struct record *record; 120 struct record *record;
121 121
122 if (ginfo->view_end_time == ginfo->end_time)
123 return;
124
122 if (vcpu_info->run_time && vcpu_info->run_cpu != NO_CPU) { 125 if (vcpu_info->run_time && vcpu_info->run_cpu != NO_CPU) {
123 info->box = TRUE; 126 info->box = TRUE;
124 info->bcolor = hash_pid(vcpu_info->sid); 127 info->bcolor = hash_pid(vcpu_info->sid);
@@ -158,8 +161,8 @@ static int rt_vtask_plot_event(struct graph_info *ginfo, struct graph_plot *plot
158 161
159 match = try_server_switch_away(ginfo, vcpu_info, record, info) || 162 match = try_server_switch_away(ginfo, vcpu_info, record, info) ||
160 try_server_switch_to(ginfo, vcpu_info, record, info) || 163 try_server_switch_to(ginfo, vcpu_info, record, info) ||
161 vcpu_try_block(ginfo, vcpu_info, record, info) || 164 /* vcpu_try_block(ginfo, vcpu_info, record, info) || */
162 vcpu_try_resume(ginfo, vcpu_info, record, info) || 165 /* vcpu_try_resume(ginfo, vcpu_info, record, info) || */
163 vcpu_try_release(ginfo, vcpu_info, record, info) || 166 vcpu_try_release(ginfo, vcpu_info, record, info) ||
164 vcpu_try_completion(ginfo, vcpu_info, record, info) || 167 vcpu_try_completion(ginfo, vcpu_info, record, info) ||
165 try_switch_to(ginfo, vcpu_info, record, info) || 168 try_switch_to(ginfo, vcpu_info, record, info) ||
diff --git a/trace-graph.c b/trace-graph.c
index d8367ae..b20aabe 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -55,7 +55,7 @@
55#define PLOT_GIVE 2 55#define PLOT_GIVE 2
56#define PLOT_BEGIN 80 56#define PLOT_BEGIN 80
57#define PLOT_SEP 50 57#define PLOT_SEP 50
58#define MAX_TRI_TIME 10000000 58#define MAX_TRI_TIME 1000000
59#define PLOT_LINE(plot) (PLOT_SEP * (plot) + PLOT_BEGIN + PLOT_SIZE) 59#define PLOT_LINE(plot) (PLOT_SEP * (plot) + PLOT_BEGIN + PLOT_SIZE)
60#define PLOT_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE * 2) 60#define PLOT_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE * 2)
61#define PLOT_BOX_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE) 61#define PLOT_BOX_TOP(plot) (PLOT_LINE(plot) - PLOT_SIZE)
@@ -1695,7 +1695,7 @@ static void draw_plot_box(struct graph_info *ginfo, int i,
1695 fill, 1695 fill,
1696 x1, y, 1696 x1, y,
1697 x2 - x1, size); 1697 x2 - x1, size);
1698 if (!thin && fill && is_high_res(ginfo)) { 1698 if (!thin && fill && (x2 - x1 > 1)) {
1699 gdk_draw_rectangle(ginfo->curr_pixmap, 1699 gdk_draw_rectangle(ginfo->curr_pixmap,
1700 ginfo->draw->style->black_gc, 1700 ginfo->draw->style->black_gc,
1701 FALSE, 1701 FALSE,
@@ -1703,8 +1703,16 @@ static void draw_plot_box(struct graph_info *ginfo, int i,
1703 x2 - x1, size); 1703 x2 - x1, size);
1704 } 1704 }
1705 1705
1706 if (label) 1706 if (label) {
1707 draw_plot_label(ginfo, label, x1 + 1, y + 1, x2 - x1 - 2); 1707 if (!thin)
1708 draw_plot_label(ginfo, label, x1 + 1,
1709 y + 1, x2 - x1 - 2);
1710 else
1711 draw_plot_label(ginfo, label, (x1 + x2) / 2,
1712 y - PLOT_BOX_SIZE,
1713 x2 - x1 - 2);
1714 }
1715
1708} 1716}
1709 1717
1710static void draw_plot_release(struct graph_info *ginfo, int i, 1718static void draw_plot_release(struct graph_info *ginfo, int i,
diff --git a/trace-graph.h b/trace-graph.h
index d56438d..67a8f35 100644
--- a/trace-graph.h
+++ b/trace-graph.h
@@ -80,6 +80,14 @@ struct plot_info {
80 80
81 gboolean completion; 81 gboolean completion;
82 unsigned long long ctime; 82 unsigned long long ctime;
83
84 gboolean ubox;
85 unsigned long long ubtime;
86 char *ublabel;
87
88 gboolean dbox;
89 unsigned long long dbtime;
90 char *dblabel;
83}; 91};
84 92
85/* 93/*