@cindex Profiling, statistical

The @code{sb-sprof} module, loadable by 
@lisp
(require :sb-sprof)
@end lisp
provides an alternate profiler which works by taking samples of the
program execution at regular intervals, instead of instrumenting
functions like @code{sb-profile:profile} does. You might find
@code{sb-sprof} more useful than accurate profiler when profiling
functions in the @code{common-lisp}-package, SBCL internals, or code
where the instrumenting overhead is excessive.

This module is known not to work consistently on the Alpha platform,
for technical reasons related to the implementation of a machine
language idiom for marking sections of code to be treated as atomic by
the garbage collector;  However, it should work on other platforms,
and the deficiency on the Alpha will eventually be rectified.

@subsection Example Usage

@lisp
(require :sb-sprof)
(sb-sprof:start-profiling)

(defvar *a* 0)
(dotimes (i (expt 2 26))
  (setf *a* (logxor *a* (* i 5)
                    (+ *a* i))))

(sb-sprof:stop-profiling)
(sb-sprof:report)
@end lisp

The profiler hooks into the disassembler such that instructions which
have been sampled are annotated with their relative frequency of
sampling.  This information is not stored across different sampling
runs. @c FIXME: maybe it should be?

@subsection Functions

@include fun-sb-sprof-report.texinfo

@include fun-sb-sprof-reset.texinfo

@include fun-sb-sprof-start-profiling.texinfo

@include fun-sb-sprof-stop-profiling.texinfo

@subsection Macros

@include macro-sb-sprof-with-profiling.texinfo

@subsection Variables

@include var-sb-sprof-star-max-samples-star.texinfo

@include var-sb-sprof-star-sample-interval-star.texinfo
   
@subsection Credits

@code{sb-sprof} is an SBCL port, with enhancements, of Gerd
Moellmann's statistical profiler for CMUCL.
