'trace-start))
(incf (samples-index samples) 2))
-;;; List of thread currently profiled, or T for all threads.
+;;; List of thread currently profiled, or :ALL for all threads.
(defvar *profiled-threads* nil)
(declaim (type (or list (member :all)) *profiled-threads*))
(defun profiled-threads ()
(let ((profiled-threads *profiled-threads*))
- (if (eq :all profiled-threads)
- (remove *timer-thread* (sb-thread:list-all-threads))
- profiled-threads)))
+ (remove *timer-thread*
+ (if (eq :all profiled-threads)
+ (sb-thread:list-all-threads)
+ profiled-threads))))
(defun profiled-thread-p (thread)
(let ((profiled-threads *profiled-threads*))
(defvar *profiler-lock* (sb-thread:make-mutex :name "Statistical Profiler"))
(defvar *distribution-lock* (sb-thread:make-mutex :name "Wallclock profiling lock"))
- (define-alien-routine pthread-kill int (signal int) (os-thread unsigned-long))
+ (declaim (inline pthread-kill))
+ (define-alien-routine pthread-kill int (os-thread unsigned-long) (signal int))
;;; A random thread will call this in response to either a timer firing,
;;; This in turn will distribute the notice to those threads we are
(let ((alloc-signal (1- alloc-interval)))
#+sb-thread
(progn
- (when (eq t threads)
+ (when (eq :all threads)
;; Set the value new threads inherit.
(sb-thread::with-all-threads-lock
(setf sb-thread::*default-alloc-signal* alloc-signal)))
Value of this function is a CALL-GRAPH object representing the
resulting call-graph, or NIL if there are no samples (eg. right after
-calling RESET.)"
+calling RESET.)
+
+Profiling is stopped before the call graph is generated."
(cond (*samples*
(let ((graph (or call-graph (make-call-graph most-positive-fixnum))))
(ecase type