Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jun 2006 21:25:59 +0000
From:      John Birrell <jb@what-creek.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        perforce@freebsd.org
Subject:   Re: PERFORCE change 99099 for review
Message-ID:  <20060615212558.GA37961@what-creek.com>
In-Reply-To: <200606151433.24652.jhb@freebsd.org>
References:  <200606130047.k5D0liTa052536@repoman.freebsd.org> <200606130930.46610.jhb@freebsd.org> <20060614205205.GA86553@what-creek.com> <200606151433.24652.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 15, 2006 at 02:33:24PM -0400, John Baldwin wrote:
> On Wednesday 14 June 2006 16:52, John Birrell wrote:
> > On Tue, Jun 13, 2006 at 09:30:46AM -0400, John Baldwin wrote:
> > > On Monday 12 June 2006 20:47, John Birrell wrote:
> > > > http://perforce.freebsd.org/chv.cgi?CH=99099
> > > > 
> > > > Change 99099 by jb@jb_freebsd2 on 2006/06/13 00:47:28
> > > > 
> > > > 	Add hooks for DTrace to register a function to be called when
> > > > 	the scheduler chooses a new thread to run. This is required for
> > > > 	DTrace vtime.
> > > 
> > > You should probably do this in mi_switch() in kern_synch.c rather than
> > > in this macro.
> > 
> > Looking further at this is seems that the code actually has to be
> > inserted into each scheduler just before the call to cpu_switch because
> > the schedulers are each capable of selecting a new thread right up
> > to that time (see sched_switch).
> 
> Ah, yes, I didn't realize at first you needed to know what the new thread is.

What DTrace is doing is recording a timestamp when the thread starts
running so that it knows the elapsed run-time of the thread. This is used
with the timestamp action so that you can calculate in nanoseconds how long
something took.

--
John Birrell



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060615212558.GA37961>