Next: , Previous: Describe and inspect, Up: Program development

5.6 The Profiler

The profiler tool is enabled by default in the basic ECL configuration. It can be disabled with the configure option --disable-profiler.

— sys: profile grain &optional address

This function activates the profiling of subsequent executions. grain is a value between 1 and 16384 which indicates the granularity of code segments to consider. There is a counter for each such segment. With each clock tick, the current segment is identified and its corresponding histogram count is incremented. A value of 0 for grain means stop profiling. address indicates the base address for the code being profiled.

— sys: display-profile

Displays the histogram of accumulated tick counts. The ticks are attributed to the compiled Lisp function whose base address is closest to the start of the segment. This may not be totally accurate for system functions which invoke some auxiliary function to do the job.

— sys: clear-profile

Clears the profile histogram.

— Variable: sys *profile-array*

Contains the profile histogram: two short integer counters are packed in each value of this array of fixnums.