📄 c-smo5.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Shared-Memory Objects </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-smo.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-smo4.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-vm.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="88280">6.5 Troubleshooting</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85673"> </a>Problems with shared-memory objects can be due to a number of causes. This section discusses the most common problems and a number of troubleshooting tools. Often, you can locate the problem by rechecking your hardware and software configurations.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85674">6.5.1 Configuration Problems</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85675"> </a>Refer to the following list to confirm that your system is properly configured:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85677"> </a>Be sure to verify that the constant <b class="symbol_UC">INCLUDE_SM_OBJ </b>is selected for inclusion in the project facility VxWorks view for each processor using VxMP.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85678"> </a>Be sure the anchor address specified is the address seen by the CPU. This can be defined with the constant <b class="symbol_UC">SM_ANCHOR_ADRS</b> in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Params</font></b> tab of the properties window or at boot time (<b class="command">sm=</b>) if the target is booted with the shared-memory network.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85679"> </a>If there is heavy bus traffic relating to shared-memory objects, bus errors can occur. Avoid this problem by changing the bus arbitration mode or by changing relative CPU priorities on the bus.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85680"> </a>If <b class="routine"><i class="routine">memAddToPool</i></b><b>(</b> <b>)</b>,<b class="routine"><i class="routine"> memPartSmCreate</i></b><b>(</b> <b>)</b>, or <b class="routine"><i class="routine">smMemAddToPool</i></b><b>(</b> <b>)</b> fail, check that any address you are passing to these routines is in fact a global address.</li></ul></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85682">6.5.2 Troubleshooting Techniques</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85683"> </a>Use the following techniques to troubleshoot any problems you encounter:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85685"> </a>The routine <b class="routine"><i class="routine">smObjTimeoutLogEnable</i></b><b>(</b> <b>)</b> enables or disables the printing of an error message indicating that the maximum number of attempts to take a spin-lock has been reached. By default, message printing is enabled. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85687"> </a>The routine <b class="routine"><i class="routine">smObjShow</i></b><b>(</b> <b>)</b> displays the status of the shared-memory objects facility on the standard output device. It displays the maximum number of tries a task took to get a spin-lock on a particular CPU. A high value can indicate that an application might run into problems due to contention for shared-memory resources.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85690"> </a>The shared-memory heartbeat can be checked to verify that the master CPU has initialized shared-memory objects. The shared-memory heartbeat is in the first 4-byte word of the shared-memory object header. The offset to the header is in the sixth 4-byte word in the shared-memory anchor. (See <i class="title">VxWorks Network Programmer's Guide: Data Link Layer Network Components</i>.)</li></ul></p><dl class="margin"><dd><div class="Indent"><a name="85691"> </a>Thus, if the shared-memory anchor were located at 0x800000:</div><br><dl class="margin"><dd><pre class="Code3"><b><a name="85692"></b><tt class="output">[VxWorks Boot]:</tt><b> d 0x800000 </b><tt class="output">800000: 8765 4321 0000 0001 0000 0000 0000 002c *.eC!...........,* 800010: 0000 0000 0000 0170 0000 0000 0000 0000 *...p............* 800020: 0000 0000 0000 0000 0000 0000 0000 0000 *................*</tt><b></a></b></pre></dl><dd><div class="Indent"><a name="85696"> </a>The offset to the shared-memory object header is 0x170. To view the shared-memory object header display 0x800170:</div><br><dl class="margin"><dd><pre class="Code3"><b><a name="85697"></b><tt class="output">[VxWorks Boot]:</tt><b> d 0x800170 </b><tt class="output">800170: 0000 0050 0000 0000 0000 0bfc 0000 0350 *...P...........P*</tt><b></a></b></pre></dl><dd><div class="Indent"><a name="85699"> </a>In the preceding example, the value of the shared-memory heartbeat is 0x50. Display this location again to ensure that the heartbeat is alive; if its value has changed, shared-memory objects are initialized.</div><br></dl><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85701"> </a>The global variable <b class="keyword">smIfVerbose</b>, when set to 1 (TRUE), causes shared-memory interface error messages to print to the console, along with additional details of shared-memory operations. This variable enables you to get run-time information from the device driver level that would be unavailable at the debugger level. The default setting for <b class="keyword">smIfVerbose</b> is 0 (FALSE). That can be reset programmatically or from the shell. </li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="79990"> </a></p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-smo.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-smo4.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-vm.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 + -