The function
print-profile-list
prints a report of symbols, after profiling using profile, or start-profiling followed by stop-profiling.
If the profiler was set up with
style
:tree
, then a tree of calls is printed first, according to
limit
,
cutoff
and
collapse
. Then a columnar report is printed showing how often each function was called, profiled and found on the top of the stack. This report is sorted by the column indicated by the value of
sort
.
If the profiler was set up with
style
:list
, then only the columnar report is printed.
Sort by the number of times the function was called.
Sort by the number of times the function was found on the stack.
Sort by the number of times the function was found at the top of the stack.
If sort is not passed then the results are printed as after the profiling run. The default is the value of the variable *default-profiler-sort*.
limit is the maximum number of lines printed in the columnar report as described for *default-profiler-limit*. The default is the value of the variable *default-profiler-limit*.
cutoff is the minimum percentage that the profiler will display in the output tree as described for *default-profiler-cutoff*. The default is the value of the variable *default-profiler-cutoff*.
collapse controls collapsing of the output tree as described for *default-profiler-collapse*. The default is the value of the variable *default-profiler-collapse*.
CL-USER 1 > (set-up-profiler
:symbols
'(cadr car eql fixnump + 1+ caadr cddr))
CL-USER 2 > (profile (dotimes (a 1000000 nil)
(+ a a)
(car '(foo))))
Then call
print-profile-list
:
CL-USER 3 > (print-profile-list :sort :call)
profile-stacks called 327 times
Cumulative profile summary
Symbol called profile (%) top (%)
CADR 5000012 13 ( 4) 13 ( 4)
CDDR 3000000 3 ( 1) 3 ( 1)
EQL 2000202 4 ( 1) 4 ( 1)
FIXNUMP 2000003 2 ( 1) 2 ( 1)
CAR 1000000 1 ( 0) 1 ( 0)
+ 1000000 3 ( 1) 3 ( 1)
CAADR 1000000 2 ( 1) 2 ( 1)
1+ 1000000 2 ( 1) 2 ( 1)
Top of stack not monitored 91% of the time
NIL
You can suppress printing of those symbols that are currently profiled but which were not called in the profiling run by setting
system:*profiler-print-out-all*
to
nil
.
system:*profiler-print-out-all
* is a variable defined when the profiler is loaded by set-up-profiler. Its initial value is
nil
.
*default-profiler-collapse*
*default-profiler-cutoff*
*default-profiler-limit*
*default-profiler-sort*