From 67b38c36eaa9b6d3edb80df75637f0e8cd1823f3 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 28 Sep 2015 15:37:41 +0200 Subject: Speed up receive of many small packages When data from the netconf server was split into many ssh packages, the netconf client performed really bad. This is now improved. --- lib/common_test/src/ct_netconfc.erl | 22 ++++++++++++-------- .../ct_netconfc_SUITE_data/netconfc1_SUITE.erl | 24 ++++++++++++++++------ lib/common_test/test/ct_netconfc_SUITE_data/ns.erl | 15 ++++++++++++++ 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl index 0de7bf03af..799d795ed0 100644 --- a/lib/common_test/src/ct_netconfc.erl +++ b/lib/common_test/src/ct_netconfc.erl @@ -1366,11 +1366,18 @@ to_xml_doc(Simple) -> %%% Parse and handle received XML data handle_data(NewData,#state{connection=Connection,buff=Buff0} = State0) -> log(Connection,recv,NewData), - Data = append_wo_initial_nl(Buff0,NewData), - case binary:split(Data,[?END_TAG],[]) of + {Start,AddSz} = + case byte_size(Buff0) of + BSz when BSz<5 -> {0,BSz}; + BSz -> {BSz-5,5} + end, + Length = byte_size(NewData) + AddSz, + Data = <>, + case binary:split(Data,?END_TAG,[{scope,{Start,Length}}]) of [_NoEndTagFound] -> {noreply, State0#state{buff=Data}}; - [FirstMsg,Buff1] -> + [FirstMsg0,Buff1] -> + FirstMsg = remove_initial_nl(FirstMsg0), SaxArgs = [{event_fun,fun sax_event/3}, {event_state,[]}], case xmerl_sax_parser:stream(FirstMsg, SaxArgs) of {ok, Simple, _Thrash} -> @@ -1392,11 +1399,10 @@ handle_data(NewData,#state{connection=Connection,buff=Buff0} = State0) -> %% xml does not accept a leading nl and some netconf server add a nl after %% each ?END_TAG, ignore them -append_wo_initial_nl(<<>>,NewData) -> NewData; -append_wo_initial_nl(<<"\n", Data/binary>>, NewData) -> - append_wo_initial_nl(Data, NewData); -append_wo_initial_nl(Data, NewData) -> - <>. +remove_initial_nl(<<"\n", Data/binary>>) -> + remove_initial_nl(Data); +remove_initial_nl(Data) -> + Data. handle_error(Reason, State) -> Pending1 = case State#state.pending of diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl index 64ebfbc463..5f84634f74 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl @@ -36,7 +36,8 @@ -compile(export_all). suite() -> - [{ct_hooks, [{cth_conn_log, + [{timetrap,?default_timeout}, + {ct_hooks, [{cth_conn_log, [{ct_netconfc,[{log_type,html}, %will be overwritten by config {hosts,[my_named_connection,netconf1]}] }] @@ -72,6 +73,7 @@ all() -> invalid_opt, timeout_close_session, get, + get_a_lot, timeout_get, get_xpath, get_config, @@ -112,12 +114,9 @@ end_per_group(_GroupName, Config) -> init_per_testcase(_Case, Config) -> ets:delete_all_objects(ns_tab), - Dog = test_server:timetrap(?default_timeout), - [{watchdog, Dog}|Config]. + Config. -end_per_testcase(_Case, Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), +end_per_testcase(_Case, _Config) -> ok. init_per_suite(Config) -> @@ -351,6 +350,19 @@ get(Config) -> ?ok = ct_netconfc:close_session(Client), ok. +get_a_lot(Config) -> + DataDir = ?config(data_dir,Config), + {ok,Client} = open_success(DataDir), + Descr = lists:append(lists:duplicate(1000,"Description of myserver! ")), + Server = {server,[{xmlns,"myns"}],[{name,[],["myserver"]}, + {description,[],[Descr]}]}, + Data = lists:duplicate(100,Server), + ?NS:expect_reply('get',{fragmented,{data,Data}}), + {ok,Data} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}), + ?NS:expect_do_reply('close-session',close,ok), + ?ok = ct_netconfc:close_session(Client), + ok. + timeout_get(Config) -> DataDir = ?config(data_dir,Config), {ok,Client} = open_success(DataDir), diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl index 8c30383343..3fc99e5486 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl @@ -277,6 +277,18 @@ hupp_kill(State = #session{connection = ConnRef}) -> send({CM,Ch},Data) -> ssh_connection:send(CM, Ch, Data). +%%% Split into many small parts and send to client +send_frag({CM,Ch},Data) -> + Sz = rand:uniform(2000), + case Data of + <> -> + ssh_connection:send(CM, Ch, Chunk), + send_frag({CM,Ch},Rest); + Chunk -> + ssh_connection:send(CM, Ch, Chunk) + end. + + %%% Kill ssh connection kill({CM,_Ch}) -> ssh:close(CM). @@ -424,6 +436,9 @@ do(_, undefined) -> reply(_,undefined) -> ?dbg("no reply~n",[]), ok; +reply(ConnRef,{fragmented,Reply}) -> + ?dbg("Reply fragmented: ~p~n",[Reply]), + send_frag(ConnRef,make_msg(Reply)); reply(ConnRef,Reply) -> ?dbg("Reply: ~p~n",[Reply]), send(ConnRef, make_msg(Reply)). -- cgit v1.2.3 From 4cf832f1ad163f5b25dd8a6f2d314c169c23c82f Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 28 Sep 2015 16:45:05 +0200 Subject: Don't log headings without content The netconf server collects data until an XML tag is completed before pretty printing received data. Each time data is logged, a heading like the following is printed: = CT_NETCONFC ==== 28-Sep-2015::16:43:46,842 =================================== = Client <0.194.0> <----- {"127.0.0.1",2060} =================================== This commit removes printing of this header if there is no data to be printed below - i.e. if the XML tag is not yet complete and we are waiting for more data. --- lib/common_test/src/ct_conn_log_h.erl | 11 ++++++++--- lib/common_test/src/ct_netconfc.erl | 25 +++++++++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/lib/common_test/src/ct_conn_log_h.erl b/lib/common_test/src/ct_conn_log_h.erl index 2dd4fdac05..5eb67853d9 100644 --- a/lib/common_test/src/ct_conn_log_h.erl +++ b/lib/common_test/src/ct_conn_log_h.erl @@ -109,9 +109,14 @@ write_report(_Time,#conn_log{header=false,module=ConnMod}=Info,Data,GL,State) -> write_report(Time,#conn_log{module=ConnMod}=Info,Data,GL,State) -> {LogType,Fd} = get_log(Info,GL,State), - io:format(Fd,"~n~ts~ts~ts",[format_head(ConnMod,LogType,Time), - format_title(LogType,Info), - format_data(ConnMod,LogType,Data)]). + case format_data(ConnMod,LogType,Data) of + [] -> + ok; + FormattedData -> + io:format(Fd,"~n~ts~ts~ts",[format_head(ConnMod,LogType,Time), + format_title(LogType,Info), + FormattedData]) + end. write_error(Time,#conn_log{module=ConnMod}=Info,Report,GL,State) -> case get_log(Info,GL,State) of diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl index 799d795ed0..ed805e4d14 100644 --- a/lib/common_test/src/ct_netconfc.erl +++ b/lib/common_test/src/ct_netconfc.erl @@ -1768,9 +1768,14 @@ format_data(How,Data) -> do_format_data(raw,Data) -> io_lib:format("~n~ts~n",[hide_password(Data)]); do_format_data(pretty,Data) -> - io_lib:format("~n~ts~n",[indent(Data)]); + maybe_io_lib_format(indent(Data)); do_format_data(html,Data) -> - io_lib:format("~n~ts~n",[html_format(Data)]). + maybe_io_lib_format(html_format(Data)). + +maybe_io_lib_format(<<>>) -> + []; +maybe_io_lib_format(String) -> + io_lib:format("~n~ts~n",[String]). %%%----------------------------------------------------------------- %%% Hide password elements from XML data @@ -1809,13 +1814,21 @@ indent1(" Line++indent1(Rest2,Indent2); indent1(" %% Stop tag - {Line,Rest2,Indent2} = indent_line1(Rest1,Indent1,[$/,$<]), - "\n"++Line++indent1(Rest2,Indent2); + case indent_line1(Rest1,Indent1,[$/,$<]) of + {[],[],_} -> + []; + {Line,Rest2,Indent2} -> + "\n"++Line++indent1(Rest2,Indent2) + end; indent1("<"++Rest1,Indent1) -> %% Start- or empty tag put(tag,get_tag(Rest1)), - {Line,Rest2,Indent2} = indent_line(Rest1,Indent1,[$<]), - "\n"++Line++indent1(Rest2,Indent2); + case indent_line(Rest1,Indent1,[$<]) of + {[],[],_} -> + []; + {Line,Rest2,Indent2} -> + "\n"++Line++indent1(Rest2,Indent2) + end; indent1([H|T],Indent) -> [H|indent1(T,Indent)]; indent1([],_Indent) -> -- cgit v1.2.3 From 976214f8d738d4852348496df79f84264d899aba Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 27 Nov 2015 13:04:58 +0100 Subject: Extended table_trans timer in order to handle big data on slow machines The test case netconfc1_SUITE:get_a_lot often fails with table_trans_timeout in the netconf server (ns.erl) on virtual machines. The correction is to overcome this problem. Amount of data used in the test case is also reduced a bit. --- lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl | 2 +- lib/common_test/test/ct_netconfc_SUITE_data/ns.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl index 5f84634f74..2a8f8237bc 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl @@ -353,7 +353,7 @@ get(Config) -> get_a_lot(Config) -> DataDir = ?config(data_dir,Config), {ok,Client} = open_success(DataDir), - Descr = lists:append(lists:duplicate(1000,"Description of myserver! ")), + Descr = lists:append(lists:duplicate(100,"Description of myserver! ")), Server = {server,[{xmlns,"myns"}],[{name,[],["myserver"]}, {description,[],[Descr]}]}, Data = lists:duplicate(100,Server), diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl index 3fc99e5486..07893faabc 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl @@ -306,7 +306,7 @@ table_trans(Fun,Args) -> receive {table_trans_done,Result} -> Result - after 5000 -> + after 20000 -> exit(table_trans_timeout) end end. -- cgit v1.2.3 From 646e1b9e6a836526865f15582bb22c600c54d26a Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 13 Oct 2015 14:01:09 +0200 Subject: [common_test] Correct documentation Fix mistakes found by 'xmllint'. --- lib/common_test/doc/src/ct_hooks_chapter.xml | 20 ++++++++++---------- lib/common_test/doc/src/event_handler_chapter.xml | 5 +++-- lib/common_test/doc/src/notes.xml | 21 +++++++++------------ lib/common_test/src/ct_slave.erl | 10 +++++----- lib/common_test/src/ct_snmp.erl | 18 +++++++++--------- lib/common_test/src/ct_telnet.erl | 12 ++++++------ 6 files changed, 42 insertions(+), 44 deletions(-) diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml index d9892c66f7..3905e23dcc 100644 --- a/lib/common_test/doc/src/ct_hooks_chapter.xml +++ b/lib/common_test/doc/src/ct_hooks_chapter.xml @@ -30,8 +30,8 @@ ct_hooks_chapter.xml -
+ General

The Common Test Hook (henceforth called CTH) framework allows @@ -60,8 +60,8 @@

-
+ Installing a CTH

There are multiple ways to install a CTH in your test run. You can do it for all tests in a run, for specific test suites and for specific groups @@ -120,8 +120,8 @@

-
+ CTH Scope

Once the CTH is installed into a certain test run it will be there until its scope is expired. The scope of a CTH depends on when it is @@ -208,8 +208,8 @@

-
+ Manipulating tests

It is through CTHs possible to manipulate the results of tests and configuration functions. The main purpose of doing this with CTHs is to @@ -226,8 +226,8 @@ makes it possible to use hooks as configuration fallbacks, or even completely replace all configuration functions with hook functions.

-
+ Pre Hooks

It is possible in a CTH to hook in behaviour before @@ -263,8 +263,8 @@

-
+ Post Hooks

It is also possible in a CTH to hook in behaviour after init_per_suite, @@ -308,8 +308,8 @@ post_end_per_testcase(_TC, Config, Return, CTHState) ->

-
+ Skip and Fail hooks

After any post hook has been executed for all installed CTHs, @@ -323,8 +323,8 @@ post_end_per_testcase(_TC, Config, Return, CTHState) ->

-
+ Synchronizing external user applications with Common Test

CTHs can be used to synchronize test runs with external user applications. The init function may e.g. start and/or communicate with an application that @@ -351,8 +351,8 @@ post_end_per_testcase(_TC, Config, Return, CTHState) ->

-
+ Example CTH

The CTH below will log information about a test run into a format parseable by file:consult/1. @@ -455,8 +455,8 @@ terminate(State) -> ok.

-
+ Built-in CTHs

Common Test is delivered with a couple of general purpose CTHs that can be enabled by the user to provide some generic testing functionality. diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml index cb7033b196..78e5bb5e70 100644 --- a/lib/common_test/doc/src/event_handler_chapter.xml +++ b/lib/common_test/doc/src/event_handler_chapter.xml @@ -194,8 +194,9 @@ the current test case log file.

- - #event{name = tc_done, data = {Suite,FuncOrGroup,Result}} + + + #event{name = tc_done, data = {Suite,FuncOrGroup,Result}}

Suite = atom(), name of the suite.

FuncOrGroup = Func | {Conf,GroupName,GroupProperties}

Func = atom(), name of test case or configuration function.

diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml index aaf6dffc88..6972d18dfc 100644 --- a/lib/common_test/doc/src/notes.xml +++ b/lib/common_test/doc/src/notes.xml @@ -760,7 +760,7 @@ configuration function or test specification term), the affected test cases get the status user_skipped instead.

This update has meant a few changes that - may affect Common Test users in various ways: + may affect Common Test users in various ways:

The test results and statistics will be affected, which is important to know when running regression tests and comparing results to previous test runs. @@ -780,7 +780,7 @@ auto_skipped rather than user_skipped as before.
The event messages that Common Test generates during test runs have been affected by this - update. For details see OTP-11524.

+ update. For details see OTP-11524.

Own Id: OTP-11305 Aux Id: OTP-11524

@@ -831,7 +831,7 @@

The following modifications have been made to the event messages that Common Test sends during test - execution: For the tc_auto_skip + execution:

For the tc_auto_skip event, the value of the Func element has changed from end_per_group to {end_per_group,GroupName}. When @@ -843,7 +843,7 @@ configuration name already in use, the tc_done event now reports the error with a tuple (of size 2) tagged failed instead of skipped. - Please see the Event Handling chapter in the +

Please see the Event Handling chapter in the Common Test User's Guide for reference.

Own Id: OTP-11524 Aux Id: OTP-11305

@@ -1247,7 +1247,6 @@

Some bugfixes in ct_snmp:

-

ct_snmp will now use the value of the 'agent_vsns' config variable when setting the 'variables' parameter to snmp application agent configuration. @@ -1255,14 +1254,13 @@ supported versions had to be specified twice. Snmp application failed to write notify.conf since ct_snmp gave the notify type as a string instead of an - atom. This has been corrected.

+ atom. This has been corrected.

Own Id: OTP-10432

Some bugfixes in ct_snmp:

-

Functions register_users/2, register_agents/2 and register_usm_users/2, and the corresponding unregister_*/1 functions @@ -1279,7 +1277,7 @@ priv_dir instead of in the configuration dir (priv_dir/conf). This has been corrected. Arguments to register_usm_users/2 were faulty - documented. This has been corrected.

+ documented. This has been corrected.

Own Id: OTP-10434 Aux Id: kunagi-264 [175]

@@ -1343,7 +1341,7 @@

- Update common test modules to handle unicode + Update common test modules to handle unicode:

Use UTF-8 encoding for all HTML files, except the HTML version of the test suite generated with erl2html2:convert, which will have the same encoding as @@ -1354,7 +1352,7 @@ unicode:characters_to_list and unicode:characters_to_binary for conversion between binaries and strings instead of binary_to_list and - list_to_binary.

+ list_to_binary.

Own Id: OTP-10783

@@ -1395,7 +1393,6 @@

The following corrections/changes are done in the cth_surefire hook:

-

Earlier there would always be a 'properties' element under the 'testsuites' element. This would exist even if there were no 'property' element @@ -1428,7 +1425,7 @@ A new option named 'url_base' is added for this hook. If this option is used, a new attribute named 'url' will be added to the 'testcase' and 'testsuite' - elements.

+ elements.

Own Id: OTP-10589

diff --git a/lib/common_test/src/ct_slave.erl b/lib/common_test/src/ct_slave.erl index 32a1ff4dbc..0cd83b9f04 100644 --- a/lib/common_test/src/ct_slave.erl +++ b/lib/common_test/src/ct_slave.erl @@ -1,7 +1,7 @@ %%-------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2013. All Rights Reserved. +%% Copyright Ericsson AB 2010-2015. 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. @@ -134,7 +134,7 @@ start(Host, Node) -> %%% executed after startup of the node. Note that all used modules should be %%% present in the code path on the Host.

%%% -%%%

The timeouts are applied as follows: +%%%

The timeouts are applied as follows:

%%% %%% %%% BootTimeout - time to start the Erlang node, in seconds. @@ -154,7 +154,7 @@ start(Host, Node) -> %%% If this timeout occurs, the result %%% {error, startup_timeout, NodeName} is returned. %%% -%%%

+%%% %%% %%%

Option monitor_master specifies, if the slave node should be %%% stopped in case of master node stop. Defaults to false.

@@ -170,7 +170,7 @@ start(Host, Node) -> %%%

Option env specifies a list of environment variables %%% that will extended the environment.

%%% -%%%

Special return values are: +%%%

Special return values are:

%%% %%% {error, already_started, NodeName} - if the node with %%% the given name is already started on a given host; @@ -179,7 +179,7 @@ start(Host, Node) -> %%% {error, not_alive, NodeName} - if node on which the %%% ct_slave:start/3 is called, is not alive. Note that %%% NodeName is the name of current node in this case. -%%%

+%%% %%% start(Host, Node, Opts) -> ENode = enodename(Host, Node), diff --git a/lib/common_test/src/ct_snmp.erl b/lib/common_test/src/ct_snmp.erl index 95098bdaca..bb0167eb22 100644 --- a/lib/common_test/src/ct_snmp.erl +++ b/lib/common_test/src/ct_snmp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2012. All Rights Reserved. +%% Copyright Ericsson AB 2004-2015. 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. @@ -20,7 +20,7 @@ %%% @doc Common Test user interface module for the OTP snmp application %%% -%%% The purpose of this module is to make snmp configuration easier for +%%%

The purpose of this module is to make snmp configuration easier for %%% the test case writer. Many test cases can use default values for common %%% operations and then no snmp configuration files need to be supplied. When %%% it is necessary to change particular configuration parameters, a subset @@ -31,7 +31,7 @@ %%% To simplify the test suite, Common Test keeps track %%% of some of the snmp manager information. This way the test suite doesn't %%% have to handle as many input parameters as it would if it had to interface the -%%% OTP snmp manager directly. +%%% OTP snmp manager directly.

%%% %%%

The following snmp manager and agent parameters are configurable:

%%% @@ -326,9 +326,9 @@ set_info(Config) -> %%% @doc Register the manager entity (=user) responsible for specific agent(s). %%% Corresponds to making an entry in users.conf. %%% -%%% This function will try to register the given users, without +%%%

This function will try to register the given users, without %%% checking if any of them already exist. In order to change an -%%% already registered user, the user must first be unregistered. +%%% already registered user, the user must first be unregistered.

register_users(MgrAgentConfName, Users) -> case setup_users(Users) of ok -> @@ -351,10 +351,10 @@ register_users(MgrAgentConfName, Users) -> %%% @doc Explicitly instruct the manager to handle this agent. %%% Corresponds to making an entry in agents.conf %%% -%%% This function will try to register the given managed agents, +%%%

This function will try to register the given managed agents, %%% without checking if any of them already exist. In order to change %%% an already registered managed agent, the agent must first be -%%% unregistered. +%%% unregistered.

register_agents(MgrAgentConfName, ManagedAgents) -> case setup_managed_agents(MgrAgentConfName,ManagedAgents) of ok -> @@ -378,9 +378,9 @@ register_agents(MgrAgentConfName, ManagedAgents) -> %%% @doc Explicitly instruct the manager to handle this USM user. %%% Corresponds to making an entry in usm.conf %%% -%%% This function will try to register the given users, without +%%%

This function will try to register the given users, without %%% checking if any of them already exist. In order to change an -%%% already registered user, the user must first be unregistered. +%%% already registered user, the user must first be unregistered.

register_usm_users(MgrAgentConfName, UsmUsers) -> EngineID = ct:get_config({MgrAgentConfName, engine_id}, ?ENGINE_ID), case setup_usm_users(UsmUsers, EngineID) of diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl index e9487e94db..4d3fd2d094 100644 --- a/lib/common_test/src/ct_telnet.erl +++ b/lib/common_test/src/ct_telnet.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2014. All Rights Reserved. +%% Copyright Ericsson AB 2003-2015. 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. @@ -327,16 +327,16 @@ cmd(Connection,Cmd) -> %%% Reason = term() %%% @doc Send a command via telnet and wait for prompt. %%% -%%% This function will by default add a newline to the end of the +%%%

This function will by default add a newline to the end of the %%% given command. If this is not desired, the option %%% `{newline,false}' can be used. This is necessary, for example, %%% when sending telnet command sequences (prefixed with the -%%% Interprete As Command, IAC, character). +%%% Interprete As Command, IAC, character).

%%% -%%% The option `timeout' specifies how long the client shall wait for +%%%

The option `timeout' specifies how long the client shall wait for %%% prompt. If the time expires, the function returns %%% `{error,timeout}'. See the module description for information -%%% about the default value for the command timeout. +%%% about the default value for the command timeout.

cmd(Connection,Cmd,Opts) when is_list(Opts) -> case check_cmd_opts(Opts) of ok -> @@ -378,7 +378,7 @@ cmdf(Connection,CmdFormat,Args) -> %%% @doc Send a telnet command and wait for prompt %%% (uses a format string and list of arguments to build the command). %%% -%%% See {@link cmd/3} further description. +%%%

See {@link cmd/3} further description.

cmdf(Connection,CmdFormat,Args,Opts) when is_list(Args) -> Cmd = lists:flatten(io_lib:format(CmdFormat,Args)), cmd(Connection,Cmd,Opts). -- cgit v1.2.3 From 3e0e79218065458b816cd726bd637f1ecd00a882 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 13 Oct 2015 14:02:48 +0200 Subject: [observer] Correct documentation Fix mistakes found by 'xmllint'. --- lib/observer/doc/src/crashdump_ug.xml | 2 -- lib/observer/doc/src/notes.xml | 12 ++++-------- lib/observer/doc/src/observer_ug.xml | 3 +-- lib/observer/doc/src/ttb.xml | 17 ++++++++--------- lib/observer/doc/src/ttb_ug.xml | 7 +++---- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/lib/observer/doc/src/crashdump_ug.xml b/lib/observer/doc/src/crashdump_ug.xml index 3cd97f2f18..4bb3628ab5 100644 --- a/lib/observer/doc/src/crashdump_ug.xml +++ b/lib/observer/doc/src/crashdump_ug.xml @@ -377,7 +377,6 @@

The Memory panel shows memory and allocator information. From the left hand menu you can select:

-

Memory More... -

diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml index 5243f50e34..f0c87d865e 100644 --- a/lib/observer/doc/src/notes.xml +++ b/lib/observer/doc/src/notes.xml @@ -273,13 +273,12 @@
Improvements and New Features -

The new Memory field from a crash dump is now presented by crashdump viewer, both in the process overview and in the process detail page. A summary of blocks- and carriers sizes is added to the allocator information page in the crashdump viewer. -

+

Own Id: OTP-10604 Aux Id: kunagi-336 [247]

@@ -408,7 +407,6 @@

The following bugs in ttb have been corrected:

-

ttb:tracer/2 would earlier crash when trying to set up tracing for a diskless node to wrap files, i.e. when option @@ -421,7 +419,7 @@ {file,{local,Filename}} A deadlock would sometimes occur due to an information printout from the ttb_control process when ttb was - stopped.

+ stopped.

Own Id: OTP-9431

@@ -449,7 +447,6 @@

The following new features are added to ttb:

-

A one-command trace setup is added, ttb:start_trace/4. The following new options are added to ttb:tracer/2: @@ -485,7 +482,7 @@ disable_sort is added to ttb:format/2. When this option is used, trace messages from different logs are not merged according to timestamps, but just appended - one log after the other.

+ one log after the other.

Own Id: OTP-9403

@@ -493,7 +490,6 @@

The following non backwards compatible changes are done in ttb:

-

When setting up trace with ttb, the 'timestamp' trace flag will now always be set. The 'fetch' option to ttb:stop/1 is removed since @@ -509,7 +505,7 @@ trace file, this is now changed so the handler state is passed not only from one trace message to the next in the same file, but also from one file to the next. -

+

*** POTENTIAL INCOMPATIBILITY ***

diff --git a/lib/observer/doc/src/observer_ug.xml b/lib/observer/doc/src/observer_ug.xml index 8388cb6736..ff30d70913 100644 --- a/lib/observer/doc/src/observer_ug.xml +++ b/lib/observer/doc/src/observer_ug.xml @@ -105,7 +105,7 @@

Reds can be presented as accumulated values or as values since last update.

-

Process info open a detailed information window on the selected process. +

Process info open a detailed information window on the selected process.

Process Information Shows the process information. @@ -127,7 +127,6 @@ rb server will be stopped on the observed node when exiting or changing observed node.

-

Trace Processes will add the selected process identifiers to the Trace Overview view and the node the processes reside on will be added as well. Trace Named Processes will add the registered name of processes. This can be useful diff --git a/lib/observer/doc/src/ttb.xml b/lib/observer/doc/src/ttb.xml index 0b064b51b8..0a50a20716 100644 --- a/lib/observer/doc/src/ttb.xml +++ b/lib/observer/doc/src/ttb.xml @@ -25,8 +25,7 @@ ttb - Siri hansen - Bartlomiej Puzon + Siri hansen, Bartlomiej Puzon 1 @@ -60,17 +59,16 @@

This function is a shortcut allowing to start a trace with one command. Each tuple in Patterns is converted to list which is in turn passed to ttb:tpl. - The call: + The call:

ttb:start_trace([Node, OtherNode], [{mod, foo, []}, {mod, bar, 2}], {all, call}, [{file, File}, {handler,{fun myhandler/4, S}}]) - is equivalent to +

is equivalent to

ttb:start_trace([Node, OtherNode], [{file, File}, {handler,{fun myhandler/4, S}}]), ttb:tpl(mod, foo, []), ttb:tpl(mod, bar, 2, []), ttb:p(all, call) -

@@ -193,7 +191,7 @@ ttb:p(all, call)
(i.e. on diskless nodes), a custom module to handle autostart information storage and retrieval can be provided by specifying ttb_autostart_module environment variable for the runtime_tools - application. The module has to respond to the following API: + application. The module has to respond to the following API:

write_config(Data) -> ok Store the provided data for further retrieval. It is @@ -207,7 +205,6 @@ ttb:p(all, call)
must return {error, Error}.
-

The resume option implies the default FetchTimeout, which is 10 seconds

@@ -272,17 +269,19 @@ ttb:p(all, call) Clear trace pattern on global function calls

With tp and tpl one of match specification shortcuts - may be used (example: ttb:tp(foo_module, caller)). The shortcuts are: + may be used (example: ttb:tp(foo_module, caller)). The shortcuts are:

+ return - for [{'_',[],[{return_trace}]}] (report the return value) + caller - for [{'_',[],[{message,{caller}}]}] (report the calling function) + {codestr, Str} - for dbg:fun2ms/1 arguments passed as strings (example: "fun(_) -> return_trace() end") -

diff --git a/lib/observer/doc/src/ttb_ug.xml b/lib/observer/doc/src/ttb_ug.xml index ba8c997133..e2a28d67d0 100644 --- a/lib/observer/doc/src/ttb_ug.xml +++ b/lib/observer/doc/src/ttb_ug.xml @@ -320,7 +320,7 @@ do_print(Out,{trace_ts,P,return_from,{M,F,A},R,Ts},N) ->
- + Overload protection

When tracing live systems, special care needs to be always taken not to overload a node with too heavy tracing. ttb provides the overload option to help to address the problem.

@@ -747,7 +747,7 @@ f3() -> of the ttb for setting trace flags on processes and trace patterns for call trace, i.e. the functions p, tp, tpl, ctp, ctpl and ctpg. There are only - two things added by ttb for these functions: + two things added by ttb for these functions:

all calls are stored in the history buffer and can be recalled and stored in a configuration file. This makes it @@ -756,9 +756,8 @@ f3() -> typing when using ttb from the erlang shell; shortcuts are provided for the most common match specifications (in order not to force the user to use - dbg:fun2ms continually). + dbg:fun2ms continually). -

Use list_history/0 to see the content of the history buffer, and run_history/1 to re-execute one of the entries.

-- cgit v1.2.3