Percepio Trace Recorder v4.8.0.hotfix1
Loading...
Searching...
No Matches
trcRunnable.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_RUNNABLE_H
16#define TRC_RUNNABLE_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
34typedef enum TraceRunnableRegisterMethod
35{
36 TRC_RUNNABLE_REGISTER_METHOD_USE_ENTRY_TABLE,
37 TRC_RUNNABLE_REGISTER_METHOD_USE_STRING_ADDRESS,
38 TRC_RUNNABLE_REGISTER_METHOD_USE_HANDLE_ADDRESS,
39} TraceRunnableRegisterMethod_t;
40
54traceResult xTraceRunnableRegister(const char* szName, TraceRunnableRegisterMethod_t uxRegisterMethod, TraceRunnableHandle_t* pxRunnableHandle);
55
64#define xTraceRunnableStart(xRunnableHandle) xTraceEventCreate1(PSF_EVENT_RUNNABLE_START, (TraceUnsignedBaseType_t)(xRunnableHandle))
65
72#define xTraceRunnableStop() xTraceEventCreate0(PSF_EVENT_RUNNABLE_STOP)
73
87#define xTraceRunnableRegisterStaticSet(szName, uiMajor, uiMinor, uiPatch, uiRunnableCount, pxRunnableSetHandle) xTraceExtensionCreate(szName, uiMajor, uiMinor, uiPatch, uiRunnableCount, pxRunnableSetHandle)
88
98#define xTraceRunnableStartStatic(xRunnableSetHandle, uiRunnableId) xTraceEventCreate0(xTraceExtensionGetEventId(xRunnableSetHandle, uiRunnableId))
99
106#define xTraceRunnableStopStatic() xTraceRunnableStop()
107
110#ifdef __cplusplus
111}
112#endif
113
114#else
115
116#ifndef xTraceRunnableRegister
117#define xTraceRunnableRegister(szName, uxRegisterMethod, pxRunnableHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4((void)(szName), (void)(uxRegisterMethod), (void)(pxRunnableHandle), TRC_SUCCESS)
118#endif
119
120#ifndef xTraceRunnableStart
121#define xTraceRunnableStart(xRunnableHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(xRunnableHandle), TRC_SUCCESS)
122#endif
123
124#ifndef xTraceRunnableStop
125#define xTraceRunnableStop() (TRC_SUCCESS)
126#endif
127
128#endif
129
130#else
131
132#ifndef xTraceRunnableRegister
133#define xTraceRunnableRegister(szName, uxRegisterMethod, pxRunnableHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4((void)(szName), (void)(uxRegisterMethod), (void)(pxRunnableHandle), TRC_SUCCESS)
134#endif
135
136#ifndef xTraceRunnableStart
137#define xTraceRunnableStart(xRunnableHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(xRunnableHandle), TRC_SUCCESS)
138#endif
139
140#ifndef xTraceRunnableStop
141#define xTraceRunnableStop() (TRC_SUCCESS)
142#endif
143
144#endif
145
146#endif
traceResult xTraceRunnableRegister(const char *szName, TraceRunnableRegisterMethod_t uxRegisterMethod, TraceRunnableHandle_t *pxRunnableHandle)
Registers a runnable. Can be called multiple times, will not create additional entries.
Definition: trcRunnable.c:20