From 43f3482adf5eee657e5ba922733dfff6600c4e14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5kan=20Mattsson?= Reports an event, such as a message. These functions are intended to be invoked at strategic places
- in user applications in order to enable simplified tracing.
- The functions are extremely light weight as they do nothing
- besides returning an atom. These functions are designed for
- being traced. The global tracing mechanism in et_collector
- defaults to set its trace pattern to these functions. The label is intended to provide a brief summary of the event.
- A simple tag would do. A function that is intended to be traced. This function is intended to be invoked at strategic places
+ in user applications in order to enable simplified
+ tracing. The functions are extremely light weight as they do
+ nothing besides returning an atom. The functions are designed
+ for being traced. The global tracing mechanism in
+ The label is intended to provide a brief summary of the
+ event. It is preferred to use an atom but a string would also
+ do. The contents can be any term but in order to simplify
post processing of the traced events, a plain list
of {Key, Value} tuples is preferred.
Invokes
These functions sends a signal to the outer space and the
+ caller hopes that someone is listening. In other words, they
+ invoke
Deprecated functions which for the time being are kept for
+ backwards compatibility. Invokes
The two major components of the Event Tracer (ET)
- tool is a graphical sequence chart viewer (
The interface between the collector and its viewers
- is public in order to enable other types of viewers.
- However in the following text we will focus on usage
- of the
The main start function is
{ok, Viewer} = et_viewer:start([]).
- {ok,<0.31.0>}
- ]]>
- A viewer gets trace events from its collector
- by polling it regularly for more events to display.
- Trace events are for example reported to the collector with
-
Collector = et_viewer:get_collector_pid(Viewer).
- <0.30.0>
- 3> et_collector:report_event(Collector, 60, my_shell, mnesia_tm, start_outer,
- "Start outer transaction"),
- 3> et_collector:report_event(Collector, 40, mnesia_tm, my_shell, new_tid,
- "New transaction id is 4711"),
- 3> et_collector:report_event(Collector, 20, my_shell, mnesia_locker, try_write_lock,
- "Acquire write lock for {my_tab, key}"),
- 3> et_collector:report_event(Collector, 10, mnesia_locker, my_shell, granted,
- "You got the write lock for {my_tab, key}"),
- 3> et_collector:report_event(Collector, 60, my_shell, do_commit,
- "Perform transaction commit"),
- 3> et_collector:report_event(Collector, 40, my_shell, mnesia_locker, release_tid,
- "Release all locks for transaction 4711"),
- 3> et_collector:report_event(Collector, 60, my_shell, mnesia_tm, delete_transaction,
- "End of outer transaction"),
- 3> et_collector:report_event(Collector, 20, my_shell, end_outer,
- "Transaction returned {atomic, ok}").
- {ok,{table_handle,<0.30.0>,11,trace_ts,#Fun}}
- 4>
- ]]>
- This is a simulation of the process events caused by a Mnesia - transaction that writes a record in a local table:
-
- mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).
-
- At this stage when we have a couple of events, it is time to
- show how it looks like in the graphical interface of
-
In the sequence chart, the actors (which symbolically has performed the - traced event) are shown as named vertical bars. The order of the - actors may be altered by dragging (hold mouse button 1 pressed during - the operation) the name tag of an actor and drop it elsewhere:
-An event may be an action performed by one single actor (blue - text label) or it may involve two actors and is then depicted as an - arrow directed from one actor to another (red text label). Details of - an event can be shown by clicking (press and release the mouse button 1) - on the event label text or on the arrow:
- -The Event Tracer (ET) uses named filters in various
- contexts. An Event Trace filter is an
- filter(TraceData) -> true | {true, NewEvent} | false
-
- TraceData = NewEvent | term()
- NewEvent = record(event)
-
- The interface of the filter function is the same as the the
- filter functions for the good old
The first filter that the trace data is exposed for is
- the collector filter. When a trace event is reported with
-
The collector filter (that is the filter named
-
The collector manages a key/value based dictionary, where - the filters are stored. Updates of the dictionary is - propagated to all subscribing processes. When a viewer is - started it is registered as a subscriber of dictionary updates. -
-In a viewer there is only one filter that is active
- and all trace events that the viewer gets from the
- collector will pass thru that filter. By writing clever
- filters it is possible to customize how the events
- looks like in the viewer. The following filter replaces
- the actor names
If we now add the filter to the running collector: -
- - Fun = fun(E) -> et_demo:mgr_actors(E) end.
- #Fun
- 5> et_collector:dict_insert(Collector, {filter, mgr_actors}, Fun).
- ok
- 6>
- ]]>
- you will see that the
In order to see the nitty gritty details of an event
- you may click on the event in order to start a contents
- viewer for that event. In the contents viewer there is
- also a filter menu in order to enable inspection of the
- event from other views than the one selected in the viewer.
- A click on the
Select the
As you have seen it is possible to use the
-
There are also existing functions in the API that reads from
- various sources and calls
The trace events that are hosted by the collector may be
- stored to file and later be loaded by selecting
It is also possible to perform live tracing of a running
- system by making use of the built-in trace support in
- the Erlang emulator. These Erlang traces can be directed
- to files or to ports. See the reference manual for
-
There are also corresponding trace client types that can
- read the Erlang trace data format from such files or ports.
- The
The default collector filter converts the Erlang trace data
- format into event-records.If you want to perform this
- differently you can of course write your own collector
- filter from scratch. But it may probably save you some
- efforts if you first apply the default filter in
-
Setting up an Erlang tracer on a set of nodes and connecting
- trace clients to the ports of these tracers is not intuitive. In order
- to make this it easier the Event Tracer as a notion of global
- tracing. When used, the
In order to further simplify the tracing you can make use of the
-
In normal operation the
One nice thing with the
Almost all functionality available in the
File menu:
-Close Collector and all Viewers - Close the collector - and all viewers connected to that collector.
-Close other Viewers, but keep Collector - Keep this viewer - and its collector, but close all other viewers connected - to this collector.
-Close this Viewer, but keep Collector - Close this viewer, - but all other viewers and the collector.
-Save Collector to file - Save all events stored in the - collector to file.
-Load Collector from file - Load the collector with - events from a file.
-Viewer menu:
-First - Scroll
Prev - Scroll
Next - Scroll
Last - Scroll
Refresh - Clear
Up 5 - Scroll 5 events backwards.
-Down 5 - Scroll 5 events forward.
-Abort search. Display all. - Switch the display mode to - show all events regardless of any ongoing searches. - Abort the searches.
-Collector menu:
-First - Scroll
Prev - Scroll
Next - Scroll
Last - Scroll
Refresh - Clear
Filters menu:
-ActiveFilter (=) - Start a new viewer window with the - same active filter and scale as the current one.
-ActiveFilter (+) - Start a new viewer window with - the same active filter but a larger scale than the - current one.
-ActiveFilter (-) - Start a new viewer window with - the same active filter but a smaller scale than the - current one.
-collector (0) - Start a new viewer with the collector - filter as active filter.
-AnotherFilter (2) - If more filters are inserted into
- the dictionary, these will turn up here as entries
- in the
Slider and radio buttons:
-Freeze - When true, this means that the viewer - will not read more events from the collector - until set to false.
-Hide From=To - When true, this means that the viewer - will hide all events where the from-actor equals - to its to-actor.
-Hide Unknown - When true, this means that the viewer
- will hide all events where either of the from-actor or
- to-actor is
Detail level - This slider controls the resolution
- of the viewer. Only events with a detail level
Other features:
-Display details of an event - Click on the event name - and a new window will pop up, displaying the contents - of an event.
-Toggle actor search - Normally the viewer will be in a - display mode where all events are shown. By clicking - on an actor name the tool will switch display mode - to only show events with selected actors. -
-Click on an actor and only events with that actor - will be displayed. Click on another actor to include - that actor to the selected ones. Clicking on an already - selected actor will remove it from the collections of - selected actors. When the collection of selected actors - becomes empty the normal mode where all actors are shown - will be entered again.
-Abort actor search with the
Move actor - Drag and drop an actor by first clicking on - the actor name, keeping the button pressed while moving - the cursor to a new location and release the button where - the actor should be moved to.
-The event-records in the ets-table are ordered by their timestamp.
- Which timestamp that should be used is controlled via the
-
File menu:
-Close - Close this window.
-Save - Save the contents of this window to file.
-Filters menu:
-ActiveFilter - Start a new contents viewer window - with the same active filter.
-AnotherFilter (2) - If more filters are inserted into
- the dictionary, these will turn up here as entries
- in the
Hide menu:
-Hide actor in viewer - Known actors are shown as a - named vertical bars in the viewer window. By hiding the - actor, its vertical bar will be removed and the viewer - will be refreshed.
-Hiding the actor is only useful if the
Show actor in viewer - This implies that the actor - will be added as a known actor in the viewer with - its own vertical bar.
-Search menu:
-Forward from this event - Set this event to be the first - event in the viewer and change its display mode to be - enter forward search mode. The actor of this event - (from, to or both) will be added to the list of selected - actors. -
-Reverse from this event - Set this event to be the first - event in the viewer and change its display mode to be - enter reverse search mode. The actor of this event - (from, to or both) will be added to the list of selected - actors. Observe, that the events will be shown in reverse - order. -
-Abort search. Display all - Switch the display mode - of the viewer to show all events regardless of any - ongoing searches. Abort the searches.
-In global trace mode, the collector will automatically start - tracing on all connected Erlang nodes. When a node connects, a port - tracer will be started on that node and a corresponding trace - client on the collector node. By default the global trace pattern - is 'max'.
+ +In global trace mode, the collector will automatically + start tracing on all connected Erlang nodes. When a node + connects, a port tracer will be started on that node and a + corresponding trace client on the collector node.
+Default values:
Iterate over the currently stored events.
-Iterates over the currently stored eventsand applies +
Iterates over the currently stored events and applies a function for each event. The iteration may be performed forwards or backwards and may be limited to a maximum number of events (abs(Limit)).
diff --git a/lib/et/doc/src/et_desc.xmlsrc b/lib/et/doc/src/et_desc.xmlsrc new file mode 100644 index 0000000000..c02517ae01 --- /dev/null +++ b/lib/et/doc/src/et_desc.xmlsrc @@ -0,0 +1,683 @@ + + + +The two major components of the
The interface between the
The main start function is
{ok, Viewer} = et_viewer:start([]).
+ {ok,<0.40.0>}]]>
+
+ A
Collector = et_viewer:get_collector_pid(Viewer).
+ <0.39.0>
+ 3> et_collector:report_event(Collector, 60, my_shell, mnesia_tm, start_outer,
+ 3> "Start outer transaction"),
+ 3> et_collector:report_event(Collector, 40, mnesia_tm, my_shell, new_tid,
+ 3> "New transaction id is 4711"),
+ 3> et_collector:report_event(Collector, 20, my_shell, mnesia_locker, try_write_lock,
+ 3> "Acquire write lock for {my_tab, key}"),
+ 3> et_collector:report_event(Collector, 10, mnesia_locker, my_shell, granted,
+ 3> "You got the write lock for {my_tab, key}"),
+ 3> et_collector:report_event(Collector, 60, my_shell, do_commit,
+ 3> "Perform transaction commit"),
+ 3> et_collector:report_event(Collector, 40, my_shell, mnesia_locker, release_tid,
+ 3> "Release all locks for transaction 4711"),
+ 3> et_collector:report_event(Collector, 60, my_shell, mnesia_tm, delete_transaction,
+ 3> "End of outer transaction"),
+ 3> et_collector:report_event(Collector, 20, my_shell, end_outer,
+ 3> "Transaction returned {atomic, ok}").
+ {ok,{table_handle,<0.39.0>,16402,trace_ts,
+ #Fun}}]]>
+
+ This actually is a simulation of the process
mnesia:write({my_tab, key, val}) end).]]>
+
+ At this stage when we have a couple of
In the sequence chart, the actors (which symbolically has
+ performed the
An
The
false | true | {true, NewEvent}
+
+ TraceData = Event | erlang_trace_data()
+ Event = #event{}
+ NewEvent = #event{}]]>
+
+ The interface of the filter function is the same as the the
+ filter functions for the good old
The first filter that the trace data is exposed for is the
+
All filters (registered in a
The
In each
If we now add the filter to the running
Fun = fun(E) -> et_demo:mgr_actors(E) end.
+ #Fun
+ 5> et_collector:dict_insert(Collector, {filter, mgr_actors}, Fun).
+ ok]]>
+
+ you will see that the
In order to see the nitty gritty details of an
Select the
As you have seen, it is possible to use the
+
There are also existing functions in the API that reads from
+ various sources and calls
The trace
It is also possible to perform live tracing of a running
+ system by making use of the built-in trace support in the
+ Erlang emulator. These Erlang traces can be directed to files
+ or to ports. See the reference manual for
+
There are also corresponding trace client types that can
+ read the Erlang trace data format from such files or ports.
+ The
The default
Setting up an Erlang tracer on a set of nodes and connecting
+ trace clients to the ports of these tracers is not intuitive. In
+ order to make this it easier the
In order to further simplify the tracing, you can make use of
+ the
In normal operation, the
One nice thing with the
Almost all functionality available in the
File menu:
+ +Viewer menu:
+ +Collector menu:
+ +Filters and scaling menu:
+ +Slider and radio buttons:
+ +Other features:
+ +The
File menu:
+ +Filters menu:
+ +Hide menu:
+ +Search menu:
+ +The Erlang code for running the simulated Mnesia transaction example
- in the previous chapter is included in the
If you invoke the
- mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).
-
- And the viewer window will look like:
- - et_demo:sim_trans().
- {ok,{table_handle,<0.30.0>,11,trace_ts,#Fun}}
- 2>
- ]]>
-
- The
The
The
In order to simplify the startup of an
A simple one-liner starts the tool:
-
- erl -pa ../examples -s et_demo
-
- The filters are included by the following parameters:
- -The following piece of code
The
Now we run the
- erl -pa ../examples -s et_demo live_trans
- Erlang (BEAM) emulator version 2002.10.08 [source]
-
- Eshell V2002.10.08 (abort with ^G)
- 1>
-
- Please, explore the different filters in order to see how the traced - transaction can be seen from different point of views:
- -The Event Tracer (ET) tool was initially written in order to - demonstrate how messages where sent over the Megaco protocol. This - were back in the old days before the standard bodies of IETF and ITU - had approved Megaco (also called H.248) as an international - standard.
-In the Megaco application of Erlang/OTP, the code is carefully
- instrumented with calls to
The
- -module(megaco_filter).
- -export([start/0]).
-
- start() ->
- Options =
- [{event_order, event_ts},
- {scale, 3},
- {max_actors, infinity},
- {trace_pattern, {megaco, max}},
- {trace_global, true},
- {dict_insert, {filter, megaco_filter}, fun filter/1},
- {active_filter, megaco_filter},
- {title, "Megaco tracer - Erlang/OTP"}],
- et_viewer:start(Options).
-
- First we start an Erlang node with the a global collector and
- its viewer. The
- erl -sname observer -s megaco_filter
- Erlang (BEAM) emulator version 2002.10.08 [source]
-
- Eshell V2002.10.08 (abort with ^G)
- (observer@amrod)1> et_viewer: search for: [] ++ ["gateway_tt"]
-
- Secondly we start another Erlang node which we connect the - observer node, before we start the application that we want to - trace. In this case we start a Media Gateway Controller that listens - for both TCP and UDP on the text and binary ports for Megaco:
- -
- erl -sname mgc -pa ../../megaco/examples/simple
- Erlang (BEAM) emulator version 2002.10.08 [source]
-
- Eshell V2002.10.08 (abort with ^G)
- (mgc@amrod)1> net:ping(observer@amrod).
- pong
- (mgc@amrod)2> megaco:start().
- ok
- (mgc@amrod)3> megaco_simple_mgc:start().
- {ok,[{ok,2944,
- {megaco_receive_handle,{deviceName,"controller"},
- megaco_pretty_text_encoder,
- [],
- megaco_tcp}},
- {ok,2944,
- {megaco_receive_handle,{deviceName,"controller"},
- megaco_pretty_text_encoder,
- [],
- megaco_udp}},
- {ok,2945,
- {megaco_receive_handle,{deviceName,"controller"},
- megaco_binary_encoder,
- [],
- megaco_tcp}},
- {ok,2945,
- {megaco_receive_handle,{deviceName,"controller"},
- megaco_binary_encoder,
- [],
- megaco_udp}}]}
- (mgc@amrod)4>
-
- And finally we start an Erlang node for the Media Gateways and - connect to the observer node. Each Media Gateway connects to the - controller and sends an initial Service Change message. The controller - accepts the gateways and sends a reply to each one using the same - transport mechanism and message encoding according to the preference - of each gateway. That is all combinations of TCP/IP transport, UDP/IP - transport, text encoding and ASN.1 BER encoding:
- -
- erl -sname mg -pa ../../megaco/examples/simple
- Erlang (BEAM) emulator version 2002.10.08 [source]
-
- Eshell V2002.10.08 (abort with ^G)
- (mg@amrod)1> net:ping(observer@amrod).
- pong
- (mg@amrod)2> megaco_simple_mg:start().
- [{{deviceName,"gateway_tt"},{error,{start_user,megaco_not_started}}},
- {{deviceName,"gateway_tb"},{error,{start_user,megaco_not_started}}},
- {{deviceName,"gateway_ut"},{error,{start_user,megaco_not_started}}},
- {{deviceName,"gateway_ub"},{error,{start_user,megaco_not_started}}}]
- (mg@amrod)3> megaco:start().
- ok
- (mg@amrod)4> megaco_simple_mg:start().
- [{{deviceName,"gateway_tt"},
- {1,
- {ok,[{'ActionReply',0,
- asn1_NOVALUE,
- asn1_NOVALUE,
- [{serviceChangeReply,
- {'ServiceChangeReply',
- [{megaco_term_id,false,["root"]}],
- {serviceChangeResParms,
- {'ServiceChangeResParm',
- {deviceName|...},
- asn1_NOVALUE|...}}}}]}]}}},
- {{deviceName,"gateway_tb"},
- {1,
- {ok,[{'ActionReply',0,
- asn1_NOVALUE,
- asn1_NOVALUE,
- [{serviceChangeReply,
- {'ServiceChangeReply',
- [{megaco_term_id,false,["root"]}],
- {serviceChangeResParms,
- {'ServiceChangeResParm',
- {...}|...}}}}]}]}}},
- {{deviceName,"gateway_ut"},
- {1,
- {ok,[{'ActionReply',0,
- asn1_NOVALUE,
- asn1_NOVALUE,
- [{serviceChangeReply,
- {'ServiceChangeReply',
- [{megaco_term_id,false,["root"]}],
- {serviceChangeResParms,
- {'ServiceChangeResParm',{...}|...}}}}]}]}}},
- {{deviceName,"gateway_ub"},
- {1,
- {ok,[{'ActionReply',0,
- asn1_NOVALUE,
- asn1_NOVALUE,
- [{serviceChangeReply,
- {'ServiceChangeReply',
- [{megaco_term_id,false,["root"]}],
- {serviceChangeResParms,
- {'ServiceChangeResParm'|...}}}}]}]}}}]
- (mg@amrod)5>
-
- The Megaco adopted viewer looks like this, when we have clicked - on the "gateway_tt" actor name in order to only display the events - regarding that actor:
- -A pretty printed Megaco message looks like this:
- -And the corresponding internal form for the same Megaco message - looks like this:
- -The Erlang code for running the simulated
If you invoke the
mnesia:write({my_tab, key, val}) end).]]>
+
+ And the viewer window will look like:
+ + + + {ok, Viewer} = et_viewer:start([]).
+ {ok,<0.40.0>;}
+ 2> et_demo:sim_trans().
+ {ok,{table_handle,<0.45.0>,24596,trace_ts,
+ #Fun}}]]>
+
+
+
+ The
The
The
In order to simplify the startup of an
A simple one-liner starts the tool:
+ +
+
+ The filters are included by the following parameters:
+ + + +The following piece of code
The
Now we run the
et_demo:live_trans().
+ {atomic,ok}]]>
+
+ Please, explore the different filters in order to see how the traced + transaction can be seen from different point of views:
+ + + +The
In the
The
+ Options =
+ [{event_order, event_ts},
+ {scale, 3},
+ {max_actors, infinity},
+ {trace_pattern, {megaco, max}},
+ {trace_global, true},
+ {dict_insert, {filter, megaco_filter}, fun filter/1},
+ {active_filter, megaco_filter},
+ {title, "Megaco tracer - Erlang/OTP"}],
+ et_viewer:start(Options).]]>
+
+ First we start an Erlang node with a global
megaco_filter:start().
+ {ok,<0.48.0>}]]>
+
+ Secondly we start another Erlang node which we connect the + observer node, before we start the application that we want to + trace. In this case we start a Media Gateway Controller that + listens for both TCP and UDP on the text and binary ports for + Megaco:
+ + + + net:ping(observer@falco).
+ pong
+ (mgc@falco)2> megaco:start().
+ ok
+ (mgc@falco)3> megaco_simple_mgc:start().
+ {ok,[{ok,2944,
+ {megaco_receive_handle,{deviceName,"controller"},
+ megaco_pretty_text_encoder,[],megaco_tcp,dynamic}},
+ {ok,2944,
+ {megaco_receive_handle,{deviceName,"controller"},
+ megaco_pretty_text_encoder,[],megaco_udp,dynamic}},
+ {ok,2945,
+ {megaco_receive_handle,{deviceName,"controller"},
+ megaco_binary_encoder,[],megaco_tcp,dynamic}},
+ {ok,2945,
+ {megaco_receive_handle,{deviceName,"controller"},
+ megaco_binary_encoder,[],megaco_udp,dynamic}}]}]]>
+
+ And finally we start an Erlang node for the Media Gateways and + connect to the observer node. Each Media Gateway connects to the + controller and sends an initial Service Change message. The + controller accepts the gateways and sends a reply to each one + using the same transport mechanism and message encoding according + to the preference of each gateway. That is all combinations of + TCP/IP transport, UDP/IP transport, text encoding and ASN.1 BER + encoding:
+ + + + net:ping(observer@falco).
+ pong
+ (mg@falco)2> megaco_simple_mg:start().
+ [{{deviceName,"gateway_tt"},
+ {error,{start_user,megaco_not_started}}},
+ {{deviceName,"gateway_tb"},
+ {error,{start_user,megaco_not_started}}},
+ {{deviceName,"gateway_ut"},
+ {error,{start_user,megaco_not_started}}},
+ {{deviceName,"gateway_ub"},
+ {error,{start_user,megaco_not_started}}}]
+ (mg@falco)3> megaco:start().
+ ok
+ (mg@falco)4> megaco_simple_mg:start().
+ [{{deviceName,"gateway_tt"},
+ {1,
+ {ok,[{'ActionReply',0,asn1_NOVALUE,asn1_NOVALUE,
+ [{serviceChangeReply,
+ {'ServiceChangeReply',
+ [{megaco_term_id,false,["root"]}],
+ {serviceChangeResParms,
+ {'ServiceChangeResParm',
+ {deviceName,"controller"},
+ asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,
+ asn1_NOVALUE}}}}]}]}}},
+ {{deviceName,"gateway_tb"},
+ {1,
+ {ok,[{'ActionReply',0,asn1_NOVALUE,asn1_NOVALUE,
+ [{serviceChangeReply,
+ {'ServiceChangeReply',
+ [{megaco_term_id,false,["root"]}],
+ {serviceChangeResParms,
+ {'ServiceChangeResParm',
+ {deviceName,"controller"},
+ asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,
+ asn1_NOVALUE}}}}]}]}}},
+ {{deviceName,"gateway_ut"},
+ {1,
+ {ok,[{'ActionReply',0,asn1_NOVALUE,asn1_NOVALUE,
+ [{serviceChangeReply,
+ {'ServiceChangeReply',
+ [{megaco_term_id,false,["root"]}],
+ {serviceChangeResParms,
+ {'ServiceChangeResParm',
+ {deviceName,"controller"},
+ asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,
+ asn1_NOVALUE}}}}]}]}}},
+ {{deviceName,"gateway_ub"},
+ {1,
+ {ok,[{'ActionReply',0,asn1_NOVALUE,asn1_NOVALUE,
+ [{serviceChangeReply,
+ {'ServiceChangeReply',
+ [{megaco_term_id,false,["root"]}],
+ {serviceChangeResParms,
+ {'ServiceChangeResParm',
+ {deviceName,"controller"},
+ asn1_NOVALUE,asn1_NOVALUE,
+ asn1_NOVALUE,...}}}}]}]}}}]]]>
+
+ The
A pretty printed
And the corresponding internal form for the same
The Event Tracer (ET) uses the built-in trace mechanism in Erlang - and provides tools for collection and graphical viewing of trace - data.
-The viewed trace data is normally collected from Erlang trace ports - or files.
+ +The
The viewed trace data is normally collected from Erlang trace + ports or files.
This manual describes the Event Tracer (ET) application, as a component - of the Erlang/Open Telecom Platform development environment. It - is assumed that the reader is familiar with the Erlang - Development Environment, which is described in a separate User's - Guide.
+This manual describes the
The following prerequisites is required for understanding the - material in the Event Tracer (ET) User's Guide:
+ material in thefamiliarity with the Erlang system and Erlang programming in - general and the especially the art of Erlang tracing.
+familiarity with the Erlang system and Erlang programming + in general and the especially the art of Erlang tracing.
The application requires Erlang/OTP release R7B or later.
+ +The application requires Erlang/OTP release R13BB or later. If
+ you use the old
In addition to this introductory chapter, the Megaco User's - Guide contains the following chapters:
+ +In addition to this introductory chapter, the
Chapter 2: "Usage" describes the architecture - and typical usage of the application.
+Chapter 2: "Tutorial" provides a walk-through of the
+ various parts of the application. The tutorial is based on
+
Chapter 3: "Description" describes the architecture and typical + usage of the application.
Chapter 3: "Examples" gives some usage examples
+Chapter 4: "Advanced examples" gives some usage examples
Refer to the following documentation for more information about - Event Tracer (ET) and about the Erlang/OTP development system:
+the Reference Manual of the
documentation of basic tracing in
documentation of basic tracing in
Concurrent Programming in Erlang, 2nd Edition (1996), - Prentice-Hall, ISBN 0-13-508301-X.
+Programming Erlang: Software for a Concurrent World by Joe + Armstrong; ISBN: 978-1-93435-600-5
Makes a trace pattern suitable to feed change_pattern/1
-Min detail level deactivates tracing of calls to phone_home/4,5
-Max detail level activates tracing of all calls to phone_home/4,5
+Min detail level deactivates tracing of calls to
Max detail level activates tracing of all calls to
integer(X) detail level activates tracing of all calls to - phone_home/4,5 whose detail level argument is lesser than X.
-See also erlang:trace_pattern/2 for more info about its match_spec()
+See also
Activates/deactivates tracing by changing the current trace pattern.
-Min detail level deactivates tracing of calls to phone_home/4,5
-Max detail level activates tracing of all calls to phone_home/4,5
-integer(X) detail level activates tracing of all calls to - phone_home/4,5 whose detail level argument is lesser than X.
-An empty match spec deactivates tracing of calls to phone_home/4,5
-Other match specs activates tracing of calls to phone_home/4,5 - accordingly with erlang:trace_pattern/2.
+An empty match spec deactivates tracing of calls to
Other match specs activates tracing of calls to
+
Transforms trace data and makes an event record out of it.
-See erlang:trace/3 for more info about the semantics of - the trace data.
-An event record consists of the following fields: - detail_level - Noise has a high level as opposed to essentials. - trace_ts - Time when the trace was generated. - Same as event_ts if 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.
-See et:phone_home/4 and et:phone_home/5 for details.
-Returns: - {true, Event} - where Event is an #event{} record representing the - trace data - true - means that the trace data already is an event - record and that it is valid as it is. - No transformation is needed. - false - means that the trace data is uninteresting and - should be dropped
+ +See
An event record consists of the following fields:
+Noise has a high level as opposed to essentials.
Time when the trace was generated. Same as + event_ts if omitted in trace data.
Time when the event record was created.
From actor, such as sender of a message.
To actor, such as receiver of message.
Label intended to provide a brief event summary.
All nitty gritty details of the event.
See
Returns:
+where Event is an #event{} record representing the + trace data
means that the trace data already is an event + record and that it is valid as it is. No transformation is + needed.
means that the trace data is uninteresting and + should be dropped
The easiest way of using
+
+ Then you send events to the
+
+ The
The number (in this case 85) is an integer from 1 to 100 that + specifies the "detail level" of the message. The higher the + number, the more important it is. This provides a crude form of + priority filtering. Avoid using 100.
+ +The
The module
When you run the
The event tracer framework is made up of four modules:
+ +In addition, you'll probably want to familiarize yourself with
+ the
The
+
+ The parameters to
Erlang tracing is a seething pile of pain that involves
+ reasonably complex knowledge of clever ports, tracing return
+ formats, and specialized tracing
Luckily there is a simplified way to start tracing of
+
+
+ This will start a
These two pieces work in concert. Basically, the
+
You might wonder why these aren't just one module. The
+
The
The
This is perhaps the most central module in the entirety of the
+
Convert
Magically notice traces of the
Carefully prevent translating the
Manage a
The
The specified module flows from your instantiation of the
+
The module that you specify gets passed down (eventually) into
+
The
For those people who want to do general tracing, consult the
+
Create a
Create a
Turn on and pare down debugging
The module
Running through the above, the most important points are:
+ +Turn on global tracing
Set a
Tell
Tell it specifically to trace the
When you run the
-!-! ]` -!-! -! -! ]` -!-! ]` -!]` -!-! ]` -!]` -!-! ]` -!]` -!-! ]` -!]` -!-! ]` -!]` -!-! ]` -!]` -!-! ]` -!:!<(IH!7TKs!;Y1F!!:[N!:eV>!9Vi-!!^sR!7fU"!9Vi3!<1OK -!;Y1F!.i[OebI\pK*A(Nk2s>WJ,~> -! -! :!<(IH!7TKs!;Y1F!!:[N!:eV>!9Vi-!!^sR!7fU"!9Vi3!<1OK -!;Y1F!.i[OebI\pK*A(Nk2s>WJ,~> -! :!<(IJ!7KEt!<:UL!;b7G!!:[N!:eV>!9Vi3!;b7G!<:UL!9Vi3 -!<1OK!;Y1F!.i[OebI\pK*A(Nk2s>WJ,~> -! -! :!<(IJ!7KEt!<:UL!;b7G!!:[N!:eV>!9Vi3!;b7G!<:UL!9Vi3 -!<1OK!;Y1F!.i[OebI\pK*A(Nk2s>WJ,~> -! ]` -!-! ]` -!ec,XKec,UVeGoU"eGoU"!!(RK!!:[N!.i[Oec42"K*A(N -k2s>WJ,~> -! No\0 No\0 -! ec,XKec,UVeGoU"eGoU"!!(RK!!:[N!.i[Oec42"K*A(N -k2s>WJ,~> -! ec,XIec,XLec,U[eGoU"!!(OL!7fU"!7_&Lqpk]Hs4.,Ls4.,L!7h&Ko%!X<'%Hs^ -eGoU"eGoU"eGoU"eGoU"rW)N>q>_)W!!(R"!!(OL!7_&Le^XX"J^o>%s4..%"f21\k.LbF~> -! _)\!!(a,!!(^Q!87DQg=cN,J_G\/s4[L("ektYk.1PC~> -! ec,XIec,XLec,U[eGoU"!!(OL!7fU"!7_&Lqpk]Hs4.,Ls4.,L!7h&Ko%!X<'%Hs^ -eGoU"eGoU"eGoU"eGoU"rW)N>q>_)W!!(R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