(/show0 "pcounter.lisp 16")
(defstruct (pcounter (:copier nil))
- (integer 0);; :type unsigned-byte)
- (fixnum 0));; :type (and fixnum unsigned-byte)))
+ (integer 0 :type unsigned-byte)
+ (fixnum 0 :type (and fixnum unsigned-byte)))
(/show0 "pcounter.lisp 22")
-(declaim (ftype (function (pcounter unsigned-byte) pcounter) incf-pcounter))
-;;;(declaim (inline incf-pcounter)) ; FIXME: maybe inline when more stable
+(declaim (maybe-inline incf-pcounter))
(defun incf-pcounter (pcounter delta)
(aver (typep delta 'unsigned-byte))
(let ((sum (+ (pcounter-fixnum pcounter) delta)))
- (aver (typep sum 'unsigned-byte))
- ;;(declare (type unsigned-byte sum))
(cond ((typep sum 'fixnum)
(setf (pcounter-fixnum pcounter) sum))
(t
(/show0 "pcounter.lisp 36")
-(declaim (ftype (function (pcounter) integer) pcounter->integer))
;;;(declaim (inline pcounter->integer)) ; FIXME: maybe inline when more stable
(defun pcounter->integer (pcounter)
(+ (pcounter-integer pcounter)
(/show0 "pcounter.lisp 50")
-(declaim (ftype (function ((or pcounter fixnum) integer) (or pcounter fixnum)) %incf-pcounter-or-fixnum))
-;;;(declaim (inline %incf-pcounter-or-fixnum)) ; FIXME: maybe inline when more stable
+(declaim (inline %incf-pcounter-or-fixnum))
(defun %incf-pcounter-or-fixnum (x delta)
(etypecase x
(fixnum
(/show0 "pcounter.lisp 80")
-(declaim (ftype (function ((or pcounter fixnum)) integer) pcounter-or-fixnum->integer))
(declaim (maybe-inline pcounter-or-fixnum->integer))
(defun pcounter-or-fixnum->integer (x)
(etypecase x
(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))
+ (declare (type unsigned-byte inner-enclosed-profiles))
(aver (typep dticks 'unsigned-byte))
(aver (typep dconsing 'unsigned-byte))
(aver (typep inner-enclosed-profiles 'unsigned-byte))
dconsing (fastbig- (get-bytes-consed) start-consing))
(setf inner-enclosed-profiles
(pcounter-or-fixnum->integer *enclosed-profiles*))
- (aver (not (minusp dconsing))) ; REMOVEME
- (aver (not (minusp inner-enclosed-profiles))) ; REMOVEME
(let ((net-dticks (fastbig- dticks *enclosed-ticks*)))
(fastbig-incf-pcounter-or-fixnum ticks net-dticks))
(let ((net-dconsing (fastbig- dconsing *enclosed-consing*)))
- (when (minusp net-dconsing) ; REMOVEME
- (unprofile-all)
- (error "huh? DCONSING=~S, *ENCLOSED-CONSING*=~S"
- dticks *enclosed-ticks*))
(fastbig-incf-pcounter-or-fixnum consing net-dconsing))
(fastbig-incf-pcounter-or-fixnum profiles
inner-enclosed-profiles))))
(max raw-compensated 0.0)))
(defun report ()
- "Report results from profiling. The results are
-approximately adjusted for profiling overhead, but when RAW is true
-the unadjusted results are reported. The compensation may be somewhat
-inaccurate when bignums are involved in runtime calculation, as in
-a very-long-running Lisp process."
+ "Report results from profiling. The results are approximately adjusted
+for profiling overhead. The compensation may be rather inaccurate when
+bignums are involved in runtime calculation, as in a very-long-running
+Lisp process."
(declare #.*optimize-external-despite-byte-compilation*)
(unless (boundp '*overhead*)
(setf *overhead*
;;; We average the timing overhead over this many iterations.
(defconstant +timer-overhead-iterations+
- 50 ; REMOVEME
- ;;50000
- )
+ 50000)
;;; a dummy function that we profile to find profiling overhead
(declaim (notinline compute-overhead-aux))
(setq *internal-real-time-base-seconds* seconds)
uint)))))
-;;; REMOVEME once runtime nonmonotonicity problem is debugged
-(defvar *last-utime-sec*)
-(defvar *last-utime-usec*)
-(defvar *last-stime-sec*)
-(defvar *last-stime-usec*)
-(defvar *last-internal-run-time*)
-(push (lambda ()
- (makunbound '*last-internal-run-time*))
- *before-save-initializations*)
-
(defun get-internal-run-time ()
#!+sb-doc
"Return the run time in the internal time format. This is useful for
stime-usec
(floor micro-seconds-per-internal-time-unit 2))
micro-seconds-per-internal-time-unit))))
-
- ;; REMOVEME once runtime nonmonotonicity problem is debugged
- (when (boundp '*last-internal-run-time*)
- (unless (>= result *last-internal-run-time*)
- (error "non-monotonic:~@
- UTIME-SEC ~S ~S~@
- UTIME-USEC ~S ~S~@
- STIME-SEC ~S ~S~@
- STIME-USEC ~S ~S~@
- RESULT ~S ~S"
- *last-utime-sec* utime-sec
- *last-utime-usec* utime-usec
- *last-stime-sec* stime-sec
- *last-stime-usec* stime-usec
- *last-internal-run-time* result)))
- (setf *last-utime-sec* utime-sec
- *last-utime-usec* utime-usec
- *last-stime-sec* stime-sec
- *last-stime-usec* stime-usec
- *last-internal-run-time* result)
-
result)))
\f
;;;; Encode and decode universal times.
;;;; miscellaneous extensions
(defknown get-bytes-consed () unsigned-byte (flushable))
+
+;;; PCOUNTERs
+(defknown incf-pcounter (pcounter unsigned-byte) pcounter)
+(defknown pcounter->integer (pcounter) unsigned-byte)
+(defknown %incf-pcounter-or-fixnum ((or pcounter fixnum) unsigned-byte)
+ (or pcounter fixnum))
+(defknown pcounter-or-fixnum->integer ((or pcounter fixnum)) unsigned-byte)
\f
;;;; magical compiler frobs
static void
sigill_handler(int signal, siginfo_t *siginfo, void *void_context) {
os_context_t *context = (os_context_t*)void_context;
- fprintf(stderr, "\n/entering sigill_handler()\n"); /*REMOVEME*/
fake_foreign_function_call(context);
ldb_monitor();
}
;;; four numeric fields, is used for versions which aren't released
;;; but correspond only to CVS tags or snapshots.
-"0.6.12.39"
+"0.6.12.41"