ia64 clock_gettime and HP_TIMING

Jes Sorensen jes@wildopensource.com
Thu Dec 11 10:50:00 GMT 2003


>>>>> "Ulrich" == Ulrich Drepper <drepper@redhat.com> writes:

Ulrich> All the machines I have looked at (mostly tigers) have "0" in
Ulrich> /proc/sal/itc_drift.  I.e., the machines wouldn't use the itc
Ulrich> which cannot be correct since they all use it now without
Ulrich> problems.

I just reread the code a couple of times and I think it's correct. The
machines that have the problem will have 1 in /proc/sal/itc_drift,
tigers don't drift so they return 0.

+		if (buf[0] != '0')
+		  __itc_drift_internal = 1;
+		else
+		  __itc_drift_internal = -1;

If the buffer is '1' __itc_drift_internal is set to 1, other values
will make it -1, ie. for the Tiger. Then further down where it checks
the value:

+    if (__itc_drift_internal != 1)
+      {
+	/* Store the number.  */
+	*clock_id = CLOCK_PROCESS_CPUTIME_ID;
+	retval = 0;
+      }

Ie. if its_drift_internal == -1 it will return
CLOCK_PROCESS_CPUTIME_ID and work as expected.

I might be confused so feel free to correct me if I misread it again.

Cheers,
Jes



More information about the Libc-hacker mailing list