This is the mail archive of the
mailing list for the glibc project.
Re: [patch] hp-timing for powerpc64
Ulrich Drepper writes:
> > Do we use rdtsc on x86 machines? If not rdtsc, what do we use?
> Yes, we do, but at least it means that each unit is one cycle of t he
> CPU which then can be translated into seconds. From what I know this
> isn't the case with mftb, where different implementations increment the
> counter differently.
I'm not sure what you mean by "differently". All implementations
increment the timebase register (which is what mftb reads) at a
constant frequency. In fact the timebase should be easier to use than
rdtsc since the timebase frequency doesn't change, even if the cpu
frequency changes, and the timebase registers on all cpus in an SMP
system are synchronized. The timebase frequency is available in
/proc/cpuinfo (in Hz). We could easily make it available through the
VDSO as well if that would help.