[ltt-dev] [patch] add tracepoints to trace activate/deactivate task
Peter Zijlstra
peterz at infradead.org
Wed Dec 10 08:14:32 EST 2008
On Wed, 2008-12-10 at 07:34 -0500, Mathieu Desnoyers wrote:
> > include/trace/sched.h | 4 ++--
> > kernel/sched.c | 3 ++-
> > 2 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/trace/sched.h b/include/trace/sched.h
> > index 9b2854a..f4549d5 100644
> > --- a/include/trace/sched.h
> > +++ b/include/trace/sched.h
> > @@ -30,8 +30,8 @@ DECLARE_TRACE(sched_switch,
> > TPARGS(rq, prev, next));
> >
> > DECLARE_TRACE(sched_migrate_task,
> > - TPPROTO(struct rq *rq, struct task_struct *p, int dest_cpu),
> > - TPARGS(rq, p, dest_cpu));
> > + TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
> > + TPARGS(p, orig_cpu, dest_cpu));
> >
> > DECLARE_TRACE(sched_process_free,
> > TPPROTO(struct task_struct *p),
> > diff --git a/kernel/sched.c b/kernel/sched.c
> > index 0eff15b..3dc54cd 100644
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -1861,6 +1861,8 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
> >
> > clock_offset = old_rq->clock - new_rq->clock;
> >
> > + trace_sched_migrate_task(p, task_cpu(p), new_cpu);
>
> Hrm, looking at it, I think that :
>
> - task_cpu(p) will add some code output outside of the conditional
> branch, which I think we would like to avoid.
> - We can easily get the "from" cpu within the tracepoint probe.
> Therefore, I don't see why we would extract this information
> explicitly ?
Right, just nuke it - thanks!
More information about the lttng-dev
mailing list