Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2009 15:39:32 -0400
From:      David Schultz <das@FreeBSD.ORG>
To:        Andriy Gapon <avg@FreeBSD.ORG>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: dtrace users opinion solicited (timestamps)
Message-ID:  <20090709193932.GA54408@zim.MIT.EDU>
In-Reply-To: <4A562960.3010801@freebsd.org>
References:  <4A562960.3010801@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 09, 2009, Andriy Gapon wrote:
> 
> As you might be aware DTrace timestamps right now are derived from TSC value.
> http://en.wikipedia.org/wiki/Time_Stamp_Counter
> 
> DTrace timestamps are measured in nano-seconds and the formula similar to the
> following is used for calculations:
> rdtsc() * 1000000000 / tsc_freq
> where rdtsc is a function that returns current TSC value and tsc_freq is a
> frequency of TSC.
> 
> This formula is supposed to produce proper results if tsc_freq stays constant.
> But there are environment where this might not be the case.
> If a CPU has a non-invariant TSC and processor's clock frequency changes (e.g.
> because of powerd), then tsc_freq changes too.
> As a result, the formula would produce wildly different values and, most
> importantly, was values would non be monotonic. Timestamp values that jump back
> and forth would not only be useless for a user, they would also confuse DTrace
> internal logic.

Doesn't Solaris DTRT and compensate for TSC frequency changes?
Why can't we do the same thing?



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