[Openmcl-devel] #_clock_get_time on Darwin returning bogus values

Hans Hübner hans at huebner.org
Thu Dec 4 08:21:24 UTC 2008


Hi,

I'm trying to fix the problem in the deterministic profiler on Darwin.
 The problem seems to be that the clock reading function does not
work.  I am using Mach timers in the profiler, and I think I'm reading
them correctly, but the values returned do not make sense:

PROF> (let ((clock-port (make-record :clock_serv_t)))
        (#_host_get_clock_service (#_mach_host_self) #$REALTIME_CLOCK
clock-port)
        (defun read-clock-seconds ()
          (ccl:rlet ((ts :mach_timespec_t))
            (#_clock_get_time (%get-ptr clock-port) ts)
            (pref ts :timespec.tv_sec))))
READ-CLOCK-SECONDS
PROF> (read-clock-seconds)
990852764823254945
PROF> (read-clock-seconds)
957862257734252450
PROF> (read-clock-seconds)
4146603814037813155
PROF> (lisp-implementation-version)
"Version 1.3-dev-r11396M-trunk  (DarwinX8664)"

I would expect the value to be increasing (and it used to work with
previous releases).  Maybe something with the header generation went
wrong?

Thanks,
Hans



More information about the Openmcl-devel mailing list