Skip to content
Commits on Source (2)
  • Raymond Toy's avatar
    Replace unix-times usage with getrusage · 29cb2f47
    Raymond Toy authored
    unix:unix-times was only used for #+(and sparc svr4).  The existing
    code already supported a different function when this condition was
    false, so use that, which uses getrusage instead.
    
    Don't need cross-x86-sparc-bootstrap.lisp anymore either.
    29cb2f47
  • Raymond Toy's avatar
    Merge branch 'rtoy-no-unix-times' into 'master' · f10c6b6f
    Raymond Toy authored
    Fix #38: Replace unix-times usage with getrusage
    
    unix:unix-times was only used for #+(and sparc svr4).  The existing
    code already supported a different function when this condition was
    false, so use that, which uses getrusage instead.
    
    Don't need cross-x86-sparc-bootstrap.lisp anymore either.
    
    See merge request !18
    f10c6b6f
......@@ -58,7 +58,6 @@
;;;
;;; Return system time, user time and number of page faults.
;;;
#-(and sparc svr4)
(defun get-system-info ()
(multiple-value-bind
(err? utime stime maxrss ixrss idrss isrss minflt majflt)
......@@ -70,19 +69,6 @@
(T
(values utime stime majflt)))))
;;; GET-SYSTEM-INFO -- Interface
;;;
;;; Return system time, user time and number of page faults.
;;;
#+(and sparc svr4)
(defun get-system-info ()
(multiple-value-bind
(err? utime stime cutime cstime)
(unix:unix-times)
(declare (ignore err? cutime cstime))
;; Return times in microseconds; page fault statistics not supported.
(values (* utime 10000) (* stime 10000) 0)))
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
......
......@@ -64,7 +64,6 @@
;;; Get-Internal-Run-Time -- Public
;;;
#-(and sparc svr4)
(defun get-internal-run-time ()
_N"Return the run time in the internal time format. This is useful for
finding CPU usage."
......@@ -81,20 +80,6 @@
(truncate (+ utime-usec stime-usec)
micro-seconds-per-internal-time-unit)))))
;;; Get-Internal-Run-Time -- Public
;;;
#+(and sparc svr4)
(defun get-internal-run-time ()
_N"Return the run time in the internal time format. This is useful for
finding CPU usage."
(declare (values (unsigned-byte 32)))
(locally (declare (optimize (speed 3) (safety 0)))
(multiple-value-bind (ignore utime stime cutime cstime)
(unix:unix-times)
(declare (ignore ignore cutime cstime)
(type (unsigned-byte 31) utime stime))
(the (unsigned-byte 32) (+ utime stime)))))
;;;; Encode and Decode universal times.
......
;; Cross bootstrap file for cross-compiling from x86 to sparc.
;; Use this file with the -B option for bin/cross-build-world.sh
(export 'unix::unix-times "UNIX")
\ No newline at end of file