📄 bkendlog.html
字号:
<html><head><!-- /vobs/wpwr/docs/tornado-api/tgtint/bkendlog.html - generated by refgen from share/bkendlog.c --> <title> bkendlog </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>Tornado API Reference : Target Server Internal Routines</i></a></p></blockquote><h1>bkendlog</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bkendlog</strong> - back-end debug log library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./bkendlog.html#bkendLog">bkendLog</a></i>( )</b> - log a request exchanged between the target server back end and the target <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides a routine to log the requests and the dataexchanged between the target server and the target agent. Log output issent to a file or device.<p>Use this routine when you write a new target server back end to logthe data that is sent and received by the target server back end whenthe back-end debug option is ON.<p>The back-end logging facility is turned OFF by default. It can be turnedon with the <b>-Bd</b> option to the target server. For example, underUNIX, log the back-end data to a console with:<pre>% tgtsvr target -Bd /dev/tty</pre>The log file contains a header followed by the requests issued by thetarget server. The header gives information about the target server user,the start date and time of the log, the target server name, the targetname, the target server options, and host informations. It also gives theback-end timeout value and the maximum number of retries in case offailure.<p>The following is an example of a log message header:<pre> User Name : philm Started : Wed Feb 28 14:35:09 1998 Target Server Name : RueDuQuai@scorff Target Name : kerpc Target Server Options : tgtsvr kerpc -n RueDuQuai -V -Bd backend.log Host : HP-UX scorff B.10.20 A 9000/777 Timeout value : 1 second(s) Request re-send Max : 3</pre>Each request is written to the log file with its sequence number, its name,the name of the input structure (labeled "In"), the value of the input structure, the name of the output structure (labeled "Out"), and its value.<p>Example 1: <b><a href="../wdbpcl/wdb.html#WDB_TARGET_CONNECT" >WDB_TARGET_CONNECT</a></b> request with sequence number 1 (first requestissued) and no retries (0). This request has no input parameter and the output is a <b>WDB_TGT_INFO</b> structure.<pre>1 WDB_TARGET_CONNECT Wed Feb 28 14:35:10 19980 Out status: Ok WDB_TGT_INFO WDB_AGENT_INFO agentVersion 2.0 mtu 1500 mode WDB_MODE_TASK WDB_RT_INFO rtType WDB_RT_VXWORKS rtVersion 5.3 cpuType 82 hasFpp 1 hasWriteProtect 1 pageSize 4096 endian 4321 bspName PC 486 bootline scorff:/folk/tornado/target/config/pc486/vxWorks memBase 0x0 memSize 0x7ff000 numRegions 0 hostPoolBase 0x7a3c0c hostPoolSize 0x40000</pre>Example 2: <b><a href="../wdbpcl/wdb.html#WDB_MEM_WRITE" >WDB_MEM_WRITE</a></b> request with sequence number 25 and no retries. The input parameter is <b>WDB_MEM_XFER</b> structure and the output is an integer giving the status of the request.<pre>25 WDB_MEM_WRITE Wed Feb 28 14:36:11 1998 In WDB_MEM_XFER numBytes 4 destination 0x17d144 source 0x4000e9300 Out status: Ok</pre>For the definitions of the structures exchanged between the target server andthe target, see the file $<b>WIND_BASE/share/src/agents/wdb/wdb.h</b>.<p></blockquote><h4>WINDOWS HOSTS</h4><blockquote><p>When creating a new back end on a Windows host, the developer creates a newproject under MicroSoft C++. It is necessary to go to the Link tab under theSettings menu of Project and add the required object/library modules manually.Adding <b>/Tornado/host/x86-win32/lib/backend.lib</b> provides the logging functionand <b>/Tornado/host/x86-win32/lib/libwpwr.lib</b> provides the WTX APIs.<p></blockquote><h4>WARNING</h4><blockquote><p>On average, 100 characters are used to log one request. When writtento a file, the back end transaction data can quickly reach hundreds ofkilobytes and fill a disk partition.<p></blockquote><h4>INCLUDE FILE</h4><blockquote><p><b>bkendlib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendlog.html#top">bkendlog</a></b>, <i>API Programmer's Guide: Target Server Back End </i><hr><a name="bkendLog"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>bkendLog</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bkendLog</i>( )</strong> - log a request exchanged between the target server back end and the target </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void bkendLog ( u_long procNum, /* procedure number to perform */ u_int xmit, /* request xmit: TRUE or FALSE */ char * args, /* Input/Output structure pointer */ int timeoutNb, /* timeout number */ int sequenceNumber, /* sequence number */ u_int status /* request status */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine logs request data exchanged between the target server backend and the target agent. Call this routine twice when issuing a WDBservice request: once prior to sending the request, in order to log therequest name and the input structure; and once on the reply, in order tolog the output structure.<p>The log is written to the file specified with the <b>-Bd</b> option to<b><a href="../../tornado/tools/tgtsvr.html#top" >tgtsvr</a></b>. For example,<pre>tgtsvr target -Bd /tmp/target.log</pre>When the <b>-Bd</b> option is not used, <b><i><a href="./bkendlog.html#bkendLog">bkendLog</a></i>( )</b> does nothing and returnsimmediately.<p>The <i>procNum</i> argument contains the WDB request number sent to the targetagent. If <i>xmit</i> is equal to TRUE, the structure pointed to by <i>args</i> is atransmission structure (labeled <b>In</b> in the log output); otherwise, it isa receive structure (labeled <b>Out</b> in the log output). <i>timeoutNb</i>contains the number of time an identical request was resent.<i>sequenceNumber</i> contains the request's current sequence number. If<i>args</i> is NONE, no input or output structure value is logged.<p>Now, the banner is finished to be printed by rpcCoreInit. To do that, <i>procNum</i>is equal to 0, and <i>xmit</i> is set to the value of the <i>timeout</i>, and <i>status</i>to <i>resemd</i>.The <i>timeoutVal</i> and <i>resendMax</i> arguments handle the time out value used bythe back end and the maximum number of times a request might be resent to thetarget agent. These two back end features might be useless for some back endbut are always logged in the file. The <i>wdbLogMaxSize</i> argument is the maximum size for the log file.<p>The code below gives an example of how to call <b><i><a href="./bkendlog.html#bkendLog">bkendLog</a></i>( )</b>.<pre> ... /* increment the sequence number */ seqNumber++ ; /* log the WDB request */ bkendLog (procNum, TRUE, in, 0, (int ) seqNumber, 0); /* call the agent request */ do { status = myBackendCall (...); } while (++resendCnt < maxNumResend); /* log the structure returned by the target agent */ bkendLog (procNum, FALSE, out, resendCnt, 0, status); ...</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bkendlog.html#top">bkendlog</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -