[Git][cmucl/cmucl][master] 2 commits: Replace unix-times usage with getrusage

Raymond Toy rtoy at common-lisp.net
Thu Dec 8 03:34:16 UTC 2016


Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
29cb2f47 by Raymond Toy at 2016-12-06T21:07:21-08:00
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.

- - - - -
f10c6b6f by Raymond Toy at 2016-12-08T03:34:12+00:00
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
- - - - -


3 changed files:

- src/code/sunos-os.lisp
- src/code/time.lisp
- − src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp


Changes:

=====================================
src/code/sunos-os.lisp
=====================================
--- a/src/code/sunos-os.lisp
+++ b/src/code/sunos-os.lisp
@@ -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.


=====================================
src/code/time.lisp
=====================================
--- a/src/code/time.lisp
+++ b/src/code/time.lisp
@@ -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.
 


=====================================
src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp deleted
=====================================
--- a/src/tools/cross-scripts/cross-x86-sparc-bootstrap.lisp
+++ /dev/null
@@ -1,4 +0,0 @@
-;; 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



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/18dc7c123174d9f30fd34314708bfa21085ff3dd...f10c6b6fbb035c89f37610fa30fc429ab857d5fc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20161208/4cc59e30/attachment-0001.html>


More information about the cmucl-cvs mailing list