diff --git a/code/time.lisp b/code/time.lisp index 2a4cac535e19485e406fd2efc4c4e15875f52e6a..446fa77ca342076d9bca6c85566ff9d8d7a1bbb4 100644 --- a/code/time.lisp +++ b/code/time.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/time.lisp,v 1.26 2004/10/09 01:08:11 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/time.lisp,v 1.27 2004/10/09 02:47:44 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -369,7 +369,7 @@ ~S second~:P of real time~% ~ ~S second~:P of user run time~% ~ ~S second~:P of system run time~% ~ - ~:D CPU cycles~% ~ + ~:D ~A cycles~% ~ ~@[[Run times include ~S second~:P GC run time]~% ~]~ ~S page fault~:P and~% ~ ~:D bytes consed.~%" @@ -379,6 +379,9 @@ (max (/ (- new-run-utime old-run-utime) 1000000.0) 0.0) (max (/ (- new-run-stime old-run-stime) 1000000.0) 0.0) (truncate cycle-count) + ;; The counter for PPC isn't the number of CPU + ;; cycles, unlike x86 and Ultrasparc. + #+ppc "time-base" #-ppc "CPU" (unless (zerop gc-run-time) (/ (float gc-run-time) (float internal-time-units-per-second))) diff --git a/compiler/ppc/system.lisp b/compiler/ppc/system.lisp index 75d0e5808ddfcc2696e73d606449cbf339857f8a..6f8e4305762f76b4eaa415342f4a9e4029f1763e 100644 --- a/compiler/ppc/system.lisp +++ b/compiler/ppc/system.lisp @@ -7,7 +7,7 @@ ;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/system.lisp,v 1.2 2004/10/09 01:08:11 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/system.lisp,v 1.3 2004/10/09 02:47:45 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -274,16 +274,4 @@ (move lo temp-lo)))) (defun read-cycle-counter () - (multiple-value-bind (lo hi) - (read-time-base) - ;; Based on some simple tests by reading the time-base, sleeping - ;; for 1 sec, and reading the time-base again, it seems that on an - ;; iMac G3/400 MHz, the time base value is incremented once for - ;; each clock cycle. Is that true for other iMacs? I hope so. - ;; - ;; So, left shift the time-base value by 4 to figure out how many - ;; cycles have elapsed. - (let ((overflow (ldb (byte 4 28) lo))) - (values (ldb (byte 32 0) (ash lo 4)) - (ldb (byte 32 0) (+ overflow - (ash hi 4))))))) + (read-time-base)) \ No newline at end of file