projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1.0.21.7: fix argument quoting in run-sbcl.sh
[sbcl.git]
/
src
/
code
/
profile.lisp
diff --git
a/src/code/profile.lisp
b/src/code/profile.lisp
index
e2f98f9
..
ddfd722
100644
(file)
--- a/
src/code/profile.lisp
+++ b/
src/code/profile.lisp
@@
-11,11
+11,6
@@
\f
;;;; reading internal run time with high resolution and low overhead
\f
;;;; reading internal run time with high resolution and low overhead
-;;; FIXME: It might make sense to replace this with something
-;;; with finer resolution, e.g. milliseconds or microseconds.
-;;; For that matter, maybe we should boost the internal clock
-;;; up to something faster, like milliseconds.
-
(defconstant +ticks-per-second+ internal-time-units-per-second)
(declaim (inline get-internal-ticks))
(defconstant +ticks-per-second+ internal-time-units-per-second)
(declaim (inline get-internal-ticks))
@@
-51,7
+46,8
@@
(make-hash-table
;; EQL testing isn't good enough for generalized function names
;; like (SETF FOO).
(make-hash-table
;; EQL testing isn't good enough for generalized function names
;; like (SETF FOO).
- :test 'equal))
+ :test 'equal
+ :synchronized t))
(defstruct (profile-info (:copier nil))
(name (missing-arg) :read-only t)
(encapsulated-fun (missing-arg) :type function :read-only t)
(defstruct (profile-info (:copier nil))
(name (missing-arg) :read-only t)
(encapsulated-fun (missing-arg) :type function :read-only t)
@@
-122,7
+118,7
@@
;;; (VALUES ENCAPSULATION-FUN READ-STATS-FUN CLEAR-STATS-FUN).
;;;
;;; ENCAPSULATION-FUN is a plug-in replacement for ENCAPSULATED-FUN,
;;; (VALUES ENCAPSULATION-FUN READ-STATS-FUN CLEAR-STATS-FUN).
;;;
;;; ENCAPSULATION-FUN is a plug-in replacement for ENCAPSULATED-FUN,
-;;; which updates statistics whenver it's called.
+;;; which updates statistics whenever it's called.
;;;
;;; READ-STATS-FUN returns the statistics:
;;; (VALUES COUNT TIME CONSING PROFILE).
;;;
;;; READ-STATS-FUN returns the statistics:
;;; (VALUES COUNT TIME CONSING PROFILE).
@@
-162,8
+158,8
@@
(let ((dticks 0)
(dconsing 0)
(inner-enclosed-profiles 0))
(let ((dticks 0)
(dconsing 0)
(inner-enclosed-profiles 0))
- (declare (type unsigned-byte dticks dconsing))
- (declare (type unsigned-byte inner-enclosed-profiles))
+ (declare (type unsigned-byte dticks dconsing inner-enclosed-profiles)
+ (dynamic-extent dticks dconsing inner-enclosed-profiles))
(aver (typep dticks 'unsigned-byte))
(aver (typep dconsing 'unsigned-byte))
(aver (typep inner-enclosed-profiles 'unsigned-byte))
(aver (typep dticks 'unsigned-byte))
(aver (typep dconsing 'unsigned-byte))
(aver (typep inner-enclosed-profiles 'unsigned-byte))
@@
-314,13
+310,14
@@
`(unprofile-all)))
(defun unprofile-all ()
`(unprofile-all)))
(defun unprofile-all ()
- (dohash (name profile-info *profiled-fun-name->info*)
+ (dohash ((name profile-info) *profiled-fun-name->info*
+ :locked t)
(declare (ignore profile-info))
(unprofile-1-fun name)))
(defun reset ()
"Reset the counters for all profiled functions."
(declare (ignore profile-info))
(unprofile-1-fun name)))
(defun reset ()
"Reset the counters for all profiled functions."
- (dohash (name profile-info *profiled-fun-name->info*)
+ (dohash ((name profile-info) *profiled-fun-name->info* :locked t)
(declare (ignore name))
(funcall (profile-info-clear-stats-fun profile-info))))
\f
(declare (ignore name))
(funcall (profile-info-clear-stats-fun profile-info))))
\f
@@
-363,7
+360,7
@@
Lisp process."
(compute-overhead)))
(let ((time-info-list ())
(no-call-name-list ()))
(compute-overhead)))
(let ((time-info-list ())
(no-call-name-list ()))
- (dohash (name pinfo *profiled-fun-name->info*)
+ (dohash ((name pinfo) *profiled-fun-name->info* :locked t)
(unless (eq (fdefinition name)
(profile-info-encapsulation-fun pinfo))
(warn "Function ~S has been redefined, so times may be inaccurate.~@
(unless (eq (fdefinition name)
(profile-info-encapsulation-fun pinfo))
(warn "Function ~S has been redefined, so times may be inaccurate.~@