📄 c-bkend2.html
字号:
</font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84816"> </a>If the target server does not exit gracefully, which usually occurs because there is an error in the back end, it leaves its name in the registry. This prevents you from reusing the same name when you restart the target server. On UNIX, clean up the registry using the "unregister" button of the Tornado launcher. On Windows, select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Target Server>Manage</font></b> on the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu and select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Unregister</font></b>. On either host you can create a <b class="keyword">wtxtcl</b> script, <b class="tclProc">unreg</b>, like the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84817">#!/bin/sh # # unreg - remove a name from the registery # # Syntax: unreg <targetServerName> # echo -n Unregistering $1 ... wtxtcl << EOF set seekName $1 set allNames [wtxInfo] set pos [lsearch -glob \$allNames \*\$seekName\* ] if { \$pos < 0} { puts "invalid name" exit } set fullName [lindex [lindex \$allNames \$pos ] 0 ] wtxUnregister \$fullName EOF echo ` done.'</a></b></pre></dl><dd><p class="Body"><a name="84842"> </a>This is an example of the helpful utilities you can create with the <b class="keyword">wtxtcl</b> shell. For more information on WTX Tcl, see <a href="c-wtx.html#84379"><i class="title">4. The WTX Protocol</i></a>, the<i class="title"> Tornado User's Guide: Tcl Appendix, </i>and the online reference material under <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tornado API Reference>WTX TCL Library</font></b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84850">2.2.7 Message Logging</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84853"> </a>A message logging facility exists for all WDB back ends. This facility logs all transactions between the back end and the target agent to a file or terminal. Message logging simplifies diagnosing connection problems between the host and target because one can look at the sequence of transactions that led to the problem. This facility can also be used to help new back-end designers understand requests exchanged between existing back ends and the target.</p><dd><p class="Body"><a name="84854"> </a>All back ends that connect to the WDB agent send requests to the target using the library <i class="textVariable">installDir</i><b class="file">/</b> <b class="file">host/src/tgtsvr/backend/share/rpccore.c</b>, which contains the logging calls. This logging mechanism is back-end-specific, and is only provided for WDB back ends.</p><dd><p class="Body"><a name="84856"> </a>Message logging is enabled when the target server is started with the <b class="command">-Bd</b> <i class="textVariable">fileName</i> option. For example, to save log information in the file named <b class="file">/tmp/WDB.log</b>, invoke the target server with a command like the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84857"></b><tt class="output">%</tt><b> tgtsvr ... -Bd /tmp/tgtDebug.log ...</a></b></pre></dl><dd><p class="Body"><a name="84858"> </a>The file name must be specified; otherwise message logging is not enabled. If the file already exists, log information is added at the end of the file. Each time a request is logged to the file, output is flushed to assure that the last request written in the log file is actually the last request sent even if the target server hangs.</p><dd><p class="Body"><a name="84860"> </a>The length of the debug file can be controlled by the <b class="command">-Bm</b> <i class="textVariable">logMaxSize</i> option. With this flag, a file is created, or reset if it already exists, and is written as a circular file: when the file length reaches <i class="textVariable">logMaxSize</i>, the file is rewritten from the beginning, overriding the existing data. If this flag is not set or set with a 0 value, a file is created, or opened in append mode if it already exists, and is truncated. </p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="89281"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION: </font></b></a>Log files can become huge. An average of 100 bytes is used for each request logged; it is not uncommon to have a log file larger than a megabyte. Be sure to allocate enough disk space before starting the target server without the <b class="command">-Bm</b> option. Also be aware that logging affects the performance of the back end.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="84871"> </a>Each log file starts with a header, followed by records of transactions with the back end. The header provides: </p></dl><dl class="margin"><ul class="DashSingle" type="circle"><li><a name="84872"> </a>the target server user name</li></ul><ul class="DashSingle" type="circle"><li><a name="84873"> </a>the time and date the target server was launched</li></ul><ul class="DashSingle" type="circle"><li><a name="84874"> </a>the names of the target server and the target</li></ul><ul class="DashSingle" type="circle"><li><a name="84875"> </a>the request timeout value</li></ul><ul class="DashSingle" type="circle"><li><a name="84876"> </a>the number of times the server retransmits a request when no response is received.</li></ul></dl><dl class="margin"><dd><p class="Body"><a name="84877"> </a>The following is an example of this header:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84878"></b><tt class="output">User Name : wrs Started : Wed Jun 17 16:38:19 1998 Target Server Name : target@couesnon Target Name : target Target Server Options : tgtsvr -V target -Bd /tmp/WDB.log Timeout value : 1 second(s) Request re-send Max : 3</tt><b></a></b></pre></dl><dd><p class="Body"><a name="84886"> </a>Each request log is made of two parts: the service requested and the reply. The service-requested information includes the request number, the service name, and the input-structure name with the name and value of each field. The request number is a 16-bit integer assigned to distinguish each request. When the upper limit is reached, the request number restarts from zero. The input-structure name and values are omitted when the service does not require input arguments. A service input structure is signaled by the word <b class="symbol_lc">In</b> placed before its name.</p><dd><p class="Body"><a name="84887"> </a>The reply log consists of three parts: the number of times the request was resent, the service status, and the reply-structure name with the name and value of each field. The service status value is one of the WDB error codes. The file <b class="file">wdb.h</b> located in the <i class="textVariable">installDir</i><b class="file">/share/src/agents/wdb</b> directory provides the complete error code list. As in the input case, the output structure is signaled by the word <b class="symbol_lc">Out</b> before its name and it is omitted when the reply has no return value.</p><dd><p class="Body"><a name="84888"> </a>An example of a request log is given below. In this example the target server performs a checksum on a block of 49788 bytes of target memory starting at address 0x2000. The return status is OK and the checksum value is 0xffff34de.</p><dl class="margin"><dd><pre class="Code2"><b><a name="84889"></b><tt class="output">2 2 WDB_MEM_CHECKSUM Wed Jun 17 16:38:19 1998 In WDB_MEM_REGION baseAddr 0x20000 numBytes 49788 param 0 3 Out status: 0k UINT32 0xffff34de</tt><b></a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="84897">2.2.8 Informing Windows About a New Back End</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84898"> </a>Windows does not automatically recognize that a given back end is available. To make a new back end accessible to the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Configure</font></b> pop-up window under the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Target Server</font></b> option of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu, it is necessary to edit the file: <i class="textVariable">installDir</i><b class="file">/host/resource/tcl/app-config/Tornado/01TargetServer.win32.tcl</b>.</p><dd><p class="Body"><a name="89910"> </a>Change the line:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84899">set tsCfg_backendList {wdbrpc wdbserial netrom}</a></b></pre></dl><dd><p class="Body"><a name="84900"> </a>to</p><dl class="margin"><dd><pre class="Code2"><b><a name="84901">set tsCfg_backendList {wdbrpc wdbserial netrom <i class="textVariable">mybkend</i>}</a></b></pre></dl><dd><p class="Body"><a name="84902"> </a>Back-end-specific flags must be supplied in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Target Server Launch command</font></b> edit box, since Tornado can not automatically know how many and what kind of arguments the back end supports.</p></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1: <span class="Footnote"><a name="84576"> </a>On UNIX hosts and on Windows host when you use the command line, the environment variable <b class="symbol_UC">WIND_HOST_TYPE </b>records<b class="symbol_UC"> </b>the host type. (For example, on a Sun-4 running Solaris 2.5.1, <b class="symbol_UC">WIND_HOST_TYPE </b>is <b class="keyword">sun4-solaris2</b>; see the <i class="title">Tornado User's Guide: Getting Started</i>.) </span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-bkend.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-bkend.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-bkend1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-bkend3.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -