All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

print-profile-list Function

Summary

Prints a report of symbols that have been profiled.

Package

hcl

Signature

print-profile-list &key sort limit cutoff collapse => nil

Arguments
sort
:call, :profile or :top.
limit
An integer.
cutoff
A real number.
collapse
A generalized boolean.
Description

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 can take these values:

:call
Sort by the number of times the function was called.
:profile
Sort by the number of times the function was found on the stack.
:top
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*.

Notes

You should not call print-profile-list while the profiler is running (see profile and start-profiling) or suspended (see stop-profiling).

Examples

First set up the profiler :

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 :top)
 
Profiler sampled 251 times
 
Call tree
Symbol                                                              seen   (%)
    1: LET                                                           251 (100)
     2: UNWIND-PROTECT                                               251 (100)
      3: MULTIPLE-VALUE-PROG1                                        251 (100)
       4: BLOCK                                                      251 (100)
        5: LET                                                       251 (100)
         6: LET                                                      251 (100)
          7: TAGBODY                                                 251 (100)
           8: SETQ                                                   100 ( 40)
            9: THE                                                    44 ( 18)
            10: THE                                                   23 (  9)
             11: CADR                                                  1 (  0)
            10: 1+                                                     2 (  1)
            10: FIXNUMP                                                1 (  0)
            9: SETQ                                                   10 (  4)
            10: CDDR                                                   1 (  0)
            10: CADR                                                   1 (  0)
            9: CADR                                                    2 (  1)
           8: IF                                                      24 ( 10)
           8: GO                                                      10 (  4)
            9: CDDR                                                    1 (  0)
            9: EQL                                                     1 (  0)
            9: CAADR                                                   1 (  0)
           8: WITHOUT-CODE-COVERAGE                                    4 (  2)
           8: QUOTE                                                    2 (  1)
 
 
Cumulative profile summary
Symbol                                    called  profile   (%)      top   (%)
SETQ                                           0      110 ( 44)       30 ( 12)
THE                                            0       67 ( 27)       15 (  6)
TAGBODY                                        0      251 (100)        8 (  3)
WITHOUT-CODE-COVERAGE                          0        4 (  2)        4 (  2)
GO                                             0       10 (  4)        4 (  2)
CADR                                           0        4 (  2)        4 (  2)
QUOTE                                          0        2 (  1)        2 (  1)
IF                                             0       24 ( 10)        2 (  1)
CDDR                                           0        2 (  1)        2 (  1)
1+                                             0        2 (  1)        2 (  1)
FIXNUMP                                        0        1 (  0)        1 (  0)
EQL                                            0        1 (  0)        1 (  0)
CAADR                                          0        1 (  0)        1 (  0)
UNWIND-PROTECT                                 0      251 (100)        0 (  0)
BLOCK                                          0      251 (100)        0 (  0)
MULTIPLE-VALUE-PROG1                           0      251 (100)        0 (  0)
LET                                            0      753 (300)        0 (  0)
 
On average   1.0 stacks profiled each profiler sampling
Top of stack not monitored 70% of the time
Sampled while in GC 0 times (0% of 251 samplings)
NIL
Notes

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.

See also

*default-profiler-collapse*
*default-profiler-cutoff*
*default-profiler-limit*
*default-profiler-sort*


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35