do-profiling &key initialize processes profile-waiting ignore-in-foreign sleep function arguments func-and-args print stream
mp:process or a list of
A non-negative number, or
A function designator.
Arguments passed to function.
A function designator or a list
A generalized boolean.
An output stream.
do-profiling is a convenience function for profiling multiple threads, combining start-profiling and stop-profiling.
The behavior of
do-profiling with no arguments is the same as:
(start-profiling :processes :all)
The arguments initialize, processes, profile-waiting and ignore-in-foreign are passed to start-profiling. They have the same default values as for start-profiling, except processes which defaults to
The arguments print and stream are passed to stop-profiling. They have the same default values as in stop-profiling.
sleep is the time to sleep in seconds. If sleep is
nil or 0
do-profiling does not sleep. Also, if sleep is supplied and either function or func-and-args are passed, it does not sleep.
func-and-args, and function together with arguments, can both be used for calling a function you supply. func-and-args is either a list of the form
), in which case function-designator is applied to the args, or it is a function designator which is called without arguments. function is applied to arguments.
The order of execution is first func-and-args (if this is non-nil), then function together with arguments if function is non-nil, and then sleep if sleep was passed explicitly or both function and func-and-args are
To profile whatever happens in the next 6 seconds:
To profile whatever happens in the next 10 minutes:
(hcl:do-profiling :sleep 600)
To run 4 processes in parallel with the same function and profile until they all die:
(defun check-all-processes-died (processes)
(dolist (p processes t)
(when (mp:process-alive-p p)
(loop for x below 4
(format nil "my process ~a" x)
"Waiting for processes to finish"
LispWorks User Guide and Reference Manual - 13 Feb 2015