diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-10 12:19:35 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-05 08:13:18 -0500 |
commit | a698e30c15dc3ce113f7f7c0c821a38f4f8cbab0 (patch) | |
tree | 8099be278a778b98a3b1adfd1b2bf9fa8fd50381 | |
parent | 7648363e5636bd865aeac3236eb4675f0687eb4a (diff) |
DBG: enable additional debug tracing
-rw-r--r-- | kernel/sched.c | 8 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 22 | ||||
-rw-r--r-- | litmus/sched_litmus.c | 6 |
3 files changed, 26 insertions, 10 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1b13c8e1cfc2..e4cfd193e76b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -79,6 +79,7 @@ | |||
79 | #include "sched_cpupri.h" | 79 | #include "sched_cpupri.h" |
80 | #include "workqueue_sched.h" | 80 | #include "workqueue_sched.h" |
81 | 81 | ||
82 | #include <litmus/debug_trace.h> | ||
82 | #include <litmus/sched_trace.h> | 83 | #include <litmus/sched_trace.h> |
83 | #include <litmus/trace.h> | 84 | #include <litmus/trace.h> |
84 | 85 | ||
@@ -583,8 +584,11 @@ void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags) | |||
583 | * cases. LITMUS^RT amplifies the effects of this problem. Hence, we | 584 | * cases. LITMUS^RT amplifies the effects of this problem. Hence, we |
584 | * turn it off to avoid stalling clocks. */ | 585 | * turn it off to avoid stalling clocks. */ |
585 | /* | 586 | /* |
586 | if (test_tsk_need_resched(p)) | 587 | if (test_tsk_need_resched(p)) { |
587 | rq->skip_clock_update = 1; | 588 | rq->skip_clock_update = 1; |
589 | TRACE_TASK(p, "rq->skip_clock_update <- 1 (flags=%x; cpu=%d; is-cur?=%d)\n", | ||
590 | flags, rq->cpu, rq->curr == p); | ||
591 | } | ||
588 | */ | 592 | */ |
589 | } | 593 | } |
590 | 594 | ||
@@ -3744,6 +3748,8 @@ static void put_prev_task(struct rq *rq, struct task_struct *prev) | |||
3744 | { | 3748 | { |
3745 | if (prev->se.on_rq) | 3749 | if (prev->se.on_rq) |
3746 | update_rq_clock(rq); | 3750 | update_rq_clock(rq); |
3751 | if (rq->skip_clock_update) | ||
3752 | TRACE_TASK(prev, "rq->skip_clock_update <- 0 (cpu: %d)\n", rq->cpu); | ||
3747 | rq->skip_clock_update = 0; | 3753 | rq->skip_clock_update = 0; |
3748 | prev->sched_class->put_prev_task(rq, prev); | 3754 | prev->sched_class->put_prev_task(rq, prev); |
3749 | } | 3755 | } |
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index e9c5e531b1ae..44cafbadfa28 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -112,9 +112,9 @@ static rt_domain_t gsnedf; | |||
112 | 112 | ||
113 | 113 | ||
114 | /* Uncomment this if you want to see all scheduling decisions in the | 114 | /* Uncomment this if you want to see all scheduling decisions in the |
115 | * TRACE() log. | 115 | * TRACE() log. */ |
116 | #define WANT_ALL_SCHED_EVENTS | 116 | #define WANT_ALL_SCHED_EVENTS |
117 | */ | 117 | |
118 | 118 | ||
119 | static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) | 119 | static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) |
120 | { | 120 | { |
@@ -197,8 +197,9 @@ static noinline void link_task_to_cpu(struct task_struct* linked, | |||
197 | #ifdef WANT_ALL_SCHED_EVENTS | 197 | #ifdef WANT_ALL_SCHED_EVENTS |
198 | if (linked) | 198 | if (linked) |
199 | TRACE_TASK(linked, "linked to %d.\n", entry->cpu); | 199 | TRACE_TASK(linked, "linked to %d.\n", entry->cpu); |
200 | else | 200 | /* else |
201 | TRACE("NULL linked to %d.\n", entry->cpu); | 201 | TRACE("NULL linked to %d.\n", entry->cpu); |
202 | */ | ||
202 | #endif | 203 | #endif |
203 | update_cpu_position(entry); | 204 | update_cpu_position(entry); |
204 | } | 205 | } |
@@ -300,7 +301,7 @@ static noinline void job_completion(struct task_struct *t, int forced) | |||
300 | 301 | ||
301 | sched_trace_task_completion(t, forced); | 302 | sched_trace_task_completion(t, forced); |
302 | 303 | ||
303 | TRACE_TASK(t, "job_completion().\n"); | 304 | TRACE_TASK(t, "job_completion(%u).\n", tsk_rt(t)->job_params.job_no); |
304 | 305 | ||
305 | /* set flags */ | 306 | /* set flags */ |
306 | set_rt_flags(t, RT_F_SLEEP); | 307 | set_rt_flags(t, RT_F_SLEEP); |
@@ -324,6 +325,9 @@ static noinline void job_completion(struct task_struct *t, int forced) | |||
324 | */ | 325 | */ |
325 | static void gsnedf_tick(struct task_struct* t) | 326 | static void gsnedf_tick(struct task_struct* t) |
326 | { | 327 | { |
328 | if (is_realtime(t)) | ||
329 | TRACE_TASK(t, "exec_time = %llu\n", get_exec_time(t)); | ||
330 | |||
327 | if (is_realtime(t) && budget_enforced(t) && budget_exhausted(t)) { | 331 | if (is_realtime(t) && budget_enforced(t) && budget_exhausted(t)) { |
328 | if (!is_np(t)) { | 332 | if (!is_np(t)) { |
329 | /* np tasks will be preempted when they become | 333 | /* np tasks will be preempted when they become |
@@ -395,7 +399,9 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
395 | preempt = entry->scheduled != entry->linked; | 399 | preempt = entry->scheduled != entry->linked; |
396 | 400 | ||
397 | #ifdef WANT_ALL_SCHED_EVENTS | 401 | #ifdef WANT_ALL_SCHED_EVENTS |
398 | TRACE_TASK(prev, "invoked gsnedf_schedule.\n"); | 402 | if (exists || entry->linked) |
403 | TRACE_TASK(prev, "invoked gsnedf_schedule at %llu\n", | ||
404 | litmus_clock()); | ||
399 | #endif | 405 | #endif |
400 | 406 | ||
401 | if (exists) | 407 | if (exists) |
@@ -464,15 +470,12 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
464 | raw_spin_unlock(&gsnedf_lock); | 470 | raw_spin_unlock(&gsnedf_lock); |
465 | 471 | ||
466 | #ifdef WANT_ALL_SCHED_EVENTS | 472 | #ifdef WANT_ALL_SCHED_EVENTS |
467 | TRACE("gsnedf_lock released, next=0x%p\n", next); | ||
468 | |||
469 | if (next) | 473 | if (next) |
470 | TRACE_TASK(next, "scheduled at %llu\n", litmus_clock()); | 474 | TRACE_TASK(next, "scheduled at %llu\n", litmus_clock()); |
471 | else if (exists && !next) | 475 | else if (exists && !next) |
472 | TRACE("becomes idle at %llu.\n", litmus_clock()); | 476 | TRACE("becomes idle at %llu.\n", litmus_clock()); |
473 | #endif | 477 | #endif |
474 | 478 | ||
475 | |||
476 | return next; | 479 | return next; |
477 | } | 480 | } |
478 | 481 | ||
@@ -485,7 +488,8 @@ static void gsnedf_finish_switch(struct task_struct *prev) | |||
485 | 488 | ||
486 | entry->scheduled = is_realtime(current) ? current : NULL; | 489 | entry->scheduled = is_realtime(current) ? current : NULL; |
487 | #ifdef WANT_ALL_SCHED_EVENTS | 490 | #ifdef WANT_ALL_SCHED_EVENTS |
488 | TRACE_TASK(prev, "switched away from\n"); | 491 | if (is_realtime(prev)) |
492 | TRACE_TASK(prev, "switched away from\n"); | ||
489 | #endif | 493 | #endif |
490 | } | 494 | } |
491 | 495 | ||
diff --git a/litmus/sched_litmus.c b/litmus/sched_litmus.c index e6952896dc4b..b61fea15935f 100644 --- a/litmus/sched_litmus.c +++ b/litmus/sched_litmus.c | |||
@@ -10,6 +10,12 @@ static void update_time_litmus(struct rq *rq, struct task_struct *p) | |||
10 | u64 delta = rq->clock - p->se.exec_start; | 10 | u64 delta = rq->clock - p->se.exec_start; |
11 | if (unlikely((s64)delta < 0)) | 11 | if (unlikely((s64)delta < 0)) |
12 | delta = 0; | 12 | delta = 0; |
13 | if (rq->skip_clock_update) | ||
14 | TRACE_TASK(p, "rq->skip_clock_update\n"); | ||
15 | TRACE_TASK(p, "update_time_litmus: " | ||
16 | "rq->clock=%llu " | ||
17 | "p->se.exec_start=%llu litmus=%llu => delta=%llu\n", | ||
18 | rq->clock, p->se.exec_start, litmus_clock(), delta); | ||
13 | /* per job counter */ | 19 | /* per job counter */ |
14 | p->rt_param.job_params.exec_time += delta; | 20 | p->rt_param.job_params.exec_time += delta; |
15 | /* task counter */ | 21 | /* task counter */ |