/[cmucl]/src/code/time.lisp
ViewVC logotype

Diff of /src/code/time.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by rtoy, Sat Oct 9 02:47:44 2004 UTC revision 1.27.2.2 by rtoy, Mon Dec 19 01:09:53 2005 UTC
# Line 281  Line 281 
281                         (system:get-system-info)                         (system:get-system-info)
282      (values user sys faults (get-bytes-consed))))      (values user sys faults (get-bytes-consed))))
283    
284  #+(or pentium sparc-v9 ppc)  #+(or pentium sparc-v9)
285  (defun cycle-count/float ()  (defun cycle-count/float ()
286    (multiple-value-bind (lo hi)    (multiple-value-bind (lo hi)
287        (vm::read-cycle-counter)        (vm::read-cycle-counter)
288      (+ (* hi (expt 2.0d0 32)) lo)))      (+ (* hi (expt 2.0d0 32)) lo)))
289    #+ppc
290    (progn
291    (alien:def-alien-variable cycles-per-tick c-call:int)
292    (defun cycle-count/float ()
293      (multiple-value-bind (lo hi)
294          (vm::read-cycle-counter)
295        ;; The cycle counter on PPC isn't really a cycle counter.  It
296        ;; counts ticks, so we need to convert ticks to cycles.
297        ;; CYCLES-PER-TICK is the scale factor, computed in C.
298        (* cycles-per-tick (+ (* hi (expt 2.0d0 32)) lo))))
299    )
300    
301  #-(or pentium sparc-v9 ppc)  #-(or pentium sparc-v9 ppc)
302  (defun cycle-count/float () 0.0)  (defun cycle-count/float () 0.0)
# Line 379  Line 390 
390                      (max (/ (- new-run-utime old-run-utime) 1000000.0) 0.0)                      (max (/ (- new-run-utime old-run-utime) 1000000.0) 0.0)
391                      (max (/ (- new-run-stime old-run-stime) 1000000.0) 0.0)                      (max (/ (- new-run-stime old-run-stime) 1000000.0) 0.0)
392                      (truncate cycle-count)                      (truncate cycle-count)
393                      ;; The counter for PPC isn't the number of CPU                      "CPU"
                     ;; cycles, unlike x86 and Ultrasparc.  
                     #+ppc "time-base" #-ppc "CPU"  
394                      (unless (zerop gc-run-time)                      (unless (zerop gc-run-time)
395                        (/ (float gc-run-time)                        (/ (float gc-run-time)
396                           (float internal-time-units-per-second)))                           (float internal-time-units-per-second)))

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.27.2.2

  ViewVC Help
Powered by ViewVC 1.1.5