et_selector(3)
π NAME π
et_selector β define event transforms and trace patterns π
(yeah bestie, this is et_selector(3), straight out of your Erlang Module Definition era β¨)
π¦ DESCRIPTION π¦
okay so real talk: this DESCRIPTION section is literally empty in the source β the manual just drops you straight into the data types and the functions. no lore, no backstory, just pure API. iconic honestly. moving on π«Ά
πΈ DATA TYPES πΈ
event() :: #event{}.β an event record, that's the whole vibe π«level() :: 0..100.β a detail level, a number that lives anywhere from0to100inclusive, no cap π₯
π FUNCTIONS π
π change_pattern/1
change_pattern({Mod :: module(), Pattern}) -> ok
when
Pattern ::
DetailLevel | TracePattern |
EmptyTracePattern,
DetailLevel :: level(),
TracePattern ::
[{[term()] | '_' | atom(),
[term()],
[term()]}],
EmptyTracePattern :: [].
this one turns tracing on or off by swapping out the current trace pattern. it's giving "main character flips the switch" energy β¨
here's how the detail level call goes down:
- min detail level β deactivates tracing of calls to
et:trace_me/4,5π - max detail level β activates tracing of all calls to
et:trace_me/4,5π integer(X)detail level β activates tracing of all calls toet:trace_me/4,5whose detail level argument is lesser thanXπ«- an empty match spec β deactivates tracing of calls to
et:trace_me/4,5π - other match specs β activates tracing of calls to
et:trace_me/4,5accordingly witherlang:trace_pattern/2π₯
π§ make_pattern/1
make_pattern({Mod :: module(), RawPattern}) ->
{Mod :: module(), TracePattern}
when
RawPattern :: level(),
TracePattern ::
[{[term()] | '_' | atom(),
[term()],
[term()]}].
this one bakes a trace pattern that's suitable to feed straight into change_pattern/1 π
same detail level rules, same energy:
- Min detail level β deactivates tracing of calls to
et:trace_me/4,5π - Max detail level β activates tracing of all calls to
et:trace_me/4,5π integer(X)detail level β activates tracing of all calls toet:trace_me/4,5whose detail level argument is lesser thanXπ«
also, go peek aterlang:trace_pattern/2if you want more info about itsmatch_spec()β iykyk π
π parse_event/2
parse_event(Mod, ValidTraceData) -> boolean | {true, event()}
when
Mod :: module(),
ValidTraceData :: ErlangTraceData | event(),
ErlangTraceData ::
{trace, pid(), atom(), term()} |
{trace, pid(), atom(), term(), term()} |
{trace_ts,
pid(),
atom(),
term(),
TS :: {integer(), integer(), integer()}} |
{trace_ts,
pid(),
atom(),
term(),
term(),
TS :: {integer(), integer(), integer()}} |
{seq_trace, atom(), term()} |
{seq_trace,
atom(),
term(),
TS :: {integer(), integer(), integer()}} |
{drop, integer()}.
this is the glow-up function: it transforms trace data and makes an event record out of it π β¨
if you want the semantics of that trace data, erlang:trace/3 is where the lore lives π
an event record is made of these fields, bestie:
detail_levelβ noise has a high level as opposed to essentials πtrace_tsβ time when the trace was generated. same asevent_tsif omitted in trace data β°event_tsβ time when the event record was created π°οΈfromβ from actor, such as sender of a message π¨toβ to actor, such as receiver of message π«Άlabelβ label intended to provide a brief event summary π·οΈcontentsβ all nitty gritty details of the event π§
oh and go check et:trace_me/4 and et:trace_me/5 for the details π
and here's what it hands back to you:
{true, Event}β whereEventis an#event{}record representing the trace data β¨trueβ means the trace data already is an event record and it's valid exactly as it is. no transformation needed, it ate and left no crumbs πfalseβ means the trace data is uninteresting and should be dropped π
that's the whole page, babe π brought to you by Ericsson AB, living in et version 1.8, forever known as et_selector(3) β stan a trace-pattern icon πβ¨
π¦ where this page comes from
- nixos 26.05: erlang 29.1.2
- nixpkgs unstable: erlang 29.1.2
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms