2 The Profiler (eprof)
2.1 The Profiler (eprof)
The profiler
eproftool 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
eprofserver, select modules to be profiled, and display the profiling results.
start() -> {ok, Pid} | {error, {already_started, Pid}}starts theeprofserverstop() -> stoppedstops theeprofserverprofile(Rootset, Mod, fun, Args)profiles a processprofile(Rootset) -> profiling | errorstarts profiling a processstop profiling() -> profiling_stopped | profiling_already_stoppedstops profilinganalyse() -> okdisplays the profiling resultstotal_analyse() -> okprints the profiling resultslog(File) -> OKactivates logging ofeprofprintouts.
The trace flag slows the system slightly. The part of the system which is profiled runs at approximately 20% of its original speed.