#include <nn/dbg.h>
void Initialize(
void * buffer,
size_t bufferSize,
s32 type = TRACE_STACK
);
| Name | Description | |
|---|---|---|
buffer |
Instrumentation buffer | |
bufferSize |
Size of instrumentation buffer (in bytes) | |
type |
The instrumentation type |
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.
| Value | Description |
|---|---|
| nn::dbg::CTR::TRACE_LOG | Log Mode |
| nn::dbg::CTR::TRACE_STACK | Stack Mode |
| nn::dbg::CTR::RECORD_TICK | Also records system ticks |
| nn::dbg::CTR::RING_BUFFER | Uses buffer as a ring buffer. |
Each of these modes is described below.
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.
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.
If RING_BUFFER is specified, when the instrumentation buffer becomes full, the oldest data is deleted from the next time data is recorded.
CONFIDENTIAL