0.8.11.20:
[sbcl.git] / contrib / sb-sprof / sb-sprof.texinfo
1 @node sb-sprof
2 @section sb-sprof
3 @cindex Profiler
4
5 The @code{sb-sprof} module provides an alternate profiler which works by
6 taking samples of the program execution at regular intervals, instead of
7 instrumenting functions like @code{profile} does. You might find
8 @code{sb-sprof} more useful than @code{profile} when profiling functions
9 in the @code{common-lisp}-package, SBCL internals, or code where the
10 instrumenting overhead is excessive. On the other hand it only works on
11 x86, and isn't completely reliable even there.
12
13 @subsection Example Usage
14
15 @lisp
16 (require :sb-sprof)
17 (sb-sprof:start-profiling)
18
19 (defvar *a* 0)
20 (dotimes (i (expt 2 26))
21   (setf *a* (logxor *a* (* i 5)
22                     (+ *a* i))))
23
24 (sb-sprof:stop-profiling)
25 (sb-sprof:report)
26 @end lisp
27
28 @subsection Functions
29
30 @include fun-sb-sprof-report.texinfo
31
32 @include fun-sb-sprof-reset.texinfo
33
34 @include fun-sb-sprof-start-profiling.texinfo
35
36 @include fun-sb-sprof-stop-profiling.texinfo
37
38 @subsection Macros
39
40 @include macro-sb-sprof-with-profiling.texinfo
41
42 @subsection Variables
43
44 @include var-sb-sprof-star-max-samples-star.texinfo
45
46 @include var-sb-sprof-star-sample-interval-star.texinfo
47    
48 @subsection Credits
49
50 @code{sb-sprof} is an SBCL port of Gerd Moellmann's statistical profiler
51 for CMUCL.