analyse() ->
{AllCallCount :: integer() >= 0,
ModAnalysisList :: mod_analysis_list()}
analyse(Limit) ->
{AllCallCount :: integer() >= 0,
ModAnalysisList :: mod_analysis_list()}
analyse(Mod) -> ModAnalysis :: mod_analysis()
analyse(Mod, Limit) -> ModAnalysis :: mod_analysis()
Types
{Mod :: module(),
ModCallCount :: integer() >= 0,
FuncAnalysisList :: func_analysis_list()}
[{mfa(), FuncCallCount :: integer() >= 0}]
Collects and analyses the call counters presently in the node for either module Mod, or for all modules (except cprof itself), and returns:
- FuncAnalysisList
- A list of tuples, one for each function in a module, in decreasing FuncCallCount order.
- ModCallCount
- The sum of FuncCallCount values for all functions in module Mod.
- AllCallCount
- The sum of ModCallCount values for all modules concerned in ModAnalysisList.
- ModAnalysisList
- A list of tuples, one for each module except cprof, in decreasing ModCallCount order.
If call counters are still running while analyse/0..2 is executing, you might get an inconsistent result. This happens if the process executing analyse/0..2 gets scheduled out so some other process can increment the counters that are being analysed, Calling pause() before analysing takes care of the problem.
If the Mod argument is given, the result contains a ModAnalysis tuple for module Mod only, otherwise the result contains one ModAnalysis tuple for all modules returned from code:all_loaded() except cprof itself.
All functions with a FuncCallCount lower than Limit are excluded from FuncAnalysisList. They are still included in ModCallCount, though. The default value for Limit is 1.