3 The Profiler (eprof)
3.1 The Profiler (eprof)
The profiler
eprof
tool is used to profile a system in order to find out how much processing time various processes occupy.The modules to be profiled must be compiled with the trace flag. The following functions are used to start and stop the
eprof
server, select modules to be profiled, and display the profiling results.
start() -> {ok, Pid} | {error, {already_started, Pid}}
starts theeprof
serverstop() -> stopped
stops theeprof
serverprofile(Rootset, Mod, fun, Args)
profiles a processprofile(Rootset) -> profiling | error
starts profiling a processstop profiling() -> profiling_stopped | profiling_already_stopped
stops profilinganalyse() -> ok
displays the profiling resultstotal_analyse() -> ok
prints the profiling resultslog(File) -> OK
activates logging ofeprof
printouts.
The trace flag slows the system slightly. The part of the system which is profiled runs at approximately 20% of its original speed.