cvs commit: src/sys/net bpf.c

David Malone dwmalone at maths.tcd.ie
Tue Jul 25 19:39:26 UTC 2006


> > 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.


More information about the cvs-src mailing list