diff options
Diffstat (limited to 'lib/et')
37 files changed, 380 insertions, 413 deletions
diff --git a/lib/et/Makefile b/lib/et/Makefile index b93ebef902..f0bb7be211 100644 --- a/lib/et/Makefile +++ b/lib/et/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2002-2009. All Rights Reserved. +# Copyright Ericsson AB 2002-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/doc/src/Makefile b/lib/et/doc/src/Makefile index 532e28f5d3..0257a8f817 100644 --- a/lib/et/doc/src/Makefile +++ b/lib/et/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2002-2012. All Rights Reserved. +# Copyright Ericsson AB 2002-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/doc/src/book.xml b/lib/et/doc/src/book.xml index d3fef1752c..5dddb44454 100644 --- a/lib/et/doc/src/book.xml +++ b/lib/et/doc/src/book.xml @@ -4,7 +4,7 @@ <book xmlns:xi="http://www.w3.org/2001/XInclude"> <header titlestyle="normal"> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/et.xml b/lib/et/doc/src/et.xml index 0ba858cc08..3009b559e1 100644 --- a/lib/et/doc/src/et.xml +++ b/lib/et/doc/src/et.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/et_collector.xml b/lib/et/doc/src/et_collector.xml index e879a119a5..6a85b81ec2 100644 --- a/lib/et/doc/src/et_collector.xml +++ b/lib/et/doc/src/et_collector.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/et_desc.xmlsrc b/lib/et/doc/src/et_desc.xmlsrc index cbb41f700c..29e0ab1fe3 100644 --- a/lib/et/doc/src/et_desc.xmlsrc +++ b/lib/et/doc/src/et_desc.xmlsrc @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -55,13 +55,12 @@ <p></p> <code type="none"><![CDATA[ - % erl -pa et/examples - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] +% erl -pa et/examples +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] - Eshell V5.7.4 (abort with ^G) - 1> {ok, Viewer} = et_viewer:start([]). - {ok,<0.40.0>}]]></code> +Eshell V5.7.4 (abort with ^G) +1> {ok, Viewer} = et_viewer:start([]). +{ok,<0.40.0>}]]></code> <p>A <c>Viewer</c> gets trace <c>Events</c> from its <c>Collector</c> by polling it regularly for more <c>Events</c> to @@ -69,40 +68,38 @@ <c>Collector</c> with <c>et_collector:report_event/6</c>:</p> <code type="none"><![CDATA[ - 2> 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<et_collector.0.62831470>}}]]></code> +2> 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<et_collector.0.62831470>}}]]></code> <p>This actually is a simulation of the process <c>Events</c> caused by a <c>Mnesia</c> transaction that writes a record in a local table:</p> <code type="none"><![CDATA[ - mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).]]></code> +mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).]]></code> <p>At this stage when we have a couple of <c>Events</c>, it is time to show how it looks like in the graphical interface of <c>et_viewer</c>:</p> - <p></p> - <image file="sim_trans.png"> <icaption>A simulated Mnesia transaction which writes one record</icaption> </image> @@ -144,11 +141,11 @@ <p></p> <code type="none"><![CDATA[ - filter(TraceData) -> false | true | {true, NewEvent} +filter(TraceData) -> false | true | {true, NewEvent} - TraceData = Event | erlang_trace_data() - Event = #event{} - NewEvent = #event{}]]></code> +TraceData = Event | erlang_trace_data() +Event = #event{} +NewEvent = #event{}]]></code> <p>The interface of the filter function is the same as the the filter functions for the good old <c>lists:filtermap/2</c>. If the filter @@ -204,10 +201,10 @@ <p></p> <code type="none"><![CDATA[ - 4> Fun = fun(E) -> et_demo:mgr_actors(E) end. - #Fun<erl_eval.6.13229925> - 5> et_collector:dict_insert(Collector, {filter, mgr_actors}, Fun). - ok]]></code> +4> Fun = fun(E) -> et_demo:mgr_actors(E) end. +#Fun<erl_eval.6.13229925> +5> et_collector:dict_insert(Collector, {filter, mgr_actors}, Fun). +ok]]></code> <p>you will see that the <c>Filter</c> menu in all viewers have got a new entry called <c>mgr_actors</c>. Select it, and a new @@ -228,21 +225,16 @@ <c>Contents Viewer</c> window to pop up, showing the <c>Event</c> in the <c>mgr_actors</c> view:</p> - <p></p> - <image file="sim_trans_contents_viewer_mgr_actors.png"> - <icaption>The trace <c>Event</c> in the mgr_actors view</icaption> + <icaption>The trace Event in the mgr_actors view</icaption> </image> <p>Select the <c>all</c> entry in the <c>Filters</c> menu and a new <c>Contents Viewer window</c> will pop up showing the same trace <c>Event</c> in the collectors view:</p> - <p></p> - <image file="sim_trans_contents_viewer_collector.png"> - <icaption>The same trace <c>Event</c> in the collectors - view</icaption> + <icaption>The same trace Event in the collectors view</icaption> </image> </section> @@ -311,7 +303,7 @@ <c>et_collector</c> or <c>et_viewer</c> in order to activate the global tracing. There is no restriction on how many concurrent (anonymous) collectors you can have, but you can only have one - <b>global</b> <c>Collector</c> as its name is registered in + <em>global</em> <c>Collector</c> as its name is registered in <c>global</c>.</p> <p>In order to further simplify the tracing, you can make use of diff --git a/lib/et/doc/src/et_examples.xmlsrc b/lib/et/doc/src/et_examples.xmlsrc index 42e484a241..f4d94f7cb0 100644 --- a/lib/et/doc/src/et_examples.xmlsrc +++ b/lib/et/doc/src/et_examples.xmlsrc @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -55,34 +55,32 @@ <p></p> <code type="none"><![CDATA[ - mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).]]></code> +mnesia:transaction(fun() -> mnesia:write({my_tab, key, val}) end).]]></code> <p>And the viewer window will look like:</p> <p></p> <code type="none"><![CDATA[ - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] - Eshell V5.7.4 (abort with ^G) - 1> {ok, Viewer} = et_viewer:start([]). - {ok,<0.40.0>;} - 2> et_demo:sim_trans(). - {ok,{table_handle,<0.45.0>,24596,trace_ts, - #Fun<et_collector.0.62831470>}}]]></code> +Eshell V5.7.4 (abort with ^G) +1> {ok, Viewer} = et_viewer:start([]). +{ok,<0.40.0>;} +2> et_demo:sim_trans(). +{ok,{table_handle,<0.45.0>,24596,trace_ts, + #Fun<et_collector.0.62831470>}}]]></code> <p></p> <image file="sim_trans.png"> - <icaption>A simulated <c>Mnesia</c> transaction which writes one - record</icaption> + <icaption>A simulated Mnesia transaction which writes one record</icaption> </image> </section> <section> - <title>Some convenient functions used in the <c>Mnesia</c> transaction + <title>Some convenient functions used in the Mnesia transaction example</title> <p>The <c>module_as_actor</c> filter converts the <c>Event @@ -173,21 +171,19 @@ <p></p> <code type="none"><![CDATA[ - erl -pa ../examples - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] +erl -pa ../examples +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] + [async-threads:0] [kernel-poll:false] - Eshell V5.7.4 (abort with ^G) - 1> et_demo:live_trans(). - {atomic,ok}]]></code> +Eshell V5.7.4 (abort with ^G) +1> et_demo:live_trans(). +{atomic,ok}]]></code> <p>Please, explore the different filters in order to see how the traced transaction can be seen from different point of views:</p> - <p></p> - <image file="live_trans.png"> - <icaption>A real <c>Mnesia</c> transaction which writes one record</icaption> + <icaption>A real Mnesia transaction which writes one record</icaption> </image> </section> @@ -215,20 +211,20 @@ <p></p> <code type="none"><![CDATA[ - -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).]]></code> +-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).]]></code> <p>First we start an Erlang node with a global <c>Collector</c> and its <c>Viewer</c>.</p> @@ -236,13 +232,12 @@ <p></p> <code type="none"><![CDATA[ - erl -sname observer - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] +erl -sname observer +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] - Eshell V5.7.4 (abort with ^G) - (observer@falco)1> megaco_filter:start(). - {ok,<0.48.0>}]]></code> +Eshell V5.7.4 (abort with ^G) +(observer@falco)1> megaco_filter:start(). +{ok,<0.48.0>}]]></code> <p>Secondly we start another Erlang node which we connect the observer node, before we start the application that we want to @@ -253,28 +248,27 @@ <p></p> <code type="none"><![CDATA[ - erl -sname mgc -pa ../../megaco/examples/simple - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] - - Eshell V5.7.4 (abort with ^G) - (mgc@falco)1> 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}}]}]]></code> +erl -sname mgc -pa ../../megaco/examples/simple +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] + +Eshell V5.7.4 (abort with ^G) +(mgc@falco)1> 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}}]}]]></code> <p>And finally we start an Erlang node for the Media Gateways and connect to the observer node. Each Media Gateway connects to the @@ -288,94 +282,87 @@ <p></p> <code type="none"><![CDATA[ - Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] - [async-threads:0] [kernel-poll:false] - - Eshell V5.7.4 (abort with ^G) - (mg@falco)1> 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,...}}}}]}]}}}]]]></code> +Erlang R13B03 (erts-5.7.4) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] + +Eshell V5.7.4 (abort with ^G) +(mg@falco)1> 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,...}}}}]}]}}}]]]></code> <p>The <c>Megaco</c> adopted viewer looks like this, when we have clicked - on the <b>[gateway_tt]</b> actor name in order to only display the events + on the <em>[gateway_tt]</em> actor name in order to only display the events regarding that actor:</p> - <p></p> - <image file="megaco_tracer.png"> <icaption>The viewer adopted for Megaco</icaption> </image> <p>A pretty printed <c>Megaco</c> message looks like this:</p> - <p></p> - <image file="megaco_filter.png"> - <icaption>A textual <c>Megaco</c> message</icaption> + <icaption>A textual Megaco message</icaption> </image> <p>And the corresponding internal form for the same <c>Megaco</c> message looks like this:</p> - <p></p> - <image file="megaco_collector.png"> - <icaption>The internal form of a <c>Megaco</c> message</icaption> + <icaption>The internal form of a Megaco message</icaption> </image> </section> diff --git a/lib/et/doc/src/et_intro.xml b/lib/et/doc/src/et_intro.xml index cfc879e43d..729f95647d 100644 --- a/lib/et/doc/src/et_intro.xml +++ b/lib/et/doc/src/et_intro.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/et_selector.xml b/lib/et/doc/src/et_selector.xml index af62401287..441a4dd278 100644 --- a/lib/et/doc/src/et_selector.xml +++ b/lib/et/doc/src/et_selector.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/et_tutorial.xmlsrc b/lib/et/doc/src/et_tutorial.xmlsrc index 6e3b327ee7..b6e1ca141c 100644 --- a/lib/et/doc/src/et_tutorial.xmlsrc +++ b/lib/et/doc/src/et_tutorial.xmlsrc @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2009</year><year>2013</year> + <year>2009</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -75,12 +75,10 @@ <codeinclude file="../../examples/et_display_demo.erl" tag="%module" type="erl"></codeinclude> <p>When you run the <c>et_display_demo:test().</c> function in the - example above, the <c>Viewer</c> window will look like this:</p>. - - <p></p> + example above, the <c>Viewer</c> window will look like this:</p> <image file="coffee_order.png"> - <icaption>Screenshot of the <c>Viewer</c> window</icaption> + <icaption>Screenshot of the Viewer window</icaption> </image> </section> @@ -262,14 +260,11 @@ </list> <p>When you run the <c>et_trace_demo:test()</c> function above, the - <c>Viewer</c> window will look like this screenshot:</p>. + <c>Viewer</c> window will look like this screenshot:</p> - <p></p> - <image file="coffee_order.png"> - <icaption>Screenshot of the <c>Viewer</c> window</icaption> + <icaption>Screenshot of the Viewer window</icaption> </image> </section> - </chapter> diff --git a/lib/et/doc/src/et_viewer.xml b/lib/et/doc/src/et_viewer.xml index c7917b41ce..e0b39636e9 100644 --- a/lib/et/doc/src/et_viewer.xml +++ b/lib/et/doc/src/et_viewer.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/files.mk b/lib/et/doc/src/files.mk index c8721c61fe..e0ea9b0b76 100644 --- a/lib/et/doc/src/files.mk +++ b/lib/et/doc/src/files.mk @@ -1,7 +1,7 @@ #-*-makefile-*- ; force emacs to enter makefile-mode # %CopyrightBegin% # -# Copyright Ericsson AB 2002-2010. All Rights Reserved. +# Copyright Ericsson AB 2002-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/doc/src/notes.xml b/lib/et/doc/src/notes.xml index 6599025d52..ee9e34d14d 100644 --- a/lib/et/doc/src/notes.xml +++ b/lib/et/doc/src/notes.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/part.xml b/lib/et/doc/src/part.xml index d8e5e76685..a282dc2c16 100644 --- a/lib/et/doc/src/part.xml +++ b/lib/et/doc/src/part.xml @@ -4,7 +4,7 @@ <part xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/doc/src/ref_man.xml b/lib/et/doc/src/ref_man.xml index 68ed5a8756..bf131bef85 100644 --- a/lib/et/doc/src/ref_man.xml +++ b/lib/et/doc/src/ref_man.xml @@ -4,7 +4,7 @@ <application xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2002</year><year>2013</year> + <year>2002</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/et/examples/Makefile b/lib/et/examples/Makefile index 215ce6e4cd..fe6811e45d 100644 --- a/lib/et/examples/Makefile +++ b/lib/et/examples/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2002-2012. All Rights Reserved. +# Copyright Ericsson AB 2002-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/examples/et_demo.erl b/lib/et/examples/et_demo.erl index e2a604b451..b0fb29e7c6 100644 --- a/lib/et/examples/et_demo.erl +++ b/lib/et/examples/et_demo.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/include/et.hrl b/lib/et/include/et.hrl index 450044df42..75e82a5c85 100644 --- a/lib/et/include/et.hrl +++ b/lib/et/include/et.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile index 461a52d480..b6347d8b6d 100644 --- a/lib/et/src/Makefile +++ b/lib/et/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2000-2013. All Rights Reserved. +# Copyright Ericsson AB 2000-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/src/et.app.src b/lib/et/src/et.app.src index ddf86beea3..7a5928d6ab 100644 --- a/lib/et/src/et.app.src +++ b/lib/et/src/et.app.src @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2013. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -33,6 +33,6 @@ {registered, [et_collector]}, {applications, [stdlib, kernel]}, {env, []}, - {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14", - "kernel-3.0","erts-6.0"]} + {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.10", + "kernel-3.0","erts-8.0"]} ]}. diff --git a/lib/et/src/et.appup.src b/lib/et/src/et.appup.src index 0fbde99762..491c039ffe 100644 --- a/lib/et/src/et.appup.src +++ b/lib/et/src/et.appup.src @@ -1,7 +1,7 @@ %% -*- erlang -*- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2014. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/src/et.erl b/lib/et/src/et.erl index d38fe917c8..91c17ffdc9 100644 --- a/lib/et/src/et.erl +++ b/lib/et/src/et.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2012. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/src/et_collector.erl b/lib/et/src/et_collector.erl index 56e59461b2..aba90b0be1 100644 --- a/lib/et/src/et_collector.erl +++ b/lib/et/src/et_collector.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2013. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -27,8 +27,7 @@ -behaviour(gen_server). %% External exports --export([ - start_link/1, +-export([start_link/1, stop/1, report/2, @@ -55,8 +54,7 @@ dict_delete/2, dict_lookup/2, dict_match/2, - multicast/2 - ]). + multicast/2]). %% Internal export -export([monitor_trace_port/2]). @@ -258,7 +256,7 @@ parse_opt(BadList, _S, _Dict, _Clients) -> {error, {bad_option_list, BadList}}. start_clients(CollectorPid, [{Type, Parameters} | T]) -> - start_trace_client(CollectorPid, Type, Parameters), + _ = start_trace_client(CollectorPid, Type, Parameters), start_clients(CollectorPid, T); start_clients(CollectorPid, []) -> {ok, CollectorPid}. @@ -892,7 +890,7 @@ init([InitialS, Dict]) -> process_flag(trap_exit, true), case InitialS#state.parent_pid of undefined -> - ignore; + ok; Pid when is_pid(Pid) -> link(Pid) end, @@ -914,7 +912,7 @@ init_global(S) -> Spec = trace_spec_wrapper(EventFun, EndFun, {ok, self()}), dbg:tracer(process, Spec), et_selector:change_pattern(S#state.trace_pattern), - net_kernel:monitor_nodes(true), + ok = net_kernel:monitor_nodes(true), lists:foreach(fun(N) -> self() ! {nodeup, N} end, nodes()), S#state{trace_nodes = [node()]}; false -> @@ -1001,7 +999,7 @@ handle_call({save_event_file, FileName, Options}, _From, S) -> %% insert() -> %% case S2#state.file of %% undefined -> - %% ignore; + %% ok; %% F -> %% Fd = F#file.desc, %% ok = disk_log:log(Fd, Event) @@ -1010,7 +1008,7 @@ handle_call({save_event_file, FileName, Options}, _From, S) -> Fun = fun({_, E}, A) -> ok = disk_log:log(Fd, E), A end, Tab = S#state.event_tab, Reply = tab_iterate(Fun, Tab, ets:first(Tab), ok), - disk_log:close(Fd), + ok = disk_log:close(Fd), {Reply, S} %% all -> %% Reply = tab_iterate(WriteFun, Tab, ok), @@ -1033,7 +1031,7 @@ handle_call({save_event_file, FileName, Options}, _From, S) -> handle_call({change_pattern, Pattern}, _From, S) -> Ns = S#state.trace_nodes, - rpc:multicall(Ns, et_selector, change_pattern, [Pattern]), + {_,[]} = rpc:multicall(Ns, et_selector, change_pattern, [Pattern]), Reply = {old_pattern, S#state.trace_pattern}, S2 = S#state{trace_pattern = Pattern}, reply(Reply, S2); @@ -1045,8 +1043,9 @@ handle_call(clear_table, _From, S) -> handle_call(stop, _From, S) -> do_multicast(S#state.subscribers, close), case S#state.trace_global of - true -> rpc:multicall(S#state.trace_nodes, dbg, stop_clear, []); - false -> ignore + true -> {_,[]} = rpc:multicall(S#state.trace_nodes, dbg, stop_clear, []), + ok; + false -> ok end, {stop, shutdown, ok, S}; handle_call(Request, From, S) -> @@ -1239,8 +1238,8 @@ tab_iterate(Fun, Tab, Key, Acc) -> file_open(F) -> Fd = make_ref(), case F#file.file_opt of - write -> file:rename(F#file.name, F#file.name ++ ".OLD"); - append -> ignore + write -> ok = file:rename(F#file.name, F#file.name ++ ".OLD"); + append -> ok end, Args = [{file, F#file.name}, {name, Fd}, {repair, true}, {mode, read_write}], @@ -1278,7 +1277,7 @@ do_multicast([], _Msg) -> opt_unlink(Pid) -> if Pid =:= undefined -> - ignore; + ok; true -> unlink(Pid) end. diff --git a/lib/et/src/et_internal.hrl b/lib/et/src/et_internal.hrl index 01c7303d0b..fdcd6f3dcc 100644 --- a/lib/et/src/et_internal.hrl +++ b/lib/et/src/et_internal.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/src/et_selector.erl b/lib/et/src/et_selector.erl index 708a0b4cd8..a0297c21d1 100644 --- a/lib/et/src/et_selector.erl +++ b/lib/et/src/et_selector.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -23,11 +23,9 @@ -module(et_selector). --export([ - make_pattern/1, +-export([make_pattern/1, change_pattern/1, - parse_event/2 - ]). + parse_event/2]). -compile([{nowarn_deprecated_function,[{erlang,now,0}]}]). @@ -535,7 +533,7 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) -> {from, From}, {to, From}, {mfa, MFA}]}}; % MFA | 0 - gc_start -> + gc_minor_start -> DetailLevel = 80, [GcKeyValueList] = Contents, {true, #event{detail_level = DetailLevel, @@ -549,7 +547,7 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) -> {from, From}, {to, From}, {gc_items, GcKeyValueList}]}}; - gc_end -> + gc_minor_end -> DetailLevel = 85, [GcKeyValueList] = Contents, {true, #event{detail_level = DetailLevel, @@ -559,10 +557,38 @@ parse_event(Mod, Trace, ParsedTS, ReportedTS, From, Label, Contents) -> to = From, label = Label, contents = [{label, Label}, - {detail_level, DetailLevel}, - {from, From}, - {to, From}, - {gc_items, GcKeyValueList}]}}; + {detail_level, DetailLevel}, + {from, From}, + {to, From}, + {gc_items, GcKeyValueList}]}}; + gc_major_start -> + DetailLevel = 80, + [GcKeyValueList] = Contents, + {true, #event{detail_level = DetailLevel, + trace_ts = ReportedTS, + event_ts = ParsedTS, + from = From, + to = From, + label = Label, + contents = [{label, Label}, + {detail_level, DetailLevel}, + {from, From}, + {to, From}, + {gc_items, GcKeyValueList}]}}; + gc_major_end -> + DetailLevel = 85, + [GcKeyValueList] = Contents, + {true, #event{detail_level = DetailLevel, + trace_ts = ReportedTS, + event_ts = ParsedTS, + from = From, + to = From, + label = Label, + contents = [{label, Label}, + {detail_level, DetailLevel}, + {from, From}, + {to, From}, + {gc_items, GcKeyValueList}]}}; _ -> error_logger:format("~p(~p): Ignoring unknown trace type -> ~p~n~n", [?MODULE, ?LINE, Trace]), diff --git a/lib/et/src/et_viewer.erl b/lib/et/src/et_viewer.erl index 1a962df147..3928764c7f 100644 --- a/lib/et/src/et_viewer.erl +++ b/lib/et/src/et_viewer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2013. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/src/et_wx_contents_viewer.erl b/lib/et/src/et_wx_contents_viewer.erl index 46898c6fbf..247dd4c7ba 100644 --- a/lib/et/src/et_wx_contents_viewer.erl +++ b/lib/et/src/et_wx_contents_viewer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2012. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ start_link(Options) -> S#state.parent_pid =/= self() -> unlink(Pid); true -> - ignore + ok end, {ok, Pid} catch @@ -242,11 +242,12 @@ handle_event(#wx{id = Id, S) -> case proplists:get_value(Id, S#state.menu_data) of undefined -> - ignore; + ok; Data when is_record(Data, filter) -> F = Data, - ChildState= S#state{active_filter = F#filter.name}, - wx_object:start_link(?MODULE, [ChildState], []); + ChildState = S#state{active_filter = F#filter.name}, + _ = wx_object:start_link(?MODULE, [ChildState], []), + ok; {hide, Actors} -> send_viewer_event(S, {delete_actors, Actors}); {show, Actors} -> @@ -267,7 +268,7 @@ handle_event(#wx{id = Id, TimeStamp = case S#state.event_order of trace_ts -> Event#event.trace_ts; - event_ts -> Event#event.event_ts + event_ts -> Event#event.event_ts end, FileName = lists:flatten(["et_contents_viewer_", now_to_string(TimeStamp), ".txt"]), Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT, @@ -275,7 +276,7 @@ handle_event(#wx{id = Id, case select_file(S#state.frame, Msg, filename:absname(FileName), Style) of {ok, FileName2} -> Bin = list_to_binary(event_to_string(Event, S#state.event_order)), - file:write_file(FileName2, Bin); + ok = file:write_file(FileName2, Bin); cancel -> ok end, @@ -351,19 +352,21 @@ handle_event(#wx{event = #wxKey{rawCode = KeyCode}}, S) -> $0 -> case lists:keysearch(?DEFAULT_FILTER_NAME, #filter.name, S#state.filters) of {value, F} when is_record(F, filter) -> - ChildState= S#state{active_filter = F#filter.name}, - wx_object:start_link(?MODULE, [ChildState], []); + ChildState = S#state{active_filter = F#filter.name}, + _ = wx_object:start_link(?MODULE, [ChildState], []), + ok; false -> - ignore + ok end, {noreply, S}; Int when is_integer(Int), Int > $0, Int =< $9 -> case catch lists:nth(Int-$0, S#state.filters) of F when is_record(F, filter) -> - ChildState= S#state{active_filter = F#filter.name}, - wx_object:start_link(?MODULE, [ChildState], []); + ChildState = S#state{active_filter = F#filter.name}, + _ = wx_object:start_link(?MODULE, [ChildState], []), + ok; {'EXIT', _} -> - ignore + ok end, {noreply, S}; @@ -443,11 +446,11 @@ create_window(S) -> Title = lists:concat([?MODULE, " (filter: ", Name, ")"]), WinOpt = [{size, {W,H}}], Frame = wxFrame:new(wx:null(), ?wxID_ANY, Title, WinOpt), - wxFrame:createStatusBar(Frame), + _ = wxFrame:createStatusBar(Frame), Panel = wxPanel:new(Frame, []), Bar = wxMenuBar:new(), - wxFrame:setMenuBar(Frame,Bar), + _ = wxFrame:setMenuBar(Frame,Bar), create_file_menu(Bar), Editor = wxTextCtrl:new(Panel, ?wxID_ANY, [{style, 0 bor ?wxDEFAULT @@ -457,21 +460,21 @@ create_window(S) -> bor ?wxTE_DONTWRAP}]), Font = wxFont:new(10, ?wxFONTFAMILY_TELETYPE, ?wxNORMAL, ?wxNORMAL,[]), TextAttr = wxTextAttr:new(?wxBLACK, [{font, Font}]), - wxTextCtrl:setDefaultStyle(Editor, TextAttr), + _ = wxTextCtrl:setDefaultStyle(Editor, TextAttr), Sizer = wxBoxSizer:new(?wxHORIZONTAL), - wxSizer:add(Sizer, Editor, [{flag, ?wxEXPAND}, {proportion, 1}]), + _ = wxSizer:add(Sizer, Editor, [{flag, ?wxEXPAND}, {proportion, 1}]), FilteredEvent = config_editor(Editor, S), S2 = S#state{win = Frame, panel = Panel, filtered_event = FilteredEvent}, HideData = create_hide_menu(Bar, S2), SearchData = create_search_menu(Bar, S2), FilterData = create_filter_menu(Bar, S#state.filters), - wxFrame:connect(Frame, command_menu_selected, []), - wxFrame:connect(Frame, key_up), - wxFrame:connect(Frame, close_window, [{skip,true}]), - wxFrame:setFocus(Frame), - wxPanel:setSizer(Panel, Sizer), - wxSizer:fit(Sizer, Panel), - wxFrame:show(Frame), + _ = wxFrame:connect(Frame, command_menu_selected, []), + _ = wxFrame:connect(Frame, key_up), + _ = wxFrame:connect(Frame, close_window, [{skip,true}]), + _ = wxFrame:setFocus(Frame), + _ = wxPanel:setSizer(Panel, Sizer), + _ = wxSizer:fit(Sizer, Panel), + _ = wxFrame:show(Frame), S2#state{menu_data = HideData++SearchData++FilterData, editor = Editor, frame = Frame}. menuitem(Menu, Id, Text, UserData) -> @@ -480,16 +483,17 @@ menuitem(Menu, Id, Text, UserData) -> create_file_menu(Bar) -> Menu = wxMenu:new([]), - wxMenu:append(Menu, ?wxID_SAVE, "Save"), - wxMenu:append(Menu, ?wxID_PRINT,"Print"), - wxMenu:appendSeparator(Menu), - wxMenu:append(Menu, ?wxID_EXIT, "Close"), - wxMenuBar:append(Bar, Menu, "File"). + _ = wxMenu:append(Menu, ?wxID_SAVE, "Save"), + _ = wxMenu:append(Menu, ?wxID_PRINT,"Print"), + _ = wxMenu:appendSeparator(Menu), + _ = wxMenu:append(Menu, ?wxID_EXIT, "Close"), + _ = wxMenuBar:append(Bar, Menu, "File"), + ok. create_filter_menu(Bar, Filters) -> Menu = wxMenu:new([]), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Select Filter"), [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Select Filter"), [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), Item = fun(F, {N,Acc}) when F#filter.name =:= ?DEFAULT_FILTER_NAME-> Label = lists:concat([pad_string(F#filter.name, 20, $\ , right), "(0)"]), MenuItem = menuitem(Menu, ?wxID_ANY, Label, F), @@ -502,7 +506,7 @@ create_filter_menu(Bar, Filters) -> end, Filters2 = lists:keysort(#filter.name, Filters), {_,MenuData} = lists:foldl(Item, {1, []}, Filters2), - wxMenuBar:append(Bar, Menu, "Filters"), + _ = wxMenuBar:append(Bar, Menu, "Filters"), MenuData. create_hide_menu(Bar, S) -> @@ -515,33 +519,33 @@ create_hide_menu(Bar, S) -> S#state.viewer_pid =:= undefined -> ignore; From =:= To -> - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Hide actor in Viewer "), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Hide actor in Viewer "), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), Hide = menuitem(Menu, ?wxID_ANY, "From=To (f|t|b)", {hide, [From]}), - wxMenu:appendSeparator(Menu), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Show actor in Viewer "), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Show actor in Viewer "), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), Show = menuitem(Menu, ?wxID_ANY, "From=To (F|T|B)", {show, [From]}), [Show,Hide]; true -> - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Hide actor in Viewer "), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Hide actor in Viewer "), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), Hide = [menuitem(Menu, ?wxID_ANY, "From (f)", {hide, [From]}), menuitem(Menu, ?wxID_ANY, "To (t)", {hide, [To]}), menuitem(Menu, ?wxID_ANY, "Both (b)", {hide, [From, To]})], - wxMenu:appendSeparator(Menu), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Show actor in Viewer "), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Show actor in Viewer "), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), Show = [menuitem(Menu, ?wxID_ANY, "From (F)", {show, [From]}), menuitem(Menu, ?wxID_ANY, "To (T)", {show, [To]}), menuitem(Menu, ?wxID_ANY, "Both (B)", {show, [From, To]})], Show++Hide end, - wxMenuBar:append(Bar, Menu, "Hide"), + _ = wxMenuBar:append(Bar, Menu, "Hide"), MenuData. create_search_menu(Bar, S) -> @@ -549,9 +553,9 @@ create_search_menu(Bar, S) -> E = S#state.filtered_event, From = E#event.from, To = E#event.to, - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Search in Viewer "), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Search in Viewer "), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), MenuData = if S#state.viewer_pid =:= undefined -> @@ -571,7 +575,7 @@ create_search_menu(Bar, S) -> menuitem(Menu, ?wxID_ANY, "Reverse from this event (r)", {mode, ModeR}), menuitem(Menu, ?wxID_ANY, "Abort search. Display all (a)", {mode, all})] end, - wxMenuBar:append(Bar, Menu, "Search"), + _ = wxMenuBar:append(Bar, Menu, "Search"), MenuData. config_editor(Editor, S) -> @@ -668,9 +672,10 @@ pad_string(String, MinLen, Char, Dir) when is_integer(MinLen), MinLen >= 0 -> send_viewer_event(S, Event) -> case S#state.viewer_pid of ViewerPid when is_pid(ViewerPid) -> - ViewerPid ! {et, Event}; + ViewerPid ! {et, Event}, + ok; undefined -> - ignore + ok end. select_file(Frame, Message, DefaultFile, Style) -> diff --git a/lib/et/src/et_wx_viewer.erl b/lib/et/src/et_wx_viewer.erl index 1e71880b79..9613299e6b 100644 --- a/lib/et/src/et_wx_viewer.erl +++ b/lib/et/src/et_wx_viewer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2011. All Rights Reserved. +%% Copyright Ericsson AB 2000-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -320,8 +320,8 @@ init([S]) when is_record(S, state) -> undefined -> ok; ParentPid -> link(ParentPid) end, - wx:new(), - wx:debug(S#state.wx_debug), + _ = wx:new(), + _ = wx:debug(S#state.wx_debug), et_collector:dict_insert(S#state.collector_pid, {subscriber, self()}, ?MODULE), @@ -532,26 +532,25 @@ handle_info(#wx{id=Id, event = #wxCommand{type = command_menu_selected}}, S=#sta load_all -> Style = ?wxFD_OPEN bor ?wxFD_OVERWRITE_PROMPT, Msg = "Select a file to load events from", - S2 = - case select_file(S#state.frame, Msg, S#state.event_file, Style) of - {ok, NewFile} -> - et_collector:start_trace_client(CollectorPid, event_file, NewFile), - S#state{event_file = NewFile}; - cancel -> - S - end, + S2 = case select_file(S#state.frame, Msg, S#state.event_file, Style) of + {ok, NewFile} -> + _ = et_collector:start_trace_client(CollectorPid, event_file, NewFile), + S#state{event_file = NewFile}; + cancel -> + S + end, noreply(S2); save_all -> Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT, Msg = "Select a file to save events to", - S2 = - case select_file(S#state.frame, Msg, S#state.event_file, Style) of - {ok, NewFile} -> - et_collector:save_event_file(CollectorPid, NewFile, [existing, write, keep]), - S#state{event_file = NewFile}; - cancel -> - S - end, + S2 = case select_file(S#state.frame, Msg, S#state.event_file, Style) of + {ok, NewFile} -> + ok = et_collector:save_event_file(CollectorPid, NewFile, + [existing, write, keep]), + S#state{event_file = NewFile}; + cancel -> + S + end, noreply(S2); print_setup -> S2 = print_setup(S), @@ -787,7 +786,7 @@ handle_info(#wx{event = #wxKey{keyCode = KeyCode, shiftDown = SD}}, S) -> noreply(S) end; handle_info(#wx{event = #wxScroll{type = scroll_changed}} = Wx, S) -> - get_latest_scroll(Wx), + _ = get_latest_scroll(Wx), Pos = wxScrollBar:getThumbPosition(S#state.scroll_bar), {_, LineTopY, LineBotY} = calc_y(S), Range = LineBotY - LineTopY, @@ -1107,7 +1106,7 @@ pick_n([Head | Tail], N, Acc) when N > 0 -> pick_n(Tail, N - 1, [Head | Acc]). close_all(S) -> - close_all_others(S), + _ = close_all_others(S), wxFrame:destroy(S#state.frame), opt_unlink(S#state.parent_pid), {stop, shutdown, S}. @@ -1115,12 +1114,12 @@ close_all(S) -> close_all_others(S) -> Fun = fun({{subscriber, Pid}, _}) -> - if - Pid =:= self() -> - ignore; + if Pid =:= self() -> + ok; true -> unlink(Pid), - Pid ! {et, close} + Pid ! {et, close}, + ok end end, All = et_collector:dict_match(S#state.collector_pid, @@ -1208,9 +1207,9 @@ create_main_window(S) -> CheckBoxData = [{wxCheckBox:getId(HideActions), hide_actions}, {wxCheckBox:getId(HideActors), hide_actors}], wxPanel:connect(Panel, command_checkbox_clicked), - wxSizer:add(CheckSizer, HideActions), - wxSizer:add(CheckSizer,HideActors), - wxSizer:add(OptSizer, CheckSizer, [{border, 10}, {flag, ?wxALL}]), + _ = wxSizer:add(CheckSizer, HideActions), + _ = wxSizer:add(CheckSizer,HideActors), + _ = wxSizer:add(OptSizer, CheckSizer, [{border, 10}, {flag, ?wxALL}]), DetailLevelBox = wxStaticBoxSizer:new(?wxHORIZONTAL, Panel, [{label, "Detail level"}]), @@ -1222,22 +1221,21 @@ create_main_window(S) -> {size, {200,-1}}]), wxStatusBar:setStatusText(StatusBar, where_text(S)), wxFrame:connect(Frame, command_slider_updated), - wxSizer:add(DetailLevelBox, DetailLevel), - wxSizer:add(OptSizer, DetailLevelBox, [{border, 10}, {flag, ?wxALL}]), - wxSizer:addStretchSpacer(OptSizer), - wxSizer:add(MainSizer, OptSizer), - wxSizer:add(MainSizer, - wxStaticLine:new(Panel, [{style, ?wxLI_HORIZONTAL}]), - [{flag, ?wxEXPAND}]), + _ = wxSizer:add(DetailLevelBox, DetailLevel), + _ = wxSizer:add(OptSizer, DetailLevelBox, [{border, 10}, {flag, ?wxALL}]), + _ = wxSizer:addStretchSpacer(OptSizer), + _ = wxSizer:add(MainSizer, OptSizer), + _ = wxSizer:add(MainSizer, wxStaticLine:new(Panel, [{style, ?wxLI_HORIZONTAL}]), + [{flag, ?wxEXPAND}]), CanvasSizer = wxBoxSizer:new(?wxHORIZONTAL), Canvas = wxPanel:new(Panel, [{style, ?wxFULL_REPAINT_ON_RESIZE}]), {CanvasW,CanvasH} = wxPanel:getSize(Canvas), ScrollBar = wxScrollBar:new(Panel, ?wxID_ANY, [{style, ?wxSB_VERTICAL}]), - wxSizer:add(CanvasSizer, Canvas, [{flag, ?wxEXPAND}, {proportion, 1}]), - wxSizer:add(CanvasSizer, ScrollBar, [{flag, ?wxEXPAND}]), - wxSizer:add(MainSizer, CanvasSizer, [{flag, ?wxEXPAND}, {proportion, 1}]), + _ = wxSizer:add(CanvasSizer, Canvas, [{flag, ?wxEXPAND}, {proportion, 1}]), + _ = wxSizer:add(CanvasSizer, ScrollBar, [{flag, ?wxEXPAND}]), + _ = wxSizer:add(MainSizer, CanvasSizer, [{flag, ?wxEXPAND}, {proportion, 1}]), wxPanel:connect(Canvas, left_down), wxPanel:connect(Canvas, left_up), wxPanel:connect(Canvas, right_up), @@ -1337,8 +1335,7 @@ menuitem(Menu, Id, Text, UserData) -> create_file_menu(Bar) -> Menu = wxMenu:new([]), - Data = [ - menuitem(Menu, ?wxID_ANY, "Clear all events in the Collector", clear_all), + Data = [menuitem(Menu, ?wxID_ANY, "Clear all events in the Collector", clear_all), menuitem(Menu, ?wxID_ANY, "Load events to the Collector from file", load_all), menuitem(Menu, ?wxID_ANY, "Save all events in the Collector to file", save_all), @@ -1348,51 +1345,44 @@ create_file_menu(Bar) -> menuitem(Menu, ?wxID_ANY, "Close this Viewer", close), menuitem(Menu, ?wxID_ANY, "Close all other Viewers, but this (c)", close_all_others), - menuitem(Menu, ?wxID_ANY, "Close all Viewers and the Collector) (C) ", close_all) - ], - wxMenu:insertSeparator(Menu, 3), - wxMenu:insertSeparator(Menu, 7), + menuitem(Menu, ?wxID_ANY, "Close all Viewers and the Collector) (C) ", close_all)], + _ = wxMenu:insertSeparator(Menu, 3), + _ = wxMenu:insertSeparator(Menu, 7), wxMenuBar:append(Bar, Menu, "File"), Data. create_viewer_menu(Bar) -> Menu = wxMenu:new([]), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Scroll this Viewer"), - [{enable, false}]), - wxMenu:appendSeparator(Menu), - D1 = [ - menuitem(Menu, ?wxID_ANY, "First (f)", first), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Scroll this Viewer"), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), + D1 = [menuitem(Menu, ?wxID_ANY, "First (f)", first), menuitem(Menu, ?wxID_ANY, "Last (l)", last), menuitem(Menu, ?wxID_ANY, "Prev (p)", prev), menuitem(Menu, ?wxID_ANY, "Next (n)", next), - menuitem(Menu, ?wxID_ANY, "Refresh (r)", refresh) - ], - wxMenu:appendSeparator(Menu), - D2 = [ - menuitem(Menu, ?wxID_ANY, "Up 5 (Up)", up), - menuitem(Menu, ?wxID_ANY, "Down 5 (Down)", down) - ], - wxMenu:appendSeparator(Menu), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Actor visibility in this Viewer"), - [{enable, false}]), - wxMenu:appendSeparator(Menu), + menuitem(Menu, ?wxID_ANY, "Refresh (r)", refresh)], + _ = wxMenu:appendSeparator(Menu), + D2 = [menuitem(Menu, ?wxID_ANY, "Up 5 (Up)", up), + menuitem(Menu, ?wxID_ANY, "Down 5 (Down)", down)], + _ = wxMenu:appendSeparator(Menu), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Actor visibility in this Viewer"), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), D3 = [menuitem(Menu, ?wxID_ANY, "Display all actors (a)", display_all)], - wxMenuBar:append(Bar, Menu, "Viewer"), + _ = wxMenuBar:append(Bar, Menu, "Viewer"), [D1,D2,D3]. create_collector_menu(Bar) -> Menu = wxMenu:new([]), - wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Scroll all Viewers"), - [{enable, false}]), - wxMenu:appendSeparator(Menu), - Data = [ - menuitem(Menu, ?wxID_ANY, "First (F)", first_all), + _ = wxMenuItem:enable(wxMenu:append(Menu, ?wxID_ANY, "Scroll all Viewers"), + [{enable, false}]), + _ = wxMenu:appendSeparator(Menu), + Data = [menuitem(Menu, ?wxID_ANY, "First (F)", first_all), menuitem(Menu, ?wxID_ANY, "Last (L)", last_all), menuitem(Menu, ?wxID_ANY, "Prev (P)", prev_all), menuitem(Menu, ?wxID_ANY, "Next (N)", next_all), - menuitem(Menu, ?wxID_ANY, "Refresh (R)", refresh_all) - ], - wxMenuBar:append(Bar, Menu, "Collector"), + menuitem(Menu, ?wxID_ANY, "Refresh (R)", refresh_all)], + _ = wxMenuBar:append(Bar, Menu, "Collector"), Data. create_filter_menu(S=#state{filter_menu = {Menu,Data}}, ActiveFilterName, Filters) -> @@ -1421,21 +1411,19 @@ create_filter_menu(S=#state{filter_menu = {Menu,Data}}, ActiveFilterName, Filter Same = lists:concat([pad_string(ActiveFilterName, 20), "(=) same scale"]), Larger = lists:concat([pad_string(ActiveFilterName, 20), "(+) bigger scale"]), Smaller = lists:concat([pad_string(ActiveFilterName, 20), "(-) smaller scale"]), - D2 = [ - menuitem(Menu, ?wxID_ANY, Same, {data, Filter, 0}), + D2 = [menuitem(Menu, ?wxID_ANY, Same, {data, Filter, 0}), menuitem(Menu, ?wxID_ANY, Smaller, {data, Filter, -1}), menuitem(Menu, ?wxID_ANY, Larger, {data, Filter, 1}), wxMenu:appendSeparator(Menu), I2 = wxMenu:append(Menu, ?wxID_ANY, "New Filter Same Scale"), - wxMenu:appendSeparator(Menu) - ], - wxMenuItem:enable(I2, [{enable,false}]), + wxMenu:appendSeparator(Menu)], + _ = wxMenuItem:enable(I2, [{enable,false}]), {_,D3} = lists:foldl(Item, {1,[]}, Filters), S#state{filter_menu = {Menu, lists:flatten([D1,D2,D3])}}. create_help_menu(Bar) -> Menu = wxMenu:new([]), - menuitem(Menu, ?wxID_HELP, "Info", help), + _ = menuitem(Menu, ?wxID_HELP, "Info", help), wxMenuBar:append(Bar, Menu, "Help"). clear_canvas(S) -> diff --git a/lib/et/src/modules.mk b/lib/et/src/modules.mk index 0568306b65..4d538fae44 100644 --- a/lib/et/src/modules.mk +++ b/lib/et/src/modules.mk @@ -1,7 +1,7 @@ #-*-makefile-*- ; force emacs to enter makefile-mode # %CopyrightBegin% # -# Copyright Ericsson AB 2001-2013. All Rights Reserved. +# Copyright Ericsson AB 2001-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/subdirs.mk b/lib/et/subdirs.mk index 6568459be1..fb7fb8dbc9 100644 --- a/lib/et/subdirs.mk +++ b/lib/et/subdirs.mk @@ -1,7 +1,7 @@ #-*-makefile-*- ; force emacs to enter makefile-mode # %CopyrightBegin% # -# Copyright Ericsson AB 2002-2009. All Rights Reserved. +# Copyright Ericsson AB 2002-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/test/Makefile b/lib/et/test/Makefile index 0434d4ebfd..45ea2c2ce0 100644 --- a/lib/et/test/Makefile +++ b/lib/et/test/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2009-2012. All Rights Reserved. +# Copyright Ericsson AB 2009-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/test/et_SUITE.erl b/lib/et/test/et_SUITE.erl index 4a26b46439..199aff43a8 100644 --- a/lib/et/test/et_SUITE.erl +++ b/lib/et/test/et_SUITE.erl @@ -16,7 +16,8 @@ %% -module(et_SUITE). --compile([export_all]). +-export([suite/0, all/0]). +-export([app/1, appup/1]). -include_lib("common_test/include/ct.hrl"). suite() -> @@ -25,27 +26,10 @@ suite() -> all() -> [app, appup]. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - -app() -> - [{doc, "Test that the et app file is ok"}]. +%% Test that the et app file is ok app(Config) when is_list(Config) -> ok = ?t:app_test(et). -appup() -> - [{doc, "Test that the et appup file is ok"}]. +%% Test that the et appup file is ok appup(Config) when is_list(Config) -> ok = ?t:appup_test(et). diff --git a/lib/et/test/et_test_lib.erl b/lib/et/test/et_test_lib.erl index 6e252de4e5..df2c308b28 100644 --- a/lib/et/test/et_test_lib.erl +++ b/lib/et/test/et_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/test/et_test_lib.hrl b/lib/et/test/et_test_lib.hrl index 9f2a432e04..ee1a72d991 100644 --- a/lib/et/test/et_test_lib.hrl +++ b/lib/et/test/et_test_lib.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 165a2bca49..6475b6706b 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2011. All Rights Reserved. +%% Copyright Ericsson AB 2009-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -19,11 +19,10 @@ -module(et_wx_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, - init_per_suite/1, end_per_suite/1, - init_per_testcase/2, end_per_testcase/2]). - --compile(export_all). +-export([all/0, suite/0, + init_per_testcase/2, end_per_testcase/2, + init_per_suite/1, end_per_suite/1]). +-export([start_all_windows/1]). -include("et_test_lib.hrl"). @@ -40,21 +39,13 @@ end_per_testcase(Func,Config) -> et_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{ct_hooks,[ts_install_cth]}]. + +suite() -> + [{ct_hooks,[ts_install_cth]}]. all() -> [start_all_windows]. -groups() -> - []. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - %% The test cases %% Display all windows and see if something crashes diff --git a/lib/et/test/ett b/lib/et/test/ett index 53aaeada55..c5b89ea367 100755 --- a/lib/et/test/ett +++ b/lib/et/test/ett @@ -1,7 +1,7 @@ #! /bin/sh -f # %CopyrightBegin% # -# Copyright Ericsson AB 2009-2010. All Rights Reserved. +# Copyright Ericsson AB 2009-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/et/test/ett.erl b/lib/et/test/ett.erl index e78f6c392e..b1b769b7ac 100644 --- a/lib/et/test/ett.erl +++ b/lib/et/test/ett.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. |