Skip to content

Commit

Permalink
fixup! doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sverker committed Aug 28, 2024
1 parent ec6d6e7 commit 86d7074
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions erts/doc/guides/match_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,17 @@ The functions allowed only for tracing work as follows:
part when tracing.

- **`enable_trace`** - With one parameter this function turns on tracing like
the Erlang call `trace:process(S, self(), true, [P2])`, where `S` is the
current trace session and `P2` is the parameter to `enable_trace`.
the Erlang call [`trace:process(S, self(), true, [P2])`](`trace:process/4`),
where `S` is the current trace session and `P2` is the parameter to
`enable_trace`.

With two parameters, the first parameter is to be either a process identifier
or the registered name of a process. In this case tracing is turned on for the
designated process in the same way as in the Erlang call
`trace:process(S, P1, true, [P2])`, where `P1` is the first and `P2` is the second
argument. `P1` _cannot_ be one of the atoms `all`, `new` or `existing` (unless
they are registered names). `P2` _cannot_ be `cpu_timestamp` or `tracer`.
[`trace:process(S, P1, true, [P2])`](`trace:process/4`), where `P1` is the
first and `P2` is the second argument. `P1` _cannot_ be one of the atoms
`all`, `new` or `existing` (unless they are registered names). `P2` _cannot_
be `cpu_timestamp` or `tracer`.

Returns `true` and can only be used in the `MatchBody` part when tracing.

Expand All @@ -222,13 +224,15 @@ The functions allowed only for tracing work as follows:
statement uses.

- **`disable_trace`** - With one parameter this function disables tracing like
the Erlang call `trace:process(S, self(), false, [P2])`, where `S` is the
current trace session and `P2` is the parameter to `disable_trace`.
the Erlang call [`trace:process(S, self(), false, [P2])`](`trace:process/4`),
where `S` is the current trace session and `P2` is the parameter to
`disable_trace`.

With two parameters this function works as the Erlang call
`trace:process(S, P1, false, [P2])`, where `P1` can be either a process identifier
or a registered name and is specified as the first argument to the match
specification function. `P2` _cannot_ be `cpu_timestamp` or `tracer`.
[`trace:process(S, P1, false, [P2])`](`trace:process/4`), where `P1` can be
either a process identifier or a registered name and is specified as the first
argument to the match specification function. `P2` _cannot_ be `cpu_timestamp`
or `tracer`.

Returns `true` and can only be used in the `MatchBody` part when tracing.

Expand All @@ -245,11 +249,10 @@ The functions allowed only for tracing work as follows:
When used by the new `m:trace` API, trace flag `tracer` is not allowed and the
receiving tracer is always the tracer of the current session.

When used by the legacy function `erang:trace_pattern/3`, trace flag `tracer`
is allowed. If a tracer is specified in both lists, the tracer in the enable
list takes precedence. If no tracer is specified, the same tracer as the
process executing the match specification is used (not the meta tracer). If
that process doesn't have tracer either, then trace flags are ignored.
When used by the legacy function `erlang:trace_pattern/3`, trace flag `tracer`
is allowed. If no tracer is specified, the same tracer as the process
executing the match specification is used (not the meta tracer). If that
process doesn't have tracer either, then trace flags are ignored.

When using a [tracer module](`m:erl_tracer`), the module must be loaded before
the match specification is executed. If it is not loaded, the match fails.
Expand Down

0 comments on commit 86d7074

Please sign in to comment.