public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Jason Baron <jbaron@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: sched: trace: update trace_sched_wakeup()
Date: Tue, 16 Dec 2008 12:01:24 -0500	[thread overview]
Message-ID: <20081216170124.GA9900@Krystal> (raw)
In-Reply-To: <1229444288.7025.35.camel@twins>

* Peter Zijlstra (peterz@infradead.org) wrote:
> On Tue, 2008-12-16 at 10:47 -0500, Mathieu Desnoyers wrote:
> > * Peter Zijlstra (peterz@infradead.org) wrote:
> > > On Tue, 2008-12-16 at 08:07 +0100, Peter Zijlstra wrote:
> > > > Add the information needed to distinguish 'real' wakeups from 'false'
> > > > wakeups.
> > > 
> > > I don't seem to be doing so well this morning...
> > > 
> > > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > > 
> > > Thanks Dhaval!
> > > 
> > 
> > Applied a modified version into the 2.6.27.9 LTTng tree. Thanks!
> > (remembering that I should really move to 2.6.28-rc!)
> 
> Ingo pointed out that this generates build crap in ftrace which made me
> look at the thing again, and I just realized we don't need it.
> 
> trace_sched_wakeup() gets called before we set p->state = TASK_RUNNING,
> so by checking p->state in the callback we can see if its a real of
> false wakeup.
> 
> The scheduler tracer in ftrace already exploits this.
> 

We do something similar in LTTng : we save the state along with the
event in the trace stream and let the userspace analyzer see what was
the state of the process prior to the wakeup.

Thanks,

Mathieu

> > > > --- a/kernel/sched.c
> > > > +++ b/kernel/sched.c
> > > > @@ -2329,7 +2329,7 @@ out_activate:
> > > >  	success = 1;
> > > >  
> > > >  out_running:
> > > > -	trace_sched_wakeup(rq, p);
> > > > +	trace_sched_wakeup(rq, p, success);
> > > >  	check_preempt_curr(rq, p, sync);
> > > >  
> > > >  	p->state = TASK_RUNNING;
> 
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

      reply	other threads:[~2008-12-16 17:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  7:07 sched: trace: update trace_sched_wakeup() Peter Zijlstra
2008-12-16  7:57 ` Peter Zijlstra
2008-12-16 11:06   ` Ingo Molnar
2008-12-16 15:47   ` Mathieu Desnoyers
2008-12-16 16:18     ` Peter Zijlstra
2008-12-16 17:01       ` Mathieu Desnoyers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081216170124.GA9900@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox