Percepio Trace Recorder v4.8.0.hotfix1
Loading...
Searching...
No Matches
Trace Internal Event Buffer APIs

Functions

traceResult xTraceInternalEventBufferAlloc (uint32_t uiSize, void **ppvData)
 Allocates a data slot directly from the internal event buffer.
 
traceResult xTraceInternalEventBufferAllocCommit (void *pvData, uint32_t uiSize, int32_t *piBytesWritten)
 Commits the last allocated block to the internal event buffer.
 
traceResult xTraceInternalEventBufferPush (void *pvData, uint32_t uiSize, int32_t *piBytesWritten)
 Pushes data to the internal trace event buffer.
 
traceResult xTraceInternalEventBufferTransferAll (void)
 Transfers all internal trace event buffer data using the function xTraceStreamPortWriteData(...) as defined in trcStreamPort.h.
 
traceResult xTraceInternalEventBufferTransferChunk (void)
 Transfer internal trace event buffer data through streamport.
 
traceResult xTraceInternalEventBufferClear (void)
 Clears all trace events in the internal trace event buffer.
 

Detailed Description

Function Documentation

◆ xTraceInternalEventBufferAlloc()

traceResult xTraceInternalEventBufferAlloc ( uint32_t  uiSize,
void **  ppvData 
)

Allocates a data slot directly from the internal event buffer.

Parameters
[in]uiSizeAllocation size
[out]ppvDataPointer that will hold the area from the buffer.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceInternalEventBufferAllocCommit()

traceResult xTraceInternalEventBufferAllocCommit ( void *  pvData,
uint32_t  uiSize,
int32_t *  piBytesWritten 
)

Commits the last allocated block to the internal event buffer.

For the sake of conformity this function accepts the same arguments as xTraceInternalEventBufferPush. These arguments are not used in the traditional sense since the alloc already managed these parts. This function simply marks the allocate stage as complete and ready for transfer.

Parameters
[in]pvDataPointer to data
[in]uiSizeSize of data
[out]piBytesWrittenBytes written.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceInternalEventBufferClear()

traceResult xTraceInternalEventBufferClear ( void  )

Clears all trace events in the internal trace event buffer.

Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceInternalEventBufferPush()

traceResult xTraceInternalEventBufferPush ( void *  pvData,
uint32_t  uiSize,
int32_t *  piBytesWritten 
)

Pushes data to the internal trace event buffer.

Parameters
[in]pvDataPointer to data
[in]uiSizeSize of data
[out]piBytesWrittenBytes written.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceInternalEventBufferTransferAll()

traceResult xTraceInternalEventBufferTransferAll ( void  )

Transfers all internal trace event buffer data using the function xTraceStreamPortWriteData(...) as defined in trcStreamPort.h.

This function is intended to be called by the periodic TzCtrl task with a suitable delay (e.g. 10-100 ms).

In case of errors from the streaming interface, it registers a warning (TRC_WARNING_STREAM_PORT_WRITE) provided by xTraceErrorGetLast().

Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceInternalEventBufferTransferChunk()

traceResult xTraceInternalEventBufferTransferChunk ( void  )

Transfer internal trace event buffer data through streamport.

This routine will attempt to transfer a chunk of existing data in the trace event buffer through the streamport. New data pushed to the trace event buffer during the execution of this routine will not be transfered.

When transferring a chunk which wraps the buffer, a singular transfer is made to avoid issuing dual writes. This configuration means that during wrapping, the chunk might be reduced in size even if there is more data at the start of the buffer. To transfer more data check piBytesWritten and issue multiple transfers if required.

Return values
TRC_FAILFailure
TRC_SUCCESSSuccess