Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2006 20:39:16 +0100
From:      David Malone <dwmalone@maths.tcd.ie>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, "Christian S.J. Peron" <csjp@FreeBSD.org>, cvs-all@FreeBSD.org, phk@FreeBSD.org, Sam Leffler <sam@errno.com>
Subject:   Re: cvs commit: src/sys/net bpf.c 
Message-ID:  <200607252039.aa40648@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Tue, 25 Jul 2006 15:25:10 EDT." <200607251525.11623.jkim@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > It sounds to me like a reasonable thing to do would be to pass up
> > a raw version of the timestamp (as returned by the hardware). We'd
> > also pass up the regular microtime() timestamp. You can then do any
> > postprocessing to syncronise timestamps later in userland?

> Nope.  In that case, you actually need to export few more things, 
> i.e., current hardware timecounter value, clock frequency, size of 
> the timecounter, etc.  Even then, it's going to be hard to get 
> correct timeval without exposing few kernel internals.

I guess it depends a bit on your requirements. If you have a sequence
of packets and are interested in getting accurate inter-arrival times,
then (providing that the counter doesn't wrap too often and the
frequency is relatively constant) the hardware counter values and
system timestamps of the first and last packets should be enough
to get quite close to what you want.

(This might even produce better estimates of inter-rival times than
also using the intermediate timestamps, as NTP slewing the clock
can make it hard to get consistent readings. Hence people doing
stuff like this http://www.imconf.net/imc-2004/papers/p219-veitch.pdf)

You're right though - that's not sufficient for everyone.

	David.



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