[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly 6785833 37/47: clasp: implement profiling via met
From: |
ELPA Syncer |
Subject: |
[nongnu] externals/sly 6785833 37/47: clasp: implement profiling via metering |
Date: |
Thu, 17 Dec 2020 18:57:20 -0500 (EST) |
branch: externals/sly
commit 678583314f94fcb450c751c2caf8e59dd4152b5c
Author: Karsten Poeck <karsten.poeck@icloud.com>
Commit: João Távora <joaotavora@gmail.com>
clasp: implement profiling via metering
* slynk/backend/clasp.lisp: Use monitor.
* slynk/metering.lisp: Define Clasp on a bunch of things.
Cherry-picked-from: SLIME commit d7b27f75d172c34c8e2ad78bae1d7953f536040b
Co-authored-by: João Távora <joaotavora@gmail.com>
---
slynk/backend/clasp.lisp | 28 ++++++++++++----------------
slynk/metering.lisp | 32 +++++++++++++++++++++++++++-----
2 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/slynk/backend/clasp.lisp b/slynk/backend/clasp.lisp
index 415f830..c5d2c9d 100644
--- a/slynk/backend/clasp.lisp
+++ b/slynk/backend/clasp.lisp
@@ -542,33 +542,29 @@
;;;; Profiling
-#+profile
-(progn
+;;;; as clisp and ccl
(defimplementation profile (fname)
- (when fname (eval `(profile:profile ,fname))))
+ (eval `(slynk-monitor:monitor ,fname))) ;monitor is a macro
+
+(defimplementation profiled-functions ()
+ slynk-monitor:*monitored-functions*)
(defimplementation unprofile (fname)
- (when fname (eval `(profile:unprofile ,fname))))
+ (eval `(slynk-monitor:unmonitor ,fname))) ;unmonitor is a macro
(defimplementation unprofile-all ()
- (profile:unprofile-all)
- "All functions unprofiled.")
+ (slynk-monitor:unmonitor))
(defimplementation profile-report ()
- (profile:report))
+ (slynk-monitor:report-monitoring))
(defimplementation profile-reset ()
- (profile:reset)
- "Reset profiling counters.")
-
-(defimplementation profiled-functions ()
- (profile:profile))
+ (slynk-monitor:reset-all-monitoring))
-(defimplementation profile-package (package callers methods)
- (declare (ignore callers methods))
- (eval `(profile:profile ,(package-name (find-package package)))))
-) ; #+profile (progn ...
+(defimplementation profile-package (package callers-p methods)
+ (declare (ignore callers-p methods))
+ (slynk-monitor:monitor-all package))
;;;; Threads
diff --git a/slynk/metering.lisp b/slynk/metering.lisp
index d5eab93..7226b09 100644
--- a/slynk/metering.lisp
+++ b/slynk/metering.lisp
@@ -351,7 +351,7 @@ Estimated total monitoring overhead: 0.88 seconds
;;; Warn people using the wrong Lisp
;;; ********************************
-#-(or clisp openmcl)
+#-(or clisp openmcl clasp)
(warn "metering.lisp does not support your Lisp implementation!")
;;; ********************************
@@ -395,14 +395,14 @@ Estimated total monitoring overhead: 0.88 seconds
;;; the beginning of time. time-units-per-second allows us to convert units
;;; to seconds.
-#-(or clisp openmcl)
+#-(or clasp clisp openmcl)
(eval-when (compile eval)
(warn
"You may want to supply implementation-specific get-time functions."))
(defconstant time-units-per-second internal-time-units-per-second)
-#+openmcl
+#+(or clasp openmcl)
(progn
(deftype time-type () 'unsigned-byte)
(deftype consing-type () 'unsigned-byte))
@@ -449,7 +449,11 @@ Estimated total monitoring overhead: 0.88 seconds
#+openmcl
(defmacro get-cons () `(the consing-type (ccl::total-bytes-allocated)))
-#-(or clisp openmcl)
+#+clasp
+(defmacro get-cons ()
+ `(the consing-type (gctools::bytes-allocated)))
+
+#-(or clasp clisp openmcl)
(progn
(eval-when (compile eval)
(warn "No consing will be reported unless a get-cons function is ~
@@ -550,7 +554,25 @@ Estimated total monitoring overhead: 0.88 seconds
(values req-num (or (/= 0 opt-num) rest-p key-p keywords allow-p))
(values 0 t))))
-#-(or clisp openmcl)
+#+clasp
+(defun required-arguments (name)
+ (multiple-value-bind (arglist foundp)
+ (core:function-lambda-list name)
+ (if foundp
+ (let ((position-and
+ (position-if #'(lambda (x)
+ (and (symbolp x)
+ (let ((name (symbol-name x)))
+ (and (>= (length name) 1)
+ (char= (schar name 0)
+ #\&)))))
+ arglist)))
+ (if position-and
+ (values position-and t)
+ (values (length arglist) nil)))
+ (values 0 t))))
+
+#-(or clasp clisp openmcl)
(progn
(eval-when (compile eval)
(warn
- [nongnu] externals/sly c41b298 36/47: clasp.lisp changes to use new clasp-debug pkg, (continued)
- [nongnu] externals/sly c41b298 36/47: clasp.lisp changes to use new clasp-debug pkg, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly d8c926f 42/47: sbcl: account for SB-DI::DEBUG-FUN-DEBUG-VARS returning NIL, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 7c7f23b 46/47: Default *STRING-ELISION-LEGNTH* to 200 in *SLYNK-PPRINT-BINDINGS*, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 7bad394 09/47: Improve compiler messages for Clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly c4c7ae5 13/47: slynk-abcl: fix typo, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly c794fe6 30/47: Remove recursive locks for clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 57ffb2a 33/47: sbcl: fix access to &more vars in the debugger, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly dcfe556 02/47: Fixed sldb and backtraces in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1dbf876 04/47: ecl: frame-source-location: return error if frame source not found, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly cd85cf6 35/47: Improve xref definitions for M-. in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 6785833 37/47: clasp: implement profiling via metering,
ELPA Syncer <=
- [nongnu] externals/sly 1346967 38/47: Remove use of compatibility accessors, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e914200 07/47: wait-for-input: better "not implemented" error., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e883812 11/47: Fix SLYNK-SBCL:COMPILER-NOTE-LOCATION for non-file-backed streams, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 425146d 31/47: Print more code-source-location info for clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1188cfc 34/47: Ignore utf-8 encoding errors, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 4717cb9 44/47: Tolerate leading whitespace in slime-search-buffer-package, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 00cbab0 01/47: Slynk: avoid race conditions when killing threads, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 47e8d27 05/47: add architecture :aarch64 (for ECL), ELPA Syncer, 2020/12/17
- [nongnu] externals/sly f7c6048 08/47: arglist-dispatch: better handling of closer-mop wrappers., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly bf157ae 10/47: Changed the name of a function in Clasp, ELPA Syncer, 2020/12/17