Initialize

nn::dbg::CTR::Instrument::Initialize Member Function

Syntax

#include <nn/dbg.h>

void Initialize(
     void * buffer,
     size_t bufferSize,
     s32 type = TRACE_STACK
);

Parameters

Name Description
buffer Instrumentation buffer
bufferSize Size of instrumentation buffer (in bytes)
type The instrumentation type

Return Values

None.

Description

Declares the buffer passed to the instrumentation class and performs initialization.

Stores measured results in the buffer given by buffer. This size of buffer is given by bufferSize.

type 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.

ValueDescription
nn::dbg::CTR::TRACE_LOGLog Mode
nn::dbg::CTR::TRACE_STACKStack Mode
nn::dbg::CTR::RECORD_TICKAlso records system ticks
nn::dbg::CTR::RING_BUFFERUses buffer as a ring buffer.

Each of these modes is described below.

Log mode (TRACE_LOG) and stack mode (TRACE_STACK)

In 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.

Recording system ticks (RECORD_TICK)

If 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.

Using a ring buffer (RING_BUFFER)

If RING_BUFFER is specified, when the instrumentation buffer becomes full, the oldest data is deleted from the next time data is recorded.

Revision History

2011/07/15
Added information about instrumentation types
2011/07/12
Initial version.

CONFIDENTIAL