diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:20:53 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 15:08:28 -0400 |
commit | 36fc25a9f48deacd8aa08cd2d1c186a4e412604f (patch) | |
tree | c380d30f4501fc8c1d5297f444cd65e78a688db4 /kernel/sched.c | |
parent | f29c73fe3404f8799ed57aaf48859e0b55fc071f (diff) |
ftrace: sched tree fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 9ca4a2e6a236..3bc7c5362998 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2414,6 +2414,23 @@ static int sched_balance_self(int cpu, int flag) | |||
2414 | 2414 | ||
2415 | #ifdef CONFIG_CONTEXT_SWITCH_TRACER | 2415 | #ifdef CONFIG_CONTEXT_SWITCH_TRACER |
2416 | 2416 | ||
2417 | void ftrace_task(struct task_struct *p, void *__tr, void *__data) | ||
2418 | { | ||
2419 | #if 0 | ||
2420 | /* | ||
2421 | * trace timeline tree | ||
2422 | */ | ||
2423 | __trace_special(__tr, __data, | ||
2424 | p->pid, p->se.vruntime, p->se.sum_exec_runtime); | ||
2425 | #else | ||
2426 | /* | ||
2427 | * trace balance metrics | ||
2428 | */ | ||
2429 | __trace_special(__tr, __data, | ||
2430 | p->pid, p->se.avg_overlap, 0); | ||
2431 | #endif | ||
2432 | } | ||
2433 | |||
2417 | void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data) | 2434 | void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data) |
2418 | { | 2435 | { |
2419 | struct task_struct *p; | 2436 | struct task_struct *p; |
@@ -2421,32 +2438,22 @@ void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data) | |||
2421 | struct rb_node *curr; | 2438 | struct rb_node *curr; |
2422 | struct rq *rq = __rq; | 2439 | struct rq *rq = __rq; |
2423 | 2440 | ||
2424 | curr = first_fair(&rq->cfs); | ||
2425 | if (!curr) | ||
2426 | return; | ||
2427 | |||
2428 | if (rq->cfs.curr) { | 2441 | if (rq->cfs.curr) { |
2429 | p = task_of(rq->cfs.curr); | 2442 | p = task_of(rq->cfs.curr); |
2430 | __trace_special(__tr, __data, | 2443 | ftrace_task(p, __tr, __data); |
2431 | p->pid, p->se.vruntime, p->se.sum_exec_runtime); | ||
2432 | } | 2444 | } |
2433 | if (rq->cfs.next) { | 2445 | if (rq->cfs.next) { |
2434 | p = task_of(rq->cfs.next); | 2446 | p = task_of(rq->cfs.next); |
2435 | __trace_special(__tr, __data, | 2447 | ftrace_task(p, __tr, __data); |
2436 | p->pid, p->se.vruntime, p->se.sum_exec_runtime); | ||
2437 | } | 2448 | } |
2438 | 2449 | ||
2439 | while (curr) { | 2450 | for (curr = first_fair(&rq->cfs); curr; curr = rb_next(curr)) { |
2440 | se = rb_entry(curr, struct sched_entity, run_node); | 2451 | se = rb_entry(curr, struct sched_entity, run_node); |
2441 | if (!entity_is_task(se)) | 2452 | if (!entity_is_task(se)) |
2442 | continue; | 2453 | continue; |
2443 | 2454 | ||
2444 | p = task_of(se); | 2455 | p = task_of(se); |
2445 | 2456 | ftrace_task(p, __tr, __data); | |
2446 | __trace_special(__tr, __data, | ||
2447 | p->pid, p->se.vruntime, p->se.sum_exec_runtime); | ||
2448 | |||
2449 | curr = rb_next(curr); | ||
2450 | } | 2457 | } |
2451 | } | 2458 | } |
2452 | 2459 | ||