Percepio Trace Recorder
v4.6.6
|
This function enables tracing. To use the trace recorder, the startup must call xTraceInitialize() or xTraceEnable(...) before any RTOS calls are made (including "create" calls). Three start options are provided:
TRC_START: Starts the tracing directly. In snapshot mode this allows for starting the trace at any point in your code, assuming xTraceInitialize() has been called in the startup. Can also be used for streaming without Tracealyzer control, e.g. to a local flash file system (assuming such a "stream port", see trcStreamPort.h). TRC_START_AWAIT_HOST: For streaming mode only. Initializes the trace recorder if necessary and waits for a Start command from Tracealyzer ("Start Recording" button). This call is intentionally blocking! By calling xTraceEnable with this option from the startup code, you start tracing at this point and capture the early events. TRC_START_FROM_HOST: For streaming mode only. Initializes the trace recorder if necessary and creates a task that waits for a Start command from Tracealyzer ("Start Recording" button). This call is not blocking.
examples
Snapshot trace, from startup: <board init> xTraceEnable(TRC_START); // Will call xTraceInitialize() <RTOS init> Snapshot trace, from a later point: <board init> xTraceInitialize(); <RTOS init> ... xTraceEnable(TRC_START); // e.g., in task context, at some relevant event Streaming trace, from startup (can only be used with certain stream ports): <board startup> xTraceInitialize(); <RTOS startup> xTraceEnable(TRC_START); Streaming trace, from startup: <board init> xTraceEnable(TRC_START_AWAIT_HOST); // Blocks! <RTOS init> Streaming trace, from a later point: <board startup> xTraceInitialize(); <RTOS startup> xTraceEnable(TRC_START); Streaming trace, system executes normally until host starts tracing: <board startup> xTraceInitialize(); <RTOS startup> xTraceEnable(TRC_START_FROM_HOST)
[in] | uiStartOption | Start option. |
TRC_FAIL | Failure |
TRC_SUCCESS | Success |