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

start-profiling Function


Starts collecting profiling information.




start-profiling &key initialize processes profile-waiting ignore-in-foreign time

A boolean.
One of :current, :all, a mp:process or a list of mp:process objects.
A boolean.
A boolean.
t, nil or :extended.

The function start-profiling starts collecting profiling information.

If initialize is non-nil any profiling information collected so far is discarded. The default value of initialize is t.

If processes is supplied, the set of processes that will be profiled is set as if by calling:

(set-process-profiling :set :processes processes)

Otherwise, the set of processes remains unchanged, so is controlled by any previous calls to set-process-profiling.

processes only works in SMP LispWorks. In non-SMP LispWorks, all processes are profiled.

profile-waiting is used only in SMP LispWorks. When profile-waiting is true, processes that are marked for profiling are profiled even if they are in a wait state. In non-SMP LispWorks, only processes that are active are profiled.

ignore-in-foreign controls whether to ignore processes that are inside foreign calls. The default value of ignore-in-foreign is nil.

time controls whether to output overall timing information with the profiler output. If time is nil then no timing information is output. If time is t (the default), then output like time is printed. If time is :extended, output like extended-time is printed. The output is done when stop-profiling is called with print and suspend nil, which are the defaults.

start-profiling can be repeatedly called without intervening calls to stop-profiling, for example to change the setting of profile-waiting or the profiled processes.

start-profiling cannot be used while profile is used or while the Profiler tool is profiling (on any thread). Between the call to start-profiling and the next call to stop-profiling with print t (or omitted), profile and the Profiler tool cannot be used.

Various parameters which are set by set-up-profiler control the behavior of the profiler. See the documentation for set-up-profiler.

If start-profiling is called before any call to set-up-profiler, it implicitly calls set-up-profiler without arguments, which will cause it to monitor all fbound symbols in the image.


The following sequence of calls to start-profiling and stop-profiling can be used to profile only interesting work and print the results:

Start profiling the current process:

(start-profiling :processes :current)

Temporarily suspend profiling:

(stop-profiling :print nil)

Resume profiling:

(start-profiling :initialize nil)
See also

11.2 Guidance for control of the memory management system
12 The Profiler

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