Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
tracing_macros.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_TRACING_TRACING_MACROS_H_
7
#define ZEPHYR_INCLUDE_TRACING_TRACING_MACROS_H_
8
9
#ifndef CONFIG_TRACING
10
11
#define SYS_PORT_TRACING_FUNC(type, func, ...) do { } while (false)
12
#define SYS_PORT_TRACING_FUNC_ENTER(type, func, ...) do { } while (false)
13
#define SYS_PORT_TRACING_FUNC_BLOCKING(type, func, ...) do { } while (false)
14
#define SYS_PORT_TRACING_FUNC_EXIT(type, func, ...) do { } while (false)
15
#define SYS_PORT_TRACING_OBJ_INIT(obj_type, obj, ...) do { } while (false)
16
#define SYS_PORT_TRACING_OBJ_FUNC(obj_type, func, obj, ...) do { } while (false)
17
#define SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func, obj, ...) do { } while (false)
18
#define SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func, obj, ...) do { } while (false)
19
#define SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func, obj, ...) do { } while (false)
20
21
#else
22
23
/* Helper macros used by the extended tracing system
24
*/
25
#define _SYS_PORT_TRACING_TYPE_MASK(type) \
26
sys_port_trace_type_mask_ ## type
27
#define _SYS_PORT_TRACING_FUNC(name, func) \
28
sys_port_trace_ ## name ## _ ## func
29
#define _SYS_PORT_TRACING_FUNC_ENTER(name, func) \
30
sys_port_trace_ ## name ## _ ## func ## _enter
31
#define _SYS_PORT_TRACING_FUNC_BLOCKING(name, func) \
32
sys_port_trace_ ## name ## _ ## func ## _blocking
33
#define _SYS_PORT_TRACING_FUNC_EXIT(name, func) \
34
sys_port_trace_ ## name ## _ ## func ## _exit
35
#define _SYS_PORT_TRACING_OBJ_INIT(name) \
36
sys_port_trace_ ## name ## _init
37
#define _SYS_PORT_TRACING_OBJ_FUNC(name, func) \
38
sys_port_trace_ ## name ## _ ## func
39
#define _SYS_PORT_TRACING_OBJ_FUNC_ENTER(name, func) \
40
sys_port_trace_ ## name ## _ ## func ## _enter
41
#define _SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(name, func) \
42
sys_port_trace_ ## name ## _ ## func ## _blocking
43
#define _SYS_PORT_TRACING_OBJ_FUNC_EXIT(name, func) \
44
sys_port_trace_ ## name ## _ ## func ## _exit
45
46
47
/* Object trace macros part of the system for checking if certain
48
* objects should be traced or not depending on the tracing configuration.
49
*/
50
#if defined(CONFIG_TRACING_THREAD)
51
#define sys_port_trace_type_mask_k_thread(trace_call) trace_call
52
#else
53
#define sys_port_trace_type_mask_k_thread(trace_call)
54
#endif
55
56
#if defined(CONFIG_TRACING_WORK)
57
#define sys_port_trace_type_mask_k_work(trace_call) trace_call
58
#define sys_port_trace_type_mask_k_work_queue(trace_call) trace_call
59
#define sys_port_trace_type_mask_k_work_delayable(trace_call) trace_call
60
#define sys_port_trace_type_mask_k_work_poll(trace_call) trace_call
61
#else
62
#define sys_port_trace_type_mask_k_work(trace_call)
63
#define sys_port_trace_type_mask_k_work_queue(trace_call)
64
#define sys_port_trace_type_mask_k_work_delayable(trace_call)
65
#define sys_port_trace_type_mask_k_work_poll(trace_call)
66
#endif
67
68
#if defined(CONFIG_TRACING_SEMAPHORE)
69
#define sys_port_trace_type_mask_k_sem(trace_call) trace_call
70
#else
71
#define sys_port_trace_type_mask_k_sem(trace_call)
72
#endif
73
74
#if defined(CONFIG_TRACING_MUTEX)
75
#define sys_port_trace_type_mask_k_mutex(trace_call) trace_call
76
#else
77
#define sys_port_trace_type_mask_k_mutex(trace_call)
78
#endif
79
80
#if defined(CONFIG_TRACING_CONDVAR)
81
#define sys_port_trace_type_mask_k_condvar(trace_call) trace_call
82
#else
83
#define sys_port_trace_type_mask_k_condvar(trace_call)
84
#endif
85
86
#if defined(CONFIG_TRACING_QUEUE)
87
#define sys_port_trace_type_mask_k_queue(trace_call) trace_call
88
#else
89
#define sys_port_trace_type_mask_k_queue(trace_call)
90
#endif
91
92
#if defined(CONFIG_TRACING_FIFO)
93
#define sys_port_trace_type_mask_k_fifo(trace_call) trace_call
94
#else
95
#define sys_port_trace_type_mask_k_fifo(trace_call)
96
#endif
97
98
#if defined(CONFIG_TRACING_LIFO)
99
#define sys_port_trace_type_mask_k_lifo(trace_call) trace_call
100
#else
101
#define sys_port_trace_type_mask_k_lifo(trace_call)
102
#endif
103
104
#if defined(CONFIG_TRACING_STACK)
105
#define sys_port_trace_type_mask_k_stack(trace_call) trace_call
106
#else
107
#define sys_port_trace_type_mask_k_stack(trace_call)
108
#endif
109
110
#if defined(CONFIG_TRACING_MESSAGE_QUEUE)
111
#define sys_port_trace_type_mask_k_msgq(trace_call) trace_call
112
#else
113
#define sys_port_trace_type_mask_k_msgq(trace_call)
114
#endif
115
116
#if defined(CONFIG_TRACING_MAILBOX)
117
#define sys_port_trace_type_mask_k_mbox(trace_call) trace_call
118
#else
119
#define sys_port_trace_type_mask_k_mbox(trace_call)
120
#endif
121
122
#if defined(CONFIG_TRACING_PIPE)
123
#define sys_port_trace_type_mask_k_pipe(trace_call) trace_call
124
#else
125
#define sys_port_trace_type_mask_k_pipe(trace_call)
126
#endif
127
128
#if defined(CONFIG_TRACING_HEAP)
129
#define sys_port_trace_type_mask_k_heap(trace_call) trace_call
130
#define sys_port_trace_type_mask_k_heap_sys(trace_call) trace_call
131
#else
132
#define sys_port_trace_type_mask_k_heap(trace_call)
133
#define sys_port_trace_type_mask_k_heap_sys(trace_call)
134
#endif
135
136
#if defined(CONFIG_TRACING_MEMORY_SLAB)
137
#define sys_port_trace_type_mask_k_mem_slab(trace_call) trace_call
138
#else
139
#define sys_port_trace_type_mask_k_mem_slab(trace_call)
140
#endif
141
142
#if defined(CONFIG_TRACING_TIMER)
143
#define sys_port_trace_type_mask_k_timer(trace_call) trace_call
144
#else
145
#define sys_port_trace_type_mask_k_timer(trace_call)
146
#endif
147
148
#if defined(CONFIG_TRACING_EVENT)
149
#define sys_port_trace_type_mask_k_event(trace_call) trace_call
150
#else
151
#define sys_port_trace_type_mask_k_event(trace_call)
152
#endif
153
154
163
#define SYS_PORT_TRACING_TYPE_MASK(type, trace_call) \
164
_SYS_PORT_TRACING_TYPE_MASK(type)(trace_call)
165
166
167
168
181
#define SYS_PORT_TRACING_FUNC(type, func, ...) \
182
do { \
183
_SYS_PORT_TRACING_FUNC(type, func)(__VA_ARGS__); \
184
} while (false)
185
198
#define SYS_PORT_TRACING_FUNC_ENTER(type, func, ...) \
199
do { \
200
_SYS_PORT_TRACING_FUNC_ENTER(type, func)(__VA_ARGS__); \
201
} while (false)
202
214
#define SYS_PORT_TRACING_FUNC_BLOCKING(type, func, ...) \
215
do { \
216
_SYS_PORT_TRACING_FUNC_BLOCKING(type, func)(__VA_ARGS__); \
217
} while (false)
218
231
#define SYS_PORT_TRACING_FUNC_EXIT(type, func, ...) \
232
do { \
233
_SYS_PORT_TRACING_FUNC_EXIT(type, func)(__VA_ARGS__); \
234
} while (false)
235
244
#define SYS_PORT_TRACING_OBJ_INIT(obj_type, obj, ...) \
245
do { \
246
SYS_PORT_TRACING_TYPE_MASK(obj_type, \
247
_SYS_PORT_TRACING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
248
} while (false)
249
262
#define SYS_PORT_TRACING_OBJ_FUNC(obj_type, func, obj, ...) \
263
do { \
264
SYS_PORT_TRACING_TYPE_MASK(obj_type, \
265
_SYS_PORT_TRACING_OBJ_FUNC(obj_type, func)(obj, ##__VA_ARGS__)); \
266
} while (false)
267
281
#define SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func, obj, ...) \
282
do { \
283
SYS_PORT_TRACING_TYPE_MASK(obj_type, \
284
_SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
285
} while (false)
286
299
#define SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func, obj, timeout, ...) \
300
do { \
301
SYS_PORT_TRACING_TYPE_MASK(obj_type, \
302
_SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func) \
303
(obj, timeout, ##__VA_ARGS__)); \
304
} while (false)
305
319
#define SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func, obj, ...) \
320
do { \
321
SYS_PORT_TRACING_TYPE_MASK(obj_type, \
322
_SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
323
} while (false)
324
#endif
/* CONFIG_TRACING */
325
#endif
include
tracing
tracing_macros.h
Generated on Sun Oct 9 2022 09:21:57 for Zephyr API Documentation by
1.9.4