Percepio Trace Recorder  v4.6.6
Trace ISR APIs

Macros

#define xTraceISRGetCurrentNesting(puiValue)   TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiValue) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex, TRC_SUCCESS)
 Gets current trace ISR nesting level. More...
 
#define xTraceISRGetCurrentNestingReturned()   (pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex)
 
#define xTraceISRGetCurrent(pxISRHandle)   (xTraceISRGetCurrentNestingReturned() >= 0 ? (*(pxISRHandle) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].handleStack[xTraceISRGetCurrentNestingReturned()], TRC_SUCCESS) : TRC_FAIL)
 Gets current trace ISR nesting level. More...
 

Functions

traceResult xTraceISRRegister (const char *szName, uint32_t uiPriority, TraceISRHandle_t *pxISRHandle)
 Registers trace ISR. More...
 
traceResult xTraceISRBegin (TraceISRHandle_t xISRHandle)
 Registers the beginning of an Interrupt Service Routine. More...
 
traceResult xTraceISREnd (TraceBaseType_t xIsTaskSwitchRequired)
 Registers the end of an Interrupt Service Routine. More...
 

Detailed Description

Macro Definition Documentation

◆ xTraceISRGetCurrent

#define xTraceISRGetCurrent (   pxISRHandle)    (xTraceISRGetCurrentNestingReturned() >= 0 ? (*(pxISRHandle) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].handleStack[xTraceISRGetCurrentNestingReturned()], TRC_SUCCESS) : TRC_FAIL)

Gets current trace ISR nesting level.

This routine gets the current trace ISR nesting level for the CPU on which it is called.

Parameters
[out]puiValueValue.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceISRGetCurrentNesting

#define xTraceISRGetCurrentNesting (   puiValue)    TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiValue) = pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex, TRC_SUCCESS)

Gets current trace ISR nesting level.

This routine gets the current trace ISR nesting level for the CPU on which it is called.

Parameters
[out]puiValueValue.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceISRGetCurrentNestingReturned

#define xTraceISRGetCurrentNestingReturned ( )    (pxTraceISRInfo->coreInfos[TRC_CFG_GET_CURRENT_CORE()].stackIndex)
Returns
int32_t

Function Documentation

◆ xTraceISRBegin()

traceResult xTraceISRBegin ( TraceISRHandle_t  xISRHandle)

Registers the beginning of an Interrupt Service Routine.

This routine register the beginning of an ISR using a TraceISRHandle_t. See xTraceISRRegister for and example of using ISR tracing.

Parameters
[in]xISRHandlePointer to initialized ISR trace handle.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceISREnd()

traceResult xTraceISREnd ( TraceBaseType_t  xIsTaskSwitchRequired)

Registers the end of an Interrupt Service Routine.

This routine register the end of an ISR using a TraceISRHandle_t. See xTraceISRRegister for and example of using ISR tracing.

The parameter uxIsTaskSwitchRequired indicates if the interrupt has requested a task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the interrupt is assumed to return to the previous context.

Parameters
[in]xIsTaskSwitchRequiredTask switch required.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess

◆ xTraceISRRegister()

traceResult xTraceISRRegister ( const char *  szName,
uint32_t  uiPriority,
TraceISRHandle_t *  pxISRHandle 
)

Registers trace ISR.

This routine stores a name and priority level for an Interrupt Service Routine, to allow for better visualization. Returns a TraceISRHandle_t used by xTraceISRBegin/xTraceISREnd.

Example: #define PRIO_OF_ISR_TIMER1 3 // the hardware priority of the interrupt TraceISRHandle_t xISRTimer1Handle = 0; // The ID set by the recorder ... xTraceISRRegister("ISRTimer1", PRIO_OF_ISR_TIMER1, &xISRTimer1Handle); ... void ISR_handler() { xTraceISRBegin(xISRTimer1Handle); ... xTraceISREnd(0); }

Parameters
[in]szNameName.
[in]uiPriorityPriority.
[out]pxISRHandlePointer to uninitialized ISR trace handle.
Return values
TRC_FAILFailure
TRC_SUCCESSSuccess