View Source tr (erlang_doctor v0.2.2)
Summary
Types
used for a few different limits
Types
-type acc_time() :: non_neg_integer().
-type call() :: {call, {module(), atom(), list()}}.
-type call_count() :: non_neg_integer().
-type call_tree_stat_options() :: #{tab => atom()}.
-type call_tree_stat_state() :: #{pid_states := map(), tab := ets:tid()}.
-type count() :: pos_integer().
-type erlang_trace_flags() :: [call | timestamp | send | 'receive'].
-type index() :: pos_integer().
-type limit() :: pos_integer() | infinity.
-type module_spec() :: [module() | mfa()].
-type own_time() :: non_neg_integer().
-type pids() :: [pid()] | all.
-type pred() :: fun((tr()) -> boolean()).
-type result() :: {return | exception, any()}.
-type selector() :: fun((tr()) -> term()).
-type state() :: #{tab := atom(), index := index(), limit := limit(), trace := none | trace_spec(), traced_pids := traced_pids_tab()}.
-type tb_acc() :: tb_acc_tree() | tb_acc_list().
-type tb_acc_list() :: [[tr()]].
-type tb_acc_tree() :: [{tr(), tb_acc_tree()}].
-type tb_format() :: tree | list.
-type tb_order() :: top_down | bottom_up.
-type tb_output() :: shortest | longest | all.
-type time_diff() :: integer().
-type top_call_trees_options() :: #{max_size => pos_integer(), min_count => count(), min_time => time_diff(), output => top_call_trees_output()}.
-type top_call_trees_output() :: reduced | complete.
-type tr() :: #tr{}.
-type trace_options() :: #{modules => module_spec(), pids => pids(), msg => send | recv | all | none, msg_trigger => always | after_traced_call}.
-type trace_spec() :: #{modules := module_spec(), pids := pids(), msg := send | recv | all | none, msg_trigger := always | after_traced_call}.
-type traced_pids_tab() :: none | ets:table().
-type tree() :: #node{}.
Functions
-spec app_modules(atom()) -> [atom()].
-spec call_selector(fun((pid(), {atom(), atom(), [term()]}) -> term())) -> selector().
-spec call_stat(selector()) -> #{term() => {call_count(), acc_time(), own_time()}}.
-spec call_stat(selector(), atom() | [tr()]) -> #{term() => {call_count(), acc_time(), own_time()}}.
-spec call_tree_stat() -> ets:tid().
-spec call_tree_stat(call_tree_stat_options()) -> ets:tid().
-spec clean() -> ok.
-spec contains_data(term(), tr()) -> boolean().
-spec do(tr()) -> term().
-spec dump(string()) -> ok | {error, any()}.
-spec init(init_options()) -> {ok, state()}.
-spec load(string()) -> {ok, atom()} | {error, any()}.
-spec mfa({M, F, Arity}, Args) -> {M, F, Args}
when M :: atom(), F :: atom(), Arity :: arity(), Args :: list().
-spec mfarity({M, F, Arity | Args}) -> {M, F, Arity}
when M :: atom(), F :: atom(), Arity :: arity(), Args :: list().
-spec print_sorted_call_stat(selector(), pos_integer()) -> ok.
-spec ranges(pred(), range_options()) -> [[tr()]].
-spec reduce_call_trees(ets:tid()) -> true.
-spec select() -> [tr()].
-spec select(selector()) -> [term()].
-spec select(selector(), term()) -> [term()].
-spec set_tab(atom()) -> ok.
-spec sorted_call_stat(selector()) -> [{term(), call_count(), acc_time(), own_time()}].
-spec start() -> {ok, pid()}.
-spec start(init_options()) -> {ok, pid()}.
-spec start_link() -> {ok, pid()}.
-spec start_link(init_options()) -> {ok, pid()}.
-spec stop() -> ok.
-spec stop_tracing() -> ok.
-spec tab() -> atom().
-spec terminate(any(), state()) -> ok.
-spec top_call_trees() -> [tree_item()].
-spec top_call_trees(top_call_trees_options() | ets:tid()) -> [tree_item()].
-spec top_call_trees(ets:tid(), top_call_trees_options()) -> [tree_item()].
-spec trace(module_spec() | trace_options()) -> ok.
-spec trace(module_spec(), pids()) -> ok.
-spec trace_app(atom()) -> ok.
-spec trace_apps([atom()]) -> ok.
-spec traceback(pred(), tb_options()) -> [tr()].
-spec tracebacks(pred(), tb_options()) -> [[tr()]] | tb_tree().
-spec ts(tr()) -> string().