Messages in this thread | | | Date | Wed, 11 Jun 2008 15:39:24 -0600 | From | "Chris Friesen" <> | Subject | Re: PROBLEM: no cpu MHz in /proc/cpuinfo on 2.6.25.4-rt6 |
| |
Mark Hounschell wrote:
> If they are not the same how do you know at what rate the tsc is counting.
You don't, at least not easily. The timekeeping subsystem knows, but it might be unstable, or change with cpu frequency or cpu going idle, etc.
> But back to "how usable is rdtsc for time", is there a > > clock_gettime(CLOCK_MONOTONIC, &time) equivalent that can be used in the kernel?
With current kernels it looks like ktime_get_ts() should give exactly the same results, since it's how that userspace function is implemented. With a stable tsc it seems like it should give full accuracy.
Chris
| |