From 86d707415b8548e58e530eec79db8e2715efae87 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 28 Aug 2024 15:40:25 +0200 Subject: [PATCH] fixup! doc --- erts/doc/guides/match_spec.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/erts/doc/guides/match_spec.md b/erts/doc/guides/match_spec.md index db027a71911d..a212d2266a4a 100644 --- a/erts/doc/guides/match_spec.md +++ b/erts/doc/guides/match_spec.md @@ -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. @@ -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. @@ -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.