Percepio Trace Recorder v4.8.0.hotfix1
Loading...
Searching...
No Matches
trcISR.h
Go to the documentation of this file.
1/*
2* Percepio Trace Recorder for Tracealyzer v4.8.0.hotfix1
3* Copyright 2023 Percepio AB
4* www.percepio.com
5*
6* SPDX-License-Identifier: Apache-2.0
7*/
8
15#ifndef TRC_ISR_H
16#define TRC_ISR_H
17
18#if (TRC_USE_TRACEALYZER_RECORDER == 1)
19
20#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
21
22#include <trcTypes.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
37typedef struct TraceISRCoreData /* Aligned */
38{
39 TraceISRHandle_t handleStack[TRC_CFG_MAX_ISR_NESTING];
40 int32_t stackIndex;
41 uint32_t isPendingContextSwitch;
42} TraceISRCoreData_t;
43
47typedef struct TraceISRData /* Aligned */
48{
49 TraceISRCoreData_t cores[TRC_CFG_CORE_COUNT]; /* ISR handles */
50} TraceISRData_t;
51
52/* We expose this to enable faster access */
53extern TraceISRData_t* pxTraceISRData;
54
64traceResult xTraceISRInitialize(TraceISRData_t *pxBuffer);
65
93traceResult xTraceISRRegister(const char* szName, uint32_t uiPriority, TraceISRHandle_t* pxISRHandle);
94
106traceResult xTraceISRBegin(TraceISRHandle_t xISRHandle);
107
123traceResult xTraceISREnd(TraceBaseType_t xIsTaskSwitchRequired);
124
125#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)
126
138traceResult xTraceISRGetCurrentNesting(int32_t* puiValue);
139
146
155traceResult xTraceISRGetCurrent(TraceISRHandle_t* pxISRHandle);
156
157#else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
158
170#define xTraceISRGetCurrentNesting(puiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiValue) = pxTraceISRData->cores[TRC_CFG_GET_CURRENT_CORE()].stackIndex, TRC_SUCCESS)
171
177#define xTraceISRGetCurrentNestingReturned() (pxTraceISRData->cores[TRC_CFG_GET_CURRENT_CORE()].stackIndex)
178
190#define xTraceISRGetCurrent(pxISRHandle) (xTraceISRGetCurrentNestingReturned() >= 0 ? (*(pxISRHandle) = pxTraceISRData->cores[TRC_CFG_GET_CURRENT_CORE()].handleStack[xTraceISRGetCurrentNestingReturned()], TRC_SUCCESS) : TRC_FAIL)
191
192#endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */
193
195TraceISRHandle_t xTraceSetISRProperties(const char* szName, uint32_t uiPriority);
196
198#define xTraceGetCurrentISRNesting(puiValue) xTraceISRGetCurrentNesting(puiValue)
199
201#define vTraceStoreISRBegin(xISRHandle) xTraceISRBegin(xISRHandle)
202
204#define vTraceStoreISREnd(xIsTaskSwitchRequired) xTraceISREnd(xIsTaskSwitchRequired)
205
208#ifdef __cplusplus
209}
210#endif
211
212#endif
213
214#endif
215
216#endif
#define xTraceISRGetCurrentNesting(puiValue)
Gets current trace ISR nesting level.
Definition: trcISR.h:170
traceResult xTraceISRRegister(const char *szName, uint32_t uiPriority, TraceISRHandle_t *pxISRHandle)
Registers trace ISR.
Definition: trcISR.c:49
traceResult xTraceISREnd(TraceBaseType_t xIsTaskSwitchRequired)
Registers the end of an Interrupt Service Routine.
Definition: trcCTI.c:1953
traceResult xTraceISRBegin(TraceISRHandle_t xISRHandle)
Registers the beginning of an Interrupt Service Routine.
Definition: trcISR.c:108
#define xTraceISRGetCurrent(pxISRHandle)
Gets current trace ISR nesting level.
Definition: trcISR.h:190
#define xTraceISRGetCurrentNestingReturned()
Definition: trcISR.h:177