2 The Profiler (eprof)
2.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
server
stop() -> stopped
stops theeprof
server
profile(Rootset, Mod, fun, Args)
profiles a process
profile(Rootset) -> profiling | error
starts profiling a process
stop profiling() -> profiling_stopped | profiling_already_stopped
stops profiling
analyse() -> ok
displays the profiling results
total_analyse() -> ok
prints the profiling results
log(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.