|
Zephyr API 3.6.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
6#ifndef ZEPHYR_INCLUDE_TRACING_TRACING_MACROS_H_
7#define ZEPHYR_INCLUDE_TRACING_TRACING_MACROS_H_
11#if !defined(CONFIG_TRACING) && !defined(__DOXYGEN__)
13#define SYS_PORT_TRACING_FUNC(type, func, ...) do { } while (false)
14#define SYS_PORT_TRACING_FUNC_ENTER(type, func, ...) do { } while (false)
15#define SYS_PORT_TRACING_FUNC_BLOCKING(type, func, ...) do { } while (false)
16#define SYS_PORT_TRACING_FUNC_EXIT(type, func, ...) do { } while (false)
17#define SYS_PORT_TRACING_OBJ_INIT(obj_type, obj, ...) do { } while (false)
18#define SYS_PORT_TRACING_OBJ_FUNC(obj_type, func, obj, ...) do { } while (false)
19#define SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func, obj, ...) do { } while (false)
20#define SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func, obj, ...) do { } while (false)
21#define SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func, obj, ...) do { } while (false)
23#define SYS_PORT_TRACING_TRACKING_FIELD(type)
40#define _SYS_PORT_TRACING_TYPE_MASK(type) \
41 sys_port_trace_type_mask_ ## type
42#define _SYS_PORT_TRACING_FUNC(name, func) \
43 sys_port_trace_ ## name ## _ ## func
44#define _SYS_PORT_TRACING_FUNC_ENTER(name, func) \
45 sys_port_trace_ ## name ## _ ## func ## _enter
46#define _SYS_PORT_TRACING_FUNC_BLOCKING(name, func) \
47 sys_port_trace_ ## name ## _ ## func ## _blocking
48#define _SYS_PORT_TRACING_FUNC_EXIT(name, func) \
49 sys_port_trace_ ## name ## _ ## func ## _exit
50#define _SYS_PORT_TRACING_OBJ_INIT(name) \
51 sys_port_trace_ ## name ## _init
52#define _SYS_PORT_TRACING_OBJ_FUNC(name, func) \
53 sys_port_trace_ ## name ## _ ## func
54#define _SYS_PORT_TRACING_OBJ_FUNC_ENTER(name, func) \
55 sys_port_trace_ ## name ## _ ## func ## _enter
56#define _SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(name, func) \
57 sys_port_trace_ ## name ## _ ## func ## _blocking
58#define _SYS_PORT_TRACING_OBJ_FUNC_EXIT(name, func) \
59 sys_port_trace_ ## name ## _ ## func ## _exit
65#define _SYS_PORT_TRACKING_OBJ_INIT(name) \
66 sys_port_track_ ## name ## _init
67#define _SYS_PORT_TRACKING_OBJ_FUNC(name, func) \
68 sys_port_track_ ## name ## _ ## func
74#if defined(CONFIG_TRACING_THREAD)
75 #define sys_port_trace_type_mask_k_thread(trace_call) trace_call
77 #define sys_port_trace_type_mask_k_thread(trace_call)
78 #define sys_port_trace_k_thread_is_disabled 1
81#if defined(CONFIG_TRACING_WORK)
82 #define sys_port_trace_type_mask_k_work(trace_call) trace_call
83 #define sys_port_trace_type_mask_k_work_queue(trace_call) trace_call
84 #define sys_port_trace_type_mask_k_work_delayable(trace_call) trace_call
85 #define sys_port_trace_type_mask_k_work_poll(trace_call) trace_call
87 #define sys_port_trace_type_mask_k_work(trace_call)
88 #define sys_port_trace_type_mask_k_work_queue(trace_call)
89 #define sys_port_trace_type_mask_k_work_delayable(trace_call)
90 #define sys_port_trace_type_mask_k_work_poll(trace_call)
93#if defined(CONFIG_TRACING_SEMAPHORE)
94 #define sys_port_trace_type_mask_k_sem(trace_call) trace_call
96 #define sys_port_trace_type_mask_k_sem(trace_call)
99#if defined(CONFIG_TRACING_MUTEX)
100 #define sys_port_trace_type_mask_k_mutex(trace_call) trace_call
102 #define sys_port_trace_type_mask_k_mutex(trace_call)
105#if defined(CONFIG_TRACING_CONDVAR)
106 #define sys_port_trace_type_mask_k_condvar(trace_call) trace_call
108 #define sys_port_trace_type_mask_k_condvar(trace_call)
111#if defined(CONFIG_TRACING_QUEUE)
112 #define sys_port_trace_type_mask_k_queue(trace_call) trace_call
114 #define sys_port_trace_type_mask_k_queue(trace_call)
117#if defined(CONFIG_TRACING_FIFO)
118 #define sys_port_trace_type_mask_k_fifo(trace_call) trace_call
120 #define sys_port_trace_type_mask_k_fifo(trace_call)
123#if defined(CONFIG_TRACING_LIFO)
124 #define sys_port_trace_type_mask_k_lifo(trace_call) trace_call
126 #define sys_port_trace_type_mask_k_lifo(trace_call)
129#if defined(CONFIG_TRACING_STACK)
130 #define sys_port_trace_type_mask_k_stack(trace_call) trace_call
132 #define sys_port_trace_type_mask_k_stack(trace_call)
135#if defined(CONFIG_TRACING_MESSAGE_QUEUE)
136 #define sys_port_trace_type_mask_k_msgq(trace_call) trace_call
138 #define sys_port_trace_type_mask_k_msgq(trace_call)
141#if defined(CONFIG_TRACING_MAILBOX)
142 #define sys_port_trace_type_mask_k_mbox(trace_call) trace_call
144 #define sys_port_trace_type_mask_k_mbox(trace_call)
147#if defined(CONFIG_TRACING_PIPE)
148 #define sys_port_trace_type_mask_k_pipe(trace_call) trace_call
150 #define sys_port_trace_type_mask_k_pipe(trace_call)
153#if defined(CONFIG_TRACING_HEAP)
154 #define sys_port_trace_type_mask_k_heap(trace_call) trace_call
155 #define sys_port_trace_type_mask_k_heap_sys(trace_call) trace_call
157 #define sys_port_trace_type_mask_k_heap(trace_call)
158 #define sys_port_trace_type_mask_k_heap_sys(trace_call)
161#if defined(CONFIG_TRACING_MEMORY_SLAB)
162 #define sys_port_trace_type_mask_k_mem_slab(trace_call) trace_call
164 #define sys_port_trace_type_mask_k_mem_slab(trace_call)
167#if defined(CONFIG_TRACING_TIMER)
168 #define sys_port_trace_type_mask_k_timer(trace_call) trace_call
170 #define sys_port_trace_type_mask_k_timer(trace_call)
173#if defined(CONFIG_TRACING_EVENT)
174 #define sys_port_trace_type_mask_k_event(trace_call) trace_call
176 #define sys_port_trace_type_mask_k_event(trace_call)
179#ifndef CONFIG_TRACING_POLLING
180 #define sys_port_trace_k_poll_api_is_disabled 1
181 #define sys_port_trace_k_work_poll_is_disabled 1
184#ifndef CONFIG_TRACING_PM
185 #define sys_port_trace_pm_is_disabled 1
188#if defined(CONFIG_TRACING_NET_SOCKETS)
189 #define sys_port_trace_type_mask_socket(trace_call) trace_call
191 #define sys_port_trace_type_mask_socket(trace_call)
194#if defined(CONFIG_TRACING_NET_CORE)
195 #define sys_port_trace_type_mask_net(trace_call) trace_call
197 #define sys_port_trace_type_mask_net(trace_call)
208#define _SYS_PORT_TRACE_IS_DISABLED(type) sys_port_trace_##type##_is_disabled
209#define _SYS_PORT_TRACE_WRAP(func, ...) do { func(__VA_ARGS__); } while (false)
210#define _SYS_PORT_TRACE_IF_NOT_DISABLED(type, func, ...) \
211 COND_CODE_1(_SYS_PORT_TRACE_IS_DISABLED(type), (), \
212 (_SYS_PORT_TRACE_WRAP(func, __VA_ARGS__)))
222#define SYS_PORT_TRACING_TYPE_MASK(type, trace_call) \
223 _SYS_PORT_TRACING_TYPE_MASK(type)(trace_call)
235#define SYS_PORT_TRACING_FUNC(type, func, ...) \
236 _SYS_PORT_TRACE_IF_NOT_DISABLED(type, _SYS_PORT_TRACING_FUNC(type, func), __VA_ARGS__)
248#define SYS_PORT_TRACING_FUNC_ENTER(type, func, ...) \
249 _SYS_PORT_TRACE_IF_NOT_DISABLED(type, _SYS_PORT_TRACING_FUNC_ENTER(type, func), __VA_ARGS__)
260#define SYS_PORT_TRACING_FUNC_BLOCKING(type, func, ...) \
261 _SYS_PORT_TRACE_IF_NOT_DISABLED(type, _SYS_PORT_TRACING_FUNC_BLOCKING(type, func), \
274#define SYS_PORT_TRACING_FUNC_EXIT(type, func, ...) \
275 _SYS_PORT_TRACE_IF_NOT_DISABLED(type, _SYS_PORT_TRACING_FUNC_EXIT(type, func), __VA_ARGS__)
283#define SYS_PORT_TRACING_OBJ_INIT(obj_type, obj, ...) \
285 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
286 _SYS_PORT_TRACING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
287 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
288 _SYS_PORT_TRACKING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
301#define SYS_PORT_TRACING_OBJ_FUNC(obj_type, func, obj, ...) \
303 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
304 _SYS_PORT_TRACING_OBJ_FUNC(obj_type, func)(obj, ##__VA_ARGS__)); \
305 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
306 _SYS_PORT_TRACKING_OBJ_FUNC(obj_type, func)(obj, ##__VA_ARGS__)); \
320#define SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func, obj, ...) \
322 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
323 _SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
337#define SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func, obj, timeout, ...) \
339 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
340 _SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func) \
341 (obj, timeout, ##__VA_ARGS__)); \
355#define SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func, obj, ...) \
357 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
358 _SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
366#define SYS_PORT_TRACING_TRACKING_FIELD(type) \
367 SYS_PORT_TRACING_TYPE_MASK(type, struct type *_obj_track_next;)