aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--litmus/sched_gsn_edf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index 9f256be86cf7..2a0ee50d26a2 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -118,6 +118,11 @@ static rt_domain_t gsnedf;
118#define gsnedf_lock (gsnedf.ready_lock) 118#define gsnedf_lock (gsnedf.ready_lock)
119 119
120 120
121/* Uncomment this if you want to see all scheduling decisions in the
122 * TRACE() log.
123#define WANT_ALL_SCHED_EVENTS
124 */
125
121static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) 126static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b)
122{ 127{
123 cpu_entry_t *a, *b; 128 cpu_entry_t *a, *b;
@@ -196,10 +201,12 @@ static noinline void link_task_to_cpu(struct task_struct* linked,
196 linked->rt_param.linked_on = entry->cpu; 201 linked->rt_param.linked_on = entry->cpu;
197 } 202 }
198 entry->linked = linked; 203 entry->linked = linked;
204#ifdef WANT_ALL_SCHED_EVENTS
199 if (linked) 205 if (linked)
200 TRACE_TASK(linked, "linked to %d.\n", entry->cpu); 206 TRACE_TASK(linked, "linked to %d.\n", entry->cpu);
201 else 207 else
202 TRACE("NULL linked to %d.\n", entry->cpu); 208 TRACE("NULL linked to %d.\n", entry->cpu);
209#endif
203 update_cpu_position(entry); 210 update_cpu_position(entry);
204} 211}
205 212
@@ -415,7 +422,9 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev)
415 sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP; 422 sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP;
416 preempt = entry->scheduled != entry->linked; 423 preempt = entry->scheduled != entry->linked;
417 424
425#ifdef WANT_ALL_SCHED_EVENTS
418 TRACE_TASK(prev, "invoked gsnedf_schedule.\n"); 426 TRACE_TASK(prev, "invoked gsnedf_schedule.\n");
427#endif
419 428
420 if (exists) 429 if (exists)
421 TRACE_TASK(prev, 430 TRACE_TASK(prev,
@@ -480,13 +489,14 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev)
480 489
481 spin_unlock(&gsnedf_lock); 490 spin_unlock(&gsnedf_lock);
482 491
492#ifdef WANT_ALL_SCHED_EVENTS
483 TRACE("gsnedf_lock released, next=0x%p\n", next); 493 TRACE("gsnedf_lock released, next=0x%p\n", next);
484 494
485
486 if (next) 495 if (next)
487 TRACE_TASK(next, "scheduled at %llu\n", litmus_clock()); 496 TRACE_TASK(next, "scheduled at %llu\n", litmus_clock());
488 else if (exists && !next) 497 else if (exists && !next)
489 TRACE("becomes idle at %llu.\n", litmus_clock()); 498 TRACE("becomes idle at %llu.\n", litmus_clock());
499#endif
490 500
491 501
492 return next; 502 return next;
@@ -500,7 +510,9 @@ static void gsnedf_finish_switch(struct task_struct *prev)
500 cpu_entry_t* entry = &__get_cpu_var(gsnedf_cpu_entries); 510 cpu_entry_t* entry = &__get_cpu_var(gsnedf_cpu_entries);
501 511
502 entry->scheduled = is_realtime(current) ? current : NULL; 512 entry->scheduled = is_realtime(current) ? current : NULL;
513#ifdef WANT_ALL_SCHED_EVENTS
503 TRACE_TASK(prev, "switched away from\n"); 514 TRACE_TASK(prev, "switched away from\n");
515#endif
504} 516}
505 517
506 518