Raymond Toy pushed to branch issue-180-get-page-size-in-c at cmucl / cmucl
Commits:
6fc4c2a1 by Raymond Toy at 2023-04-19T10:05:41-07:00
Update pot files
- - - - -
3 changed files:
- src/i18n/locale/cmucl-linux-os.pot
- src/i18n/locale/cmucl-unix.pot
- src/i18n/locale/cmucl.pot
Changes:
=====================================
src/i18n/locale/cmucl-linux-os.pot
=====================================
@@ -16,11 +16,15 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: src/code/linux-os.lisp
-msgid "Returns a string describing version of the supporting software."
+msgid "Getpagesize failed: ~A"
msgstr ""
-#: src/code/linux-os.lisp
-msgid "Unix system call getrusage failed: ~A."
+#: src/code/os.lisp
+msgid "Return the system page size"
+msgstr ""
+
+#: src/code/os.lisp
+msgid "get-page-size failed: ~A"
msgstr ""
#: src/code/signal.lisp
=====================================
src/i18n/locale/cmucl-unix.pot
=====================================
@@ -1445,6 +1445,12 @@ msgid "Get the codeset from the locale"
msgstr ""
#: src/code/unix.lisp
-msgid "get-page-size failed: ~A"
+msgid ""
+"Get system information consisting of the user time (in usec), the\n"
+" system time (in usec) and the number of major page faults."
+msgstr ""
+
+#: src/code/unix.lisp
+msgid "Unix system call getrusage failed: ~A."
msgstr ""
=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -5646,6 +5646,14 @@ msgstr ""
msgid "Returns a string describing the supporting software."
msgstr ""
+#: src/code/misc.lisp
+msgid "Version string for supporting software"
+msgstr ""
+
+#: src/code/misc.lisp
+msgid "Returns a string describing version of the supporting software."
+msgstr ""
+
#: src/code/misc.lisp
msgid "The value of SHORT-SITE-NAME. Set in library:site-init.lisp."
msgstr ""
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6fc4c2a1c1645c04661b21c…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6fc4c2a1c1645c04661b21c…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-180-get-page-size-in-c at cmucl / cmucl
Commits:
02884455 by Raymond Toy at 2023-04-19T09:57:08-07:00
Fix typo in comment
- - - - -
1 changed file:
- src/code/os.lisp
Changes:
=====================================
src/code/os.lisp
=====================================
@@ -1,8 +1,8 @@
;;; -*- Package: SYSTEM -*-
;;;
;;; **********************************************************************
-;;; This code was written as part of the CMU Common Lisp project at
-;;; and has been placed in the public domain.
+;;; This code was written as part of the CMU Common Lisp project and
+;;; has been placed in the public domain.
;;;
(ext:file-comment
"$Header: src/code/os.lisp $")
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/0288445524ea7ded798be22…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/0288445524ea7ded798be22…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
38daa5e2 by Raymond Toy at 2023-04-19T15:13:28+00:00
Add missing colon after "Version"
- - - - -
de972bb3 by Raymond Toy at 2023-04-19T15:32:14+00:00
Merge branch 'rtoy-master-patch-80206' into 'master'
Add missing colon after "Version"
See merge request cmucl/cmucl!140
- - - - -
1 changed file:
- .gitlab/issue_templates/Bug.md
Changes:
=====================================
.gitlab/issue_templates/Bug.md
=====================================
@@ -16,7 +16,7 @@ If applicable, add screenshots to help explain your problem.
## Desktop (please complete the following information):
- OS: [e.g. Linux]
- - Version [e.g. 21c]
+ - Version: [e.g. 21c]
## Additional context
Add any other context about the problem here.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/2556df76cb546b458f21fa…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/2556df76cb546b458f21fa…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
2556df76 by Raymond Toy at 2023-04-19T07:38:34-07:00
Update pot files
Forgot to update these in the merges, so let's do them all now.
- - - - -
2 changed files:
- src/i18n/locale/cmucl-linux-os.pot
- src/i18n/locale/cmucl-unix.pot
Changes:
=====================================
src/i18n/locale/cmucl-linux-os.pot
=====================================
@@ -15,10 +15,6 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/code/linux-os.lisp
-msgid "Unix system call getrusage failed: ~A."
-msgstr ""
-
#: src/code/linux-os.lisp
msgid "Getpagesize failed: ~A"
msgstr ""
=====================================
src/i18n/locale/cmucl-unix.pot
=====================================
@@ -1448,3 +1448,13 @@ msgstr ""
msgid "Get the codeset from the locale"
msgstr ""
+#: src/code/unix.lisp
+msgid ""
+"Get system information consisting of the user time (in usec), the\n"
+" system time (in usec) and the number of major page faults."
+msgstr ""
+
+#: src/code/unix.lisp
+msgid "Unix system call getrusage failed: ~A."
+msgstr ""
+
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2556df76cb546b458f21fa2…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/2556df76cb546b458f21fa2…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-120-software-type-in-c at cmucl / cmucl
Commits:
550b8762 by Raymond Toy at 2023-04-19T06:54:41-07:00
Address review comments
Remove the decache comment in `os-init` in bsd-os.lisp and
linux-os.lisp.
- - - - -
2 changed files:
- src/code/bsd-os.lisp
- src/code/linux-os.lisp
Changes:
=====================================
src/code/bsd-os.lisp
=====================================
@@ -54,7 +54,6 @@
;;; that set up the argument blocks for the server interfaces.
(defun os-init ()
- ;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
;;; GET-PAGE-SIZE -- Interface
=====================================
src/code/linux-os.lisp
=====================================
@@ -31,7 +31,6 @@
;;; OS-Init initializes our operating-system interface.
;;;
(defun os-init ()
- ;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/550b876213f2ab6aded82ab…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/550b876213f2ab6aded82ab…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-120-software-type-in-c at cmucl / cmucl
Commits:
72cdab53 by Raymond Toy at 2023-03-29T11:33:08-07:00
Fix warning about lack of prototype in os_get_locale_codeset.
Clang produces a warning for `char * os_get_locale_codeset()` because
we don't give a prototype for the arg of `os_get_locale_codeset`. So
just make it `void`.
- - - - -
bbfff3c0 by Raymond Toy at 2023-04-10T15:11:59+00:00
Fix #170: Move get-system-info to C
- - - - -
5196072a by Raymond Toy at 2023-04-10T15:12:01+00:00
Merge branch 'issue-179-get-system-info-in-c' into 'master'
Fix #170: Move get-system-info to C
Closes #170
See merge request cmucl/cmucl!137
- - - - -
b2aee0f7 by Raymond Toy at 2023-04-17T08:14:29-07:00
Update cmucl.pot with latest source
Some docstrings have changed, so update cmucl.pot
- - - - -
3da41d71 by Raymond Toy at 2023-04-17T08:18:04-07:00
Merge branch 'master' into issue-120-software-type-in-c
- - - - -
9360c95c by Raymond Toy at 2023-04-17T08:21:11-07:00
Add comment for os_software_version.
- - - - -
8 changed files:
- src/code/bsd-os.lisp
- src/code/hpux-os.lisp
- src/code/irix-os.lisp
- src/code/linux-os.lisp
- src/code/osf1-os.lisp
- src/code/sunos-os.lisp
- src/code/unix.lisp
- src/lisp/os-common.c
Changes:
=====================================
src/code/bsd-os.lisp
=====================================
@@ -57,22 +57,6 @@
;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind (err? utime stime maxrss ixrss idrss
- isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (unless err?
- (error (intl:gettext "Unix system call getrusage failed: ~A.")
- (unix:get-unix-error-msg utime)))
-
- (values utime stime majflt)))
-
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/hpux-os.lisp
=====================================
@@ -46,22 +46,6 @@
;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind
- (err? utime stime maxrss ixrss idrss isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (cond ((null err?)
- (error "Unix system call getrusage failed: ~A."
- (unix:get-unix-error-msg utime)))
- (T
- (values utime stime majflt)))))
-
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/irix-os.lisp
=====================================
@@ -48,22 +48,6 @@
;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind
- (err? utime stime maxrss ixrss idrss isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (cond ((null err?)
- (error "Unix system call getrusage failed: ~A."
- (unix:get-unix-error-msg utime)))
- (T
- (values utime stime majflt)))))
-
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/linux-os.lisp
=====================================
@@ -35,22 +35,6 @@
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind (err? utime stime maxrss ixrss idrss
- isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (unless err?
- (error (intl:gettext "Unix system call getrusage failed: ~A.")
- (unix:get-unix-error-msg utime)))
-
- (values utime stime majflt)))
-
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/osf1-os.lisp
=====================================
@@ -47,23 +47,6 @@
(defun os-init ()
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults. For
-;;; page-faults, we add pagein and pageout, since that is a somewhat more
-;;; interesting number than the total faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind (err? utime stime maxrss ixrss idrss
- isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (unless err?
- (error "Unix system call getrusage failed: ~A."
- (unix:get-unix-error-msg utime)))
- (values utime stime majflt)))
-
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/sunos-os.lisp
=====================================
@@ -41,21 +41,6 @@
;; Decache version on save, because it might not be the same when we restart.
(setf *software-version* nil))
-;;; GET-SYSTEM-INFO -- Interface
-;;;
-;;; Return system time, user time and number of page faults.
-;;;
-(defun get-system-info ()
- (multiple-value-bind
- (err? utime stime maxrss ixrss idrss isrss minflt majflt)
- (unix:unix-getrusage unix:rusage_self)
- (declare (ignore maxrss ixrss idrss isrss minflt))
- (cond ((null err?)
- (error (intl:gettext "Unix system call getrusage failed: ~A.")
- (unix:get-unix-error-msg utime)))
- (T
- (values utime stime majflt)))))
-
;;; GET-PAGE-SIZE -- Interface
;;;
;;; Return the system page size.
=====================================
src/code/unix.lisp
=====================================
@@ -2927,3 +2927,28 @@
(extern-alien "os_get_locale_codeset"
(function (* char))))
c-string))
+
+;;; GET-SYSTEM-INFO -- Interface
+;;;
+;;; Return system time, user time (in usec) and number of page
+;;; faults.
+;;;
+(defun get-system-info ()
+ "Get system information consisting of the user time (in usec), the
+ system time (in usec) and the number of major page faults."
+ (with-alien ((utime int64-t 0)
+ (stime int64-t 0)
+ (major-fault c-call:long 0))
+ (let ((rc (alien-funcall
+ (extern-alien "os_get_system_info"
+ (function c-call:int
+ (* int64-t)
+ (* int64-t)
+ (* c-call:long)))
+ (addr utime)
+ (addr stime)
+ (addr major-fault))))
+ (when (minusp rc)
+ (error (intl:gettext "Unix system call getrusage failed: ~A.")
+ (unix:get-unix-error-msg utime)))
+ (values utime stime major-fault))))
=====================================
src/lisp/os-common.c
=====================================
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <unistd.h>
@@ -800,11 +801,41 @@ os_get_lc_messages(char *buf, int len)
}
char *
-os_get_locale_codeset()
+os_get_locale_codeset(void)
{
return nl_langinfo(CODESET);
}
+/*
+ * Get system info consisting of the utime (in usec), the stime (in
+ * usec) and the number of major page faults. The return value is the
+ * return code from getrusage.
+ */
+int
+os_get_system_info(int64_t* utime, int64_t* stime, long* major_fault)
+{
+ struct rusage usage;
+ int rc;
+
+ *utime = 0;
+ *stime = 0;
+ *major_fault = 0;
+
+ rc = getrusage(RUSAGE_SELF, &usage);
+ if (rc == 0) {
+ *utime = usage.ru_utime.tv_sec * 1000000 + usage.ru_utime.tv_usec;
+ *stime = usage.ru_stime.tv_sec * 1000000 + usage.ru_stime.tv_usec;
+ *major_fault = usage.ru_majflt;
+ }
+
+ return rc;
+}
+
+/*
+ * Get the software version. This is the same as "uname -r", the release.
+ * A pointer to a static string is returned. If uname fails, an empty
+ * string is returned.
+ */
char*
os_software_version(void)
{
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9d629ff45cb7439b9434b9…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9d629ff45cb7439b9434b9…
You're receiving this email because of your account on gitlab.common-lisp.net.