diff options
author | Lukas Larsson <[email protected]> | 2016-05-19 10:54:43 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-05-24 10:42:16 +0200 |
commit | 115f0ba77ad7d01ab95fd9f9bbeca53f04f12284 (patch) | |
tree | c7134ee895b23d8160440cec7dd1598b1f689de3 /erts/preloaded/src/erl_tracer.erl | |
parent | 0bc0e3e51a4229245c4111667eec9133a1a8984c (diff) | |
download | otp-115f0ba77ad7d01ab95fd9f9bbeca53f04f12284.tar.gz otp-115f0ba77ad7d01ab95fd9f9bbeca53f04f12284.tar.bz2 otp-115f0ba77ad7d01ab95fd9f9bbeca53f04f12284.zip |
erts: Move tracer SecondTraceTerm to Opts map
The extra trace data has been moved to the opts map in order
for the tracer to be able to distinguish inbetween extra
trace data 'undefined' and no extra trace data. In the same
commit all opts associations have been changed so that if
the tracer should not use them, the key is left unassicated
instead of being sent to undefined. This should be give a
small performance gain and also makes the API easier to work
with.
Diffstat (limited to 'erts/preloaded/src/erl_tracer.erl')
-rw-r--r-- | erts/preloaded/src/erl_tracer.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/erts/preloaded/src/erl_tracer.erl b/erts/preloaded/src/erl_tracer.erl index fe15812535..c810069d17 100644 --- a/erts/preloaded/src/erl_tracer.erl +++ b/erts/preloaded/src/erl_tracer.erl @@ -1,6 +1,6 @@ -module(erl_tracer). --export([enabled/3, trace/6, on_load/0]). +-export([enabled/3, trace/5, on_load/0]). -type tracee() :: port() | pid() | undefined. @@ -26,9 +26,9 @@ | trace_tag_running_ports() | trace_tag_gc(). --type trace_opts() :: #{ match_spec_result => true | term(), - scheduler_id => undefined | non_neg_integer(), - timestamp => undefined | timestamp | cpu_timestamp | +-type trace_opts() :: #{ extra => term(), match_spec_result => term(), + scheduler_id => non_neg_integer(), + timestamp => timestamp | cpu_timestamp | monotonic | strict_monotonic }. -type tracer_state() :: term(). @@ -41,6 +41,9 @@ on_load() -> %%% NIF placeholders %%% +%% This suppression is needed as trace_tag gets collapsed to atom() +-dialyzer({no_contracts, enabled/3}). + -spec enabled(Tag :: trace_status, TracerState :: tracer_state(), Tracee :: tracee()) -> @@ -56,8 +59,7 @@ enabled(_, _, _) -> TracerState :: tracer_state(), Tracee :: tracee(), Msg :: term(), - Extra :: term(), Opts :: trace_opts()) -> any(). -trace(_, _, _, _, _, _) -> +trace(_, _, _, _, _) -> erlang:nif_error(nif_not_loaded). |