From: Ingo Molnar Date: Mon, 12 May 2008 19:20:52 +0000 (+0200) Subject: ftrace: trace curr/next tasks X-Git-Tag: v2.6.27-rc1~1102^2^2~1^2~89 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24cd5d111e8c713e62cda7ca1d01232402e3d3c9;p=linux-2.6 ftrace: trace curr/next tasks Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/kernel/sched.c b/kernel/sched.c index b9208a0e33..673b588b71 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2398,8 +2398,8 @@ static int sched_balance_self(int cpu, int flag) void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data) { - struct sched_entity *se; struct task_struct *p; + struct sched_entity *se; struct rb_node *curr; struct rq *rq = __rq; @@ -2407,6 +2407,17 @@ void ftrace_all_fair_tasks(void *__rq, void *__tr, void *__data) if (!curr) return; + if (rq->cfs.curr) { + p = task_of(rq->cfs.curr); + __trace_special(__tr, __data, + p->pid, p->se.vruntime, p->se.sum_exec_runtime); + } + if (rq->cfs.next) { + p = task_of(rq->cfs.next); + __trace_special(__tr, __data, + p->pid, p->se.vruntime, p->se.sum_exec_runtime); + } + while (curr) { se = rb_entry(curr, struct sched_entity, run_node); if (!entity_is_task(se))