From 9fbdf23b7a458120f056320f998e62ccba030990 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 11 May 2016 18:30:37 +0200 Subject: runtime_tools: Document dbg:tpe/2 and ctpe/1 --- lib/runtime_tools/doc/src/dbg.xml | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'lib/runtime_tools') diff --git a/lib/runtime_tools/doc/src/dbg.xml b/lib/runtime_tools/doc/src/dbg.xml index 0128e23a47..9664075198 100644 --- a/lib/runtime_tools/doc/src/dbg.xml +++ b/lib/runtime_tools/doc/src/dbg.xml @@ -438,6 +438,50 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\ global calls (and functions).

+ + + + tpe(Event, MatchSpec) -> {ok, MatchDesc} | {error, term()} + Set pattern for traced event + + Event = send | 'receive' + MatchSpec = integer() | Built-inAlias | [] | match_spec() + Built-inAlias = x | c | cx + MatchDesc = [MatchInfo] + MatchInfo = {saved, integer()} | MatchNum + MatchNum = {matched, node(), 1} | {matched, node(), 0, RPCError} + + +

This function associates a match specification with trace event + send or 'receive'. By default all executed send + and 'receive' events are traced if enabled for a process. + A match specification can be used to filter traced events + based on sender, receiver and/or message content.

+

For a description of the match_spec() syntax, + please turn to the User's guide part of the online + documentation for the runtime system (erts). The + chapter Match Specifications in Erlang + explains the general match specification "language".

+

For send, the matching is done on the list [Receiver, Msg]. + Receiver is the process or port identity of the receiver and + Msg is the message term. The pid of the sending process can be + accessed with the guard function self/0.

+

For 'receive', the matching is done on the list [Node, Sender, Msg]. + Node is the node name of the sender. Sender is the + process or port identity of the sender, or the atom + undefined if the sender is not known (which may + be the case for remote senders). Msg is the + message term. The pid of the receiving process can be + accessed with the guard function self/0.

+

All nodes added with n/1 or + tracer/3 will + be affected by this call.

+

The return value is the same as for + tp/2. The number of matched + events are never larger than 1 as tpe/2 does not + accept any form of wildcards for argument Event.

+
+
ctp() Clear call trace pattern for the specified functions @@ -559,6 +603,22 @@ Error: fun containing local erlang function calls ('is_atomm' called in guard)\ tracing set up with tp/2 (not with tpl/2).

+ + ctpe(Event) -> {ok, MatchDesc} | {error, term()} + Clear trace pattern for the specified event + + Event = send | 'receive' + MatchDesc = [MatchNum] + MatchNum = {matched, node(), 1} | {matched, node(), 0, RPCError} + + +

This function clears match specifications for the specified + trace event (send or 'receive'). It will revert back + to the default behavior of tracing all triggered events.

+

The return value follow the same style as for + ctp/1.

+
+
ltp() -> ok List saved and built-in match specifications on the console. -- cgit v1.2.3