⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-collect3.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Configuring Data Collection   </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="c-collect.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-collect.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-collect2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-collect4.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="84220">3.3  &nbsp;&nbsp;Instrumented Objects</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84201"> </a>In order to generate the level of detail you need to solve your problem, you may need to instrument some or all kernel libraries. You may also need to collect data from one or more additional libraries. </p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="84202"> </a>Tasks (<b class="library">taskLib</b>) </li></ul><ul class="BulletSingle" type="disc"><li><a name="84207"> </a>Semaphores (<b class="library">semLib</b>) </li></ul><ul class="BulletSingle" type="disc"><li><a name="84955"> </a>Message queues (<b class="library">msgQLib</b>) </li></ul><ul class="BulletSingle" type="disc"><li><a name="87889"> </a>Watchdog timers (<b class="library">wdLib</b>) </li></ul><ul class="BulletSingle" type="disc"><li><a name="87890"> </a>Memory allocs/frees (<b class="library">memLib</b>) </li></ul><ul class="BulletSingle" type="disc"><li><a name="84956"> </a>Signals (<b class="library">sigLib</b>) </li></ul></dl></dl><dl class="margin"><dd>&nbsp;<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/note.gif"></td><td><hr><div class="CalloutCell"><a name="89481"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE:  </font></b></a>The kernel library <b class="library">sigLib</b> and the additional non-kernel library <b class="library">memLib</b> are not selected by default.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="89207">The Selection Screen </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89209"> </a>Once you have selected <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Additional Instrumentation</font></b>, you must decide which objects to log. The kernel objects that can be selected for logging from the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Collection Configuration</font></b> dialog box are tasks, semaphores, watchdog timers, message queues, and signals. Memory objects can also be selected. Select the libraries containing the objects you want to log by checking the box in front of the library name. <div class="frame"><h4 class="EntityTitle"><a name="89212"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-6:&nbsp;&nbsp;WindView Collection Configuration: Additional Instrumentation </font></a></h4><dl class="margin"><div class="Anchor"><a name="89235"> </a><img class="figure" border="0" src="images/c-collect9.gif"></div></dl></div></p><dd><p class="Body"><a name="87906"> </a>For all kernel objects except signals, you can enable instrumentation for a particular object, such as task <b class="task">t1</b>, within your application code. You can also enable instrumentation for whole libraries programmatically if you wish. For information on how to specify data collection for AIL level logging in your code, see <a href="c-datacol3.html#85534"><i class="title">7.3&nbsp;Selecting Additional Libraries</i></a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84197">The Memory Library</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85132"> </a>When you select <b class="library">memLib</b>, WindView logs the following events:</p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="84990"> </a>Memory allocations of all types (<b class="routine"><i class="routine">calloc</i></b><b>(&nbsp;)</b>, <b class="routine"><i class="routine">malloc</i></b><b>(&nbsp;)</b>, and so on) </li></ul><ul class="BulletSingle" type="disc"><li><a name="84994"> </a>Memory frees </li></ul><ul class="BulletSingle" type="disc"><li><a name="84998"> </a>Memory partition creations </li></ul><ul class="BulletSingle" type="disc"><li><a name="85002"> </a>Memory reallocations </li></ul><ul class="BulletSingle" type="disc"><li><a name="87319"> </a>Additions to memory pools </li></ul></dl><dl class="margin"><dd><p class="Body"><a name="84199"> </a>For detailed information about what parameters are logged for each event, which routines call them, and so on, see <a href="c-datacol3.html#84380"><i class="title">memLib</i></a>. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87379">Memory Analysis Pack</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87381"> </a>The view graph shows you when memory events occur, but the most interesting thing about your application's use of memory is how much is allocated at any time. WindView provides an analysis pack to calculate and display this information. To run it, display your log in the view graph and click <img class="figure" border="0" src="images/c-collect10.gif">. Select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Memory Usage </font></b>in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Analysis </font></b>dialog box. To display the results of the calculation, click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Export to Graph</font></b>; the view graph displays the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">memUsage</font></b> analog graph. (See <a href="c-collect3.html#87391">Figure&nbsp;3-7</a>.)&nbsp;&nbsp;<div class="frame"><h4 class="EntityTitle"><a name="87391"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-7:&nbsp;&nbsp;Output for memLib Analysis Pack </font></a></h4><dl class="margin"><div class="Anchor"><a name="87410"> </a><img class="figure" border="0" src="images/c-collect11.gif"></div></dl></div></p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87411">Memory Example</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87412"> </a>To see how WindView can find memory leaks, compile and load this example:</p><dl class="margin"><dd><pre class="Code2"><b><a name="87413">void func1 (int loopcnt)     {     int i;      for (i = 0; i &lt; loopcnt; i++)         {         char *p1 = (char *)malloc (1023);         char *p2 = (char *)malloc (1017);         free ((void *)p1);          /* note: p2 points at an unreturned piece&nbsp;of system memory.  */         }     exit (0);     }</a></b></pre></dl><dd><p class="Body"><a name="87414"> </a>Start WindView in additional instrumentation logging level with <b class="library">memLib</b> selected. Run <b class="symbol_lc">func1</b> from the shell with a parameter of 5. When <b class="symbol_lc">func1</b> returns, stop WindView and display the view graph. Select the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Memory Usage</font></b> analysis pack, click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Select All</font></b> to calculate memory usage for all tasks, select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Perform</font></b>, and click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Export to Graph</font></b> to display the analog graph. The analog graph allows you to quickly identify when <b class="symbol_lc">func1</b> was running, and to see that not all the memory it allocated was returned to the system memory pool. (See <a href="c-collect3.html#87391">Figure&nbsp;3-7</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="c-collect.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-collect.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-collect2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-collect4.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 + -