Skip to content
Snippets Groups Projects
Commit f10c6b6f authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'rtoy-no-unix-times' into 'master'

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
parents 18dc7c12 29cb2f47
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
;;; ;;;
;;; Return system time, user time and number of page faults. ;;; Return system time, user time and number of page faults.
;;; ;;;
#-(and sparc svr4)
(defun get-system-info () (defun get-system-info ()
(multiple-value-bind (multiple-value-bind
(err? utime stime maxrss ixrss idrss isrss minflt majflt) (err? utime stime maxrss ixrss idrss isrss minflt majflt)
...@@ -70,19 +69,6 @@ ...@@ -70,19 +69,6 @@
(T (T
(values utime stime majflt))))) (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 ;;; GET-PAGE-SIZE -- Interface
;;; ;;;
;;; Return the system page size. ;;; Return the system page size.
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
;;; Get-Internal-Run-Time -- Public ;;; Get-Internal-Run-Time -- Public
;;; ;;;
#-(and sparc svr4)
(defun get-internal-run-time () (defun get-internal-run-time ()
_N"Return the run time in the internal time format. This is useful for _N"Return the run time in the internal time format. This is useful for
finding CPU usage." finding CPU usage."
...@@ -81,20 +80,6 @@ ...@@ -81,20 +80,6 @@
(truncate (+ utime-usec stime-usec) (truncate (+ utime-usec stime-usec)
micro-seconds-per-internal-time-unit))))) 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. ;;;; 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment