From mboxrd@z Thu Jan 1 00:00:00 1970 From: peterz@infradead.org (Peter Zijlstra) Date: Wed, 10 Dec 2008 14:14:32 +0100 Subject: [ltt-dev] [patch] add tracepoints to trace activate/deactivate task In-Reply-To: <20081210123440.GD28524@Krystal> References: <20081208194948.GC27166@redhat.com> <1228766050.6939.7.camel@twins> <20081208223840.GA30314@redhat.com> <1228776169.12729.2.camel@twins> <20081209210048.GA4440@redhat.com> <20081209221012.GA4673@Krystal> <1228892902.6978.23.camel@twins> <20081210123440.GD28524@Krystal> Message-ID: <1228914872.12143.11.camel@twins> 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!