|
|
@ -7,23 +7,23 @@ |
|
|
|
-export([pfm/4]). |
|
|
|
|
|
|
|
-type opts() :: #{ |
|
|
|
scope => global | per_process, %% Whether we filter the output per process. |
|
|
|
running => boolean() %% Whether we compute and save wait times. |
|
|
|
scope => global | per_process, %% Whether we filter the output per process. |
|
|
|
running => boolean() %% Whether we compute and save wait times. |
|
|
|
}. |
|
|
|
|
|
|
|
-record(call, { |
|
|
|
mfa :: atom(), %% The MFA for the call. |
|
|
|
source :: {string(), pos_integer()}, %% The source file name. |
|
|
|
ts :: pos_integer(), %% The timestamp for the call. |
|
|
|
self_ts :: pos_integer(), %% The timestamp for when we last started executing this function. |
|
|
|
incl :: undefined | non_neg_integer(), %% Execution time including subcalls. |
|
|
|
self = 0 :: integer(), %% Execution time excluding subcalls. |
|
|
|
count = 1 :: pos_integer(), %% Number of times the function was called. |
|
|
|
wait = 0 :: non_neg_integer(), %% Time when the process was not running in this function. |
|
|
|
wait_incl = 0 :: non_neg_integer(), %% Time when the process was not running in this function or any subcalls. |
|
|
|
wait_count = 0 :: non_neg_integer(), %% Number of times the process was scheduled out. |
|
|
|
wait_count_incl = 0 :: non_neg_integer(), %% Number of times the function or any subcall was scheduled out. |
|
|
|
calls = #{} :: #{atom() => #call{}} %% Calls done by this MFA. |
|
|
|
mfa :: atom(), %% The MFA for the call. |
|
|
|
source :: {string(), pos_integer()}, %% The source file name. |
|
|
|
ts :: pos_integer(), %% The timestamp for the call. |
|
|
|
self_ts :: pos_integer(), %% The timestamp for when we last started executing this function. |
|
|
|
incl :: undefined | non_neg_integer(), %% Execution time including subcalls. |
|
|
|
self = 0 :: integer(), %% Execution time excluding subcalls. |
|
|
|
count = 1 :: pos_integer(), %% Number of times the function was called. |
|
|
|
wait = 0 :: non_neg_integer(), %% Time when the process was not running in this function. |
|
|
|
wait_incl = 0 :: non_neg_integer(), %% Time when the process was not running in this function or any subcalls. |
|
|
|
wait_count = 0 :: non_neg_integer(), %% Number of times the process was scheduled out. |
|
|
|
wait_count_incl = 0 :: non_neg_integer(), %% Number of times the function or any subcall was scheduled out. |
|
|
|
calls = #{} :: #{atom() => #call{}} %% Calls done by this MFA. |
|
|
|
}). |
|
|
|
|
|
|
|
-record(proc, { |
|
|
|