1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_DumpStatistics</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_DumpStatistics <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14<DD><CODE>#include &lt;nitro/os.h&gt;</CODE><BR> <BR> <CODE>void OS_DumpStatistics( void* statBuf );</CODE>
15</DL>
16<H2>Arguments</H2>
17<TABLE border="1">
18  <TBODY>
19    <TR>
20<TD><I><B>statBuf</B></I></TD>
21<TD>Function cost statistics buffer</TD>
22    </TR>
23  </TBODY>
24</TABLE>
25<H2>Return Values</H2>
26<P>None.</P>
27<H2>Description</H2>
28<P>Displays the contents of the function cost statistics buffer.</P>
29<P>It uses the <A href="../debug/OS_Printf.html"><CODE>OS_Printf</CODE></A> function to output the contents of the function cost statistics buffer, which accumulates the results of calculating function costs.</P>
30<P>To enable this function, at link time you must include <CODE>libos.FUNCTIONCOST.a</CODE> (in the thumb version, <CODE>libos.FUNCTIONCOST.thumb.a</CODE>). To do this, specify <CODE>TWL_PROFILE_TYPE=FUNCTIONCOST</CODE> as a <CODE>make</CODE> option. You can also write it in the <CODE>makefile</CODE>. However, in the final ROM version (FINALROM) library, it will not do anything.</P>
31<BLOCKQUOTE><B>Display Example:</B>
32<BLOCKQUOTE><CODE>---- functionCost statistics<BR></CODE><CODE>test1: count 1, cost 20<BR> test2: count 3, cost 140<BR> test3: count 4, cost 132<BR></CODE></BLOCKQUOTE>
33</BLOCKQUOTE>
34<BLOCKQUOTE>The accumulated results are displayed in a row from the left: function name, number of times the function has been called, time cost required to execute inside the function. From this, we can see that a function named <CODE>test1()</CODE> was called once, and the time cost was 20. (The time cost unit is the same unit that is used with ticks: 1/64th of the system clock.) Likewise, <CODE>test2()</CODE> was called 3 times, and the total time cost was 140; <CODE>test3()</CODE> was called 4 times, and the total time cost was 132.</BLOCKQUOTE>
35<H3><BR> Display Mode</H3>
36<P>If an accurate display of all information takes priority over speed, as it does when displaying tabulated results, we recommend temporarily setting the display to blocking mode. See <A href="../debug/OS_SetPrintBlockingMode.html"><CODE>OS_SetPrintBlockingMode</CODE></A> for further details.</P>
37<H2>See Also</H2>
38<P><A href="OS_InitStatistics.html"><CODE>OS_InitStatistics</CODE></A><BR> <A href="../debug/OS_SetPrintBlockingMode.html"><CODE>OS_SetPrintBlockingMode</CODE></A></P>
39<H2>Revision History</H2>
40<P>2009/04/03 Added a note on blocking mode. <BR>2004/05/19 Initial version.</P>
41<hr><p>CONFIDENTIAL</p></body>
42</HTML>