ftrace: sched tracer, trace full rbtree

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Ingo Molnar
2008-05-12 21:20:52 +02:00
committed by Thomas Gleixner
parent 4c1f4d4f01
commit 4e65551905
5 changed files with 108 additions and 52 deletions

View File

@ -2394,6 +2394,35 @@ static int sched_balance_self(int cpu, int flag)
#endif /* CONFIG_SMP */
#ifdef CONFIG_CONTEXT_SWITCH_TRACER
void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data)
{
struct sched_entity *se;
struct task_struct *p;
struct rb_node *curr;
struct rq *rq = __rq;
curr = first_fair(&rq->cfs);
if (!curr)
return;
while (curr) {
se = rb_entry(curr, struct sched_entity, run_node);
if (!entity_is_task(se))
continue;
p = task_of(se);
__trace_special(__tr, __data,
p->pid, p->se.vruntime, p->se.sum_exec_runtime);
curr = rb_next(curr);
}
}
#endif
/***
* try_to_wake_up - wake up a thread
* @p: the to-be-woken-up thread
@ -2468,7 +2497,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
out_activate:
#endif /* CONFIG_SMP */
ftrace_wake_up_task(p, rq->curr);
ftrace_wake_up_task(rq, p, rq->curr);
schedstat_inc(p, se.nr_wakeups);
if (sync)
schedstat_inc(p, se.nr_wakeups_sync);
@ -2613,7 +2642,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
p->sched_class->task_new(rq, p);
inc_nr_running(rq);
}
ftrace_wake_up_task(p, rq->curr);
ftrace_wake_up_task(rq, p, rq->curr);
check_preempt_curr(rq, p);
#ifdef CONFIG_SMP
if (p->sched_class->task_wake_up)
@ -2786,7 +2815,7 @@ context_switch(struct rq *rq, struct task_struct *prev,
struct mm_struct *mm, *oldmm;
prepare_task_switch(rq, prev, next);
ftrace_ctx_switch(prev, next);
ftrace_ctx_switch(rq, prev, next);
mm = next->mm;
oldmm = prev->active_mm;
/*