[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
7.21 Usage
- Function: statprof-active?
Returns
#t
ifstatprof-start
has been called more times thanstatprof-stop
,#f
otherwise.
- Function: statprof-reset sample-seconds sample-microseconds count-calls? [full-stacks?]
Reset the statprof sampler interval to sample-seconds and sample-microseconds. If count-calls? is true, arrange to instrument procedure calls as well as collecting statistical profiling data. If full-stacks? is true, collect all sampled stacks into a list for later analysis.
Enables traps and debugging as necessary.
- Function: statprof-fold-call-data proc init
Fold proc over the call-data accumulated by statprof. Cannot be called while statprof is active. proc should take two arguments,
(call-data prior-result)
.Note that a given proc-name may appear multiple times, but if it does, it represents different functions with the same name.
- Function: statprof-proc-call-data proc
Returns the call-data associated with proc, or
#f
if none is available.
- Function: statprof-display . _
Displays a gprof-like summary of the statistics collected. Unless an optional port argument is passed, uses the current output port.
- Function: statprof-display-anomolies
A sanity check that attempts to detect anomolies in statprof’s statistics.
- Function: statprof-fetch-stacks
Returns a list of stacks, as they were captured since the last call to
statprof-reset
.Note that stacks are only collected if the full-stacks? argument to
statprof-reset
is true.
- Function: statprof-fetch-call-tree
Return a call tree for the previous statprof run. The return value is a list of nodes, each of which is of the type: @@code node ::= (@@var@{proc@} @@var@{count@} . @@var@{nodes@}) @@end code
- Function: statprof thunk [#:loop] [#:hz] [#:count-calls?] [#:full-stacks?]
Profiles the execution of thunk.
The stack will be sampled hz times per second, and the thunk itself will be called loop times.
If count-calls? is true, all procedure calls will be recorded. This operation is somewhat expensive.
If full-stacks? is true, at each sample, statprof will store away the whole call tree, for later analysis. Use
statprof-fetch-stacks
orstatprof-fetch-call-tree
to retrieve the last-stored stacks.
- Special Form: with-statprof args
Profiles the expressions in its body.
Keyword arguments:
#:loop
Execute the body loop number of times, or
#f
for no loopingdefault:
#f
#:hz
Sampling rate
default:
20
#:count-calls?
Whether to instrument each function call (expensive)
default:
#f
#:full-stacks?
Whether to collect away all sampled stacks into a list
default:
#f
- Function: gcprof thunk [#:loop] [#:full-stacks?]
Do an allocation profile of the execution of thunk.
The stack will be sampled soon after every garbage collection, yielding an approximate idea of what is causing allocation in your program.
Since GC does not occur very frequently, you may need to use the loop parameter, to cause thunk to be called loop times.
If full-stacks? is true, at each sample, statprof will store away the whole call tree, for later analysis. Use
statprof-fetch-stacks
orstatprof-fetch-call-tree
to retrieve the last-stored stacks.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.