diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-02 18:50:44 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-05-02 18:50:44 -0400 |
commit | c55e411400c13bcfc774d541fc1c9f0f62b644c4 (patch) | |
tree | e7c5e855158daa2764aad0076290ced4a936fcc0 | |
parent | 85ea929e767680261d154aebf8b29dad95839d7c (diff) |
GSN-EDF: add extra debug info
-rw-r--r-- | litmus/sched_gsn_edf.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 5dcc250aa6..c60b6ddd49 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -354,6 +354,9 @@ static void gsnedf_setup_release_job_timer(struct task_struct *task) | |||
354 | #endif | 354 | #endif |
355 | 355 | ||
356 | /* Expiration time of timer is release time of task. */ | 356 | /* Expiration time of timer is release time of task. */ |
357 | TRACE_TASK(task, "prog timer, rel=%llu, at %llu\n", | ||
358 | get_release(task), | ||
359 | litmus_clock()); | ||
357 | release_timer(task).expires = ns_to_ktime(get_release(task)); | 360 | release_timer(task).expires = ns_to_ktime(get_release(task)); |
358 | 361 | ||
359 | hrtimer_start(&release_timer(task), release_timer(task).expires, | 362 | hrtimer_start(&release_timer(task), release_timer(task).expires, |
@@ -453,6 +456,17 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
453 | sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP; | 456 | sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP; |
454 | preempt = entry->scheduled != entry->linked; | 457 | preempt = entry->scheduled != entry->linked; |
455 | 458 | ||
459 | if (exists) | ||
460 | TRACE_TASK(prev, | ||
461 | "blocks:%d out_of_time:%d np:%d sleep:%d preempt:%d " | ||
462 | "state:%d sig:%d\n", | ||
463 | blocks, out_of_time, np, sleep, preempt, | ||
464 | prev->state, signal_pending(prev)); | ||
465 | if (entry->linked && preempt) | ||
466 | TRACE_TASK(prev, "will be preempted by %s/%d\n", | ||
467 | entry->linked->comm, entry->linked->pid); | ||
468 | |||
469 | |||
456 | /* If a task blocks we have no choice but to reschedule. | 470 | /* If a task blocks we have no choice but to reschedule. |
457 | */ | 471 | */ |
458 | if (blocks) | 472 | if (blocks) |
@@ -497,6 +511,10 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
497 | 511 | ||
498 | spin_unlock(&gsnedf_lock); | 512 | spin_unlock(&gsnedf_lock); |
499 | 513 | ||
514 | if (next) | ||
515 | TRACE_TASK(next, "scheduled at %llu\n", litmus_clock()); | ||
516 | else if (exists && !next) | ||
517 | TRACE("becomes idle at %llu.\n", litmus_clock()); | ||
500 | /* don't race with a concurrent switch */ | 518 | /* don't race with a concurrent switch */ |
501 | if (next && prev != next) | 519 | if (next && prev != next) |
502 | while (next->rt_param.scheduled_on != NO_CPU) | 520 | while (next->rt_param.scheduled_on != NO_CPU) |
@@ -549,6 +567,8 @@ static void gsnedf_task_wake_up(struct task_struct *task) | |||
549 | unsigned long flags; | 567 | unsigned long flags; |
550 | lt_t now; | 568 | lt_t now; |
551 | 569 | ||
570 | TRACE_TASK(task, "wake_up at %llu\n", litmus_clock()); | ||
571 | |||
552 | spin_lock_irqsave(&gsnedf_lock, flags); | 572 | spin_lock_irqsave(&gsnedf_lock, flags); |
553 | /* We need to take suspensions because of semaphores into | 573 | /* We need to take suspensions because of semaphores into |
554 | * account! If a job resumes after being suspended due to acquiring | 574 | * account! If a job resumes after being suspended due to acquiring |
@@ -576,6 +596,8 @@ static void gsnedf_task_block(struct task_struct *t) | |||
576 | { | 596 | { |
577 | unsigned long flags; | 597 | unsigned long flags; |
578 | 598 | ||
599 | TRACE_TASK(t, "block at %llu\n", litmus_clock()); | ||
600 | |||
579 | /* unlink if necessary */ | 601 | /* unlink if necessary */ |
580 | spin_lock_irqsave(&gsnedf_lock, flags); | 602 | spin_lock_irqsave(&gsnedf_lock, flags); |
581 | unlink(t); | 603 | unlink(t); |