1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7<title>Initialize</title>
8  </head>
9  <body>
10<h1><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/dbg/Overview.html">dbg</a>::<a href="../../../../nn/dbg/CTR/Overview.html">CTR</a>::<a href="../../../../nn/dbg/CTR/Instrument/Overview.html">Instrument</a>::Initialize Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/dbg.h&gt;
14
15void Initialize(
16     void * buffer,
17     size_t bufferSize,
18     <a href="../../../../nn_types/s32.html">s32</a> type = TRACE_STACK
19);
20</pre>
21    </div>
22<h2>Parameters</h2>
23    <div class="section">
24      <table class="arguments">
25        <thead>
26          <tr>
27            <td width="15" />
28<th>Name</th>
29<td>Description</td>
30          </tr>
31        </thead>
32        <tr>
33          <td />
34<th><CODE>buffer</CODE></th>
35<td>Instrumentation buffer</td>
36        </tr>
37        <tr>
38          <td />
39<th><CODE>bufferSize</CODE></th>
40<td>Size of instrumentation buffer (in bytes)</td>
41        </tr>
42        <tr>
43          <td />
44<th><CODE>type</CODE></th>
45<td>The instrumentation type</td>
46        </tr> </table>
47    </div>
48<h2>Return Values</h2>
49    <div class="section">
50None.
51               </div>
52<h2>Description</h2>
53    <div class="section">
54<p>Declares the buffer passed to the instrumentation class and performs initialization.</p><P>Stores measured results in the buffer given by <span class="argument">buffer</span>. This size of <span class="argument">buffer</span> is given by <span class="argument">bufferSize</span>.
55</P><P><span class="argument">type</span> represents the instrumentation type and is specified as follows. Either log mode or stack mode must be specified. Use the logical sum if you need to both record system ticks and specify a ring buffer.
56</P><TABLE><THEAD><TR><TH>Value</TH><TH>Description</TH></TR></THEAD><TR><TD>nn::dbg::CTR::TRACE_LOG</TD><TD>Log Mode</TD></TR><TR><TD>nn::dbg::CTR::TRACE_STACK</TD><TD>Stack Mode</TD></TR><TR><TD>nn::dbg::CTR::RECORD_TICK</TD><TD>Also records system ticks</TD></TR><TR><TD>nn::dbg::CTR::RING_BUFFER</TD><TD>Uses buffer as a ring buffer.</TD></TR></TABLE><P>
57Each of these modes is described below.
58</P><H4>Log mode (TRACE_LOG) and stack mode (TRACE_STACK)</H4><P>
59In log mode, a log of calls is taken upon entering the function. In stack mode, a log of calls is taken upon entering the function and the log is destroyed on exit. Either log mode or stack mode must be specified for the instrumentation type.
60</P><H4>Recording system ticks (RECORD_TICK)</H4><P>
61If RECORD_TICK is specified, the number of system ticks when the function was called is also recorded. The amount of instrumentation buffer memory being used increases by eight bytes per function call.
62</P><H4>Using a ring buffer (RING_BUFFER)</H4><P>
63If RING_BUFFER is specified, when the instrumentation buffer becomes full, the oldest data is deleted from the next time data is recorded.
64</P></div>
65<h2>Revision History</h2>
66    <div class="section">
67      <dl class="history">
68        <dt>2011/07/15</dt>
69<dd>Added information about instrumentation types<BR>
70        </dd>
71        <dt>2011/07/12</dt>
72<dd>Initial version.<br />
73        </dd>
74      </dl>
75    </div>
76  <hr><p>CONFIDENTIAL</p></body>
77</html>
78