aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2010-09-22 23:16:18 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-09-22 23:16:18 -0400
commitb6fd57bbcc9cb4b5e5e79ac5dfc48cca08e94e8c (patch)
tree539fa434d67d4c6cf5ae8ea1743ddd0371ae174d
parent3be919424109f4e3f77740fe7f10db4a4f194e90 (diff)
EDF-WM: add tracing info and BUG_ON() checks
To aid with debugging.
-rw-r--r--litmus/sched_edf_wm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/litmus/sched_edf_wm.c b/litmus/sched_edf_wm.c
index f7a2fccd55a5..e25977a91c8b 100644
--- a/litmus/sched_edf_wm.c
+++ b/litmus/sched_edf_wm.c
@@ -103,6 +103,11 @@ static void advance_next_slice(struct task_struct* t, int completion_signaled)
103 idx = p->semi_part.wm.slice - 103 idx = p->semi_part.wm.slice -
104 p->task_params.semi_part.wm.slices; 104 p->task_params.semi_part.wm.slices;
105 105
106 TRACE_TASK(t, "advancing slice %d; excess=%lluns; "
107 "completion_signaled=%d.\n",
108 idx, slice_exec_time(t) - slice_budget(t),
109 completion_signaled);
110
106 if (completion_signaled) 111 if (completion_signaled)
107 idx = 0; 112 idx = 0;
108 else 113 else
@@ -160,8 +165,11 @@ static void fast_forward_slices(struct task_struct* t, lt_t time_passed)
160 time_passed -= slice_budget_remaining(t); 165 time_passed -= slice_budget_remaining(t);
161 tsk_rt(t)->job_params.exec_time += 166 tsk_rt(t)->job_params.exec_time +=
162 slice_budget_remaining(t); 167 slice_budget_remaining(t);
168
163 BUG_ON(!slice_budget_exhausted(t)); 169 BUG_ON(!slice_budget_exhausted(t));
164 BUG_ON(slice_budget_remaining(t) != 0); 170 BUG_ON(slice_budget_remaining(t) != 0);
171 BUG_ON(tsk_rt(t)->semi_part.wm.slice == get_last_slice(t));
172
165 advance_next_slice(t, 0); 173 advance_next_slice(t, 0);
166 } 174 }
167 /* add remainder to exec cost */ 175 /* add remainder to exec cost */
@@ -357,7 +365,8 @@ static struct task_struct* wm_schedule(struct task_struct * prev)
357 next = prev; 365 next = prev;
358 366
359 if (next) { 367 if (next) {
360 TRACE_TASK(next, "scheduled at %llu\n", litmus_clock()); 368 TRACE_TASK(next, "scheduled at %llu (state:%d/%d)\n", litmus_clock(),
369 next->state, is_running(next));
361 set_rt_flags(next, RT_F_RUNNING); 370 set_rt_flags(next, RT_F_RUNNING);
362 } else if (exists) { 371 } else if (exists) {
363 TRACE("becoming idle at %llu\n", litmus_clock()); 372 TRACE("becoming idle at %llu\n", litmus_clock());
@@ -462,16 +471,20 @@ static void wm_task_wake_up(struct task_struct *t)
462 471
463 sleep_time = now - p->semi_part.wm.suspend_time; 472 sleep_time = now - p->semi_part.wm.suspend_time;
464 473
465 TRACE_TASK(t, "wake_up at %llu after %llu\n", now, sleep_time); 474 TRACE_TASK(t, "wake_up at %llu after %llu, still-scheduled:%d\n",
475 now, sleep_time, dom->scheduled == t);
466 476
467 /* account sleep time as execution time */ 477 /* account sleep time as execution time */
468 if (get_exec_time(t) + sleep_time >= get_exec_cost(t)) { 478 if (get_exec_time(t) + sleep_time >= get_exec_cost(t)) {
469 /* new sporadic release */ 479 /* new sporadic release */
480 TRACE_TASK(t, "new sporadic release\n");
470 wm_release_at(t, wm_earliest_release(t, now)); 481 wm_release_at(t, wm_earliest_release(t, now));
471 sched_trace_task_release(t); 482 sched_trace_task_release(t);
472 } else if (is_sliced_task(t)) { 483 } else if (is_sliced_task(t)) {
473 /* figure out which slice we should be executing on */ 484 /* figure out which slice we should be executing on */
474 fast_forward_slices(t, sleep_time); 485 fast_forward_slices(t, sleep_time);
486 /* can't be exhausted now */
487 BUG_ON(wm_budget_exhausted(t));
475 } else { 488 } else {
476 /* simply add to the execution time */ 489 /* simply add to the execution time */
477 tsk_rt(t)->job_params.exec_time += sleep_time; 490 tsk_rt(t)->job_params.exec_time += sleep_time;