Mistake on this page?
Report an issue in GitHub or email us
wsf_trace.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file wsf_trace.h
4  *
5  * \brief Trace message interface.
6  *
7  * Copyright (c) 2009-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 #ifndef WSF_TRACE_H
25 #define WSF_TRACE_H
26 
27 #include <stdarg.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /*! \addtogroup WSF_TRACE_API
34  * \{ */
35 
36 /**************************************************************************************************
37  Macros
38 **************************************************************************************************/
39 
40 #ifndef WSF_TRACE_ENABLED
41 /*! \brief Trace enable flag (default is disabled, override with compile-time directive). */
42 #define WSF_TRACE_ENABLED FALSE
43 #endif
44 
45 #ifndef WSF_TOKEN_ENABLED
46 /*! \brief Tokenized tracing enable flag (default is disabled, override with compile-time directive). */
47 #define WSF_TOKEN_ENABLED FALSE
48 #endif
49 
50 #ifndef LL_TRACE_ENABLED
51 /*! \brief Trace enabled for controller */
52 #define LL_TRACE_ENABLED FALSE
53 #endif
54 
55 #ifndef AUD_TRACE_ENABLED
56 /*! \brief Trace enabled for audio subsystem */
57 #define AUD_TRACE_ENABLED FALSE
58 #endif
59 
60 /**************************************************************************************************
61  Data Types
62 **************************************************************************************************/
63 
64 /*! \brief Token event handler. */
65 typedef bool_t (*WsfTraceHandler_t)(const uint8_t *pBuf, uint32_t len);
66 
67 /*! \brief BT4 Platform trace callback. */
68 typedef void (*WsfBt4TraceCback_t)(const char *pStr, va_list args);
69 
70 /**************************************************************************************************
71  Function Prototypes
72 **************************************************************************************************/
73 
74 /*************************************************************************************************/
75 /*!
76  * \brief Output tokenized message.
77  *
78  * \param tok Token
79  * \param var Variable
80  */
81 /*************************************************************************************************/
82 void WsfToken(uint32_t tok, uint32_t var);
83 
84 /*************************************************************************************************/
85 /*!
86  * \brief Enable trace messages.
87  *
88  * \param enable TRUE to enable, FALSE to disable
89  */
90 /*************************************************************************************************/
91 void WsfTraceEnable(bool_t enable);
92 
93 /*************************************************************************************************/
94 /*!
95  * \brief Output trace message.
96  *
97  * \param pStr Format string
98  * Addition parameters variable arguments to the format string.
99  */
100 /*************************************************************************************************/
101 void WsfTrace(const char *pStr, ...);
102 
103 /*************************************************************************************************/
104 /*!
105  * \brief Register trace handler.
106  *
107  * \param traceCback Token event handler.
108  *
109  * This routine registers a token callback. This callback is called when the next token event
110  * is ready to be written to the I/O.
111  */
112 /*************************************************************************************************/
114 
115 /*************************************************************************************************/
116 /*!
117  * \brief Register BT4 platform trace callback function.
118  *
119  * \param cback Callback function
120  */
121 /*************************************************************************************************/
123 
124 /*************************************************************************************************/
125 /*!
126  * \brief Service the trace ring buffer.
127  *
128  * \return TRUE if trace messages pending, FALSE otherwise.
129  *
130  * This routine is called in the main loop for a "push" type trace systems.
131  */
132 /*************************************************************************************************/
133 bool_t WsfTokenService(void);
134 
135 /**************************************************************************************************
136  Macros
137 **************************************************************************************************/
138 
139 #ifdef TOKEN_GENERATION
140 
141 #define WSF_TOKEN(subsys, stat, msg) \
142  __WSF_TOKEN_DEFINE_( \
143  /* token: */ MODULE_ID, __LINE__, \
144  /* origin: */ __FILE__, subsys, \
145  /* message: */ stat, msg)
146 
147 #define WSF_TRACE0(subsys, stat, msg) WSF_TOKEN(subsys, stat, msg)
148 #define WSF_TRACE1(subsys, stat, msg, var1) WSF_TOKEN(subsys, stat, msg)
149 #define WSF_TRACE2(subsys, stat, msg, var1, var2) WSF_TOKEN(subsys, stat, msg)
150 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) WSF_TOKEN(subsys, stat, msg)
151 
152 #elif WSF_TOKEN_ENABLED == TRUE
153 
154 /** \name Trace macros
155  *
156  */
157 /**@{*/
158 #define WSF_TRACE0(subsys, stat, msg) \
159  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, 0)
160 #define WSF_TRACE1(subsys, stat, msg, var1) \
161  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)(var1))
162 #define WSF_TRACE2(subsys, stat, msg, var1, var2) \
163  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)(((var2) << 16) | ((var1) & 0xFFFF)))
164 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \
165  WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)((((var3) & 0xFFFF) << 16) | (((var2) & 0xFF) << 8) | ((var1) & 0xFF)))
166 /**@}*/
167 
168 #elif WSF_TRACE_ENABLED == TRUE
169 
170 /** \name Trace macros
171  *
172  */
173 /**@{*/
174 #define WSF_TRACE0(subsys, stat, msg) \
175  WsfTrace(msg)
176 #define WSF_TRACE1(subsys, stat, msg, var1) \
177  WsfTrace(msg, var1)
178 #define WSF_TRACE2(subsys, stat, msg, var1, var2) \
179  WsfTrace(msg, var1, var2)
180 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \
181  WsfTrace(msg, var1, var2, var3)
182 #define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4) \
183  WsfTrace(msg, var1, var2, var3, var4)
184 #define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5) \
185  WsfTrace(msg, var1, var2, var3, var4, var5)
186 #define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6) \
187  WsfTrace(msg, var1, var2, var3, var4, var5, var6)
188 #define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7) \
189  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7)
190 #define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8) \
191  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8)
192 #define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \
193  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
194 #define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \
195  WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
196 /**@}*/
197 
198 #else
199 
200 /** \name Trace macros
201  *
202  */
203 /**@{*/
204 #define WSF_TRACE0(subsys, stat, msg)
205 #define WSF_TRACE1(subsys, stat, msg, var1)
206 #define WSF_TRACE2(subsys, stat, msg, var1, var2)
207 #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3)
208 #define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4)
209 #define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5)
210 #define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6)
211 #define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7)
212 #define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8)
213 #define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
214 #define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
215 /**@}*/
216 #endif
217 
218 /*! \brief 0 argument WSF info trace. */
219 #define WSF_TRACE_INFO0(msg)
220 /*! \brief 1 argument WSF info trace. */
221 #define WSF_TRACE_INFO1(msg, var1)
222 /*! \brief 2 argument WSF info trace. */
223 #define WSF_TRACE_INFO2(msg, var1, var2)
224 /*! \brief 3 argument WSF info trace. */
225 #define WSF_TRACE_INFO3(msg, var1, var2, var3)
226 /*! \brief 0 argument WSF warning trace. */
227 #define WSF_TRACE_WARN0(msg) WSF_TRACE0("WSF", "WARN", msg)
228 /*! \brief 1 argument WSF warning trace. */
229 #define WSF_TRACE_WARN1(msg, var1) WSF_TRACE1("WSF", "WARN", msg, var1)
230 /*! \brief 2 argument WSF warning trace. */
231 #define WSF_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("WSF", "WARN", msg, var1, var2)
232 /*! \brief 3 argument WSF warning trace. */
233 #define WSF_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("WSF", "WARN", msg, var1, var2, var3)
234 /*! \brief 0 argument WSF error trace. */
235 #define WSF_TRACE_ERR0(msg) WSF_TRACE0("WSF", "ERR", msg)
236 /*! \brief 1 argument WSF error trace. */
237 #define WSF_TRACE_ERR1(msg, var1) WSF_TRACE1("WSF", "ERR", msg, var1)
238 /*! \brief 2 argument WSF error trace. */
239 #define WSF_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("WSF", "ERR", msg, var1, var2)
240 /*! \brief 3 argument WSF error trace. */
241 #define WSF_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("WSF", "ERR", msg, var1, var2, var3)
242 /*! \brief 0 argument WSF buffer allocation trace. */
243 #define WSF_TRACE_ALLOC0(msg)
244 /*! \brief 1 argument WSF buffer allocation trace. */
245 #define WSF_TRACE_ALLOC1(msg, var1)
246 /*! \brief 2 argument WSF buffer allocation trace. */
247 #define WSF_TRACE_ALLOC2(msg, var1, var2)
248 /*! \brief 3 argument WSF buffer allocation trace. */
249 #define WSF_TRACE_ALLOC3(msg, var1, var2, var3)
250 /*! \brief 0 argument WSF buffer free trace. */
251 #define WSF_TRACE_FREE0(msg)
252 /*! \brief 1 argument WSF buffer free trace. */
253 #define WSF_TRACE_FREE1(msg, var1)
254 /*! \brief 2 argument WSF buffer free trace. */
255 #define WSF_TRACE_FREE2(msg, var1, var2)
256 /*! \brief 3 argument WSF buffer free trace. */
257 #define WSF_TRACE_FREE3(msg, var1, var2, var3)
258 /*! \brief 0 argument WSF message trace. */
259 #define WSF_TRACE_MSG0(msg)
260 /*! \brief 1 argument WSF message trace. */
261 #define WSF_TRACE_MSG1(msg, var1)
262 /*! \brief 2 argument WSF message trace. */
263 #define WSF_TRACE_MSG2(msg, var1, var2)
264 /*! \brief 3 argument WSF message trace. */
265 #define WSF_TRACE_MSG3(msg, var1, var2, var3)
266 
267 /*! \brief 0 argument HCI info trace. */
268 #define HCI_TRACE_INFO0(msg) WSF_TRACE0("HCI", "INFO", msg)
269 /*! \brief 1 argument HCI info trace. */
270 #define HCI_TRACE_INFO1(msg, var1) WSF_TRACE1("HCI", "INFO", msg, var1)
271 /*! \brief 2 argument HCI info trace. */
272 #define HCI_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("HCI", "INFO", msg, var1, var2)
273 /*! \brief 3 argument HCI info trace. */
274 #define HCI_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("HCI", "INFO", msg, var1, var2, var3)
275 /*! \brief 0 argument HCI warning trace. */
276 #define HCI_TRACE_WARN0(msg) WSF_TRACE0("HCI", "WARN", msg)
277 /*! \brief 1 argument HCI warning trace. */
278 #define HCI_TRACE_WARN1(msg, var1) WSF_TRACE1("HCI", "WARN", msg, var1)
279 /*! \brief 2 argument HCI warning trace. */
280 #define HCI_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("HCI", "WARN", msg, var1, var2)
281 /*! \brief 3 argument HCI warning trace. */
282 #define HCI_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("HCI", "WARN", msg, var1, var2, var3)
283 /*! \brief 0 argument HCI error trace. */
284 #define HCI_TRACE_ERR0(msg) WSF_TRACE0("HCI", "ERR", msg)
285 /*! \brief 1 argument HCI error trace. */
286 #define HCI_TRACE_ERR1(msg, var1) WSF_TRACE1("HCI", "ERR", msg, var1)
287 /*! \brief 2 argument HCI error trace. */
288 #define HCI_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("HCI", "ERR", msg, var1, var2)
289 /*! \brief 3 argument HCI error trace. */
290 #define HCI_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("HCI", "ERR", msg, var1, var2, var3)
291 
292 /*! \brief HCI PDUMP on command. */
293 #define HCI_PDUMP_CMD(len, pBuf)
294 /*! \brief HCI PDUMP on event. */
295 #define HCI_PDUMP_EVT(len, pBuf)
296 /*! \brief HCI PDUMP on transmitted ACL message. */
297 #define HCI_PDUMP_TX_ACL(len, pBuf)
298 /*! \brief HCI PDUMP on Received ACL message. */
299 #define HCI_PDUMP_RX_ACL(len, pBuf)
300 /*! \brief HCI PDUMP on transmitted ISO message. */
301 #define HCI_PDUMP_TX_ISO(len, pBuf)
302 /*! \brief HCI PDUMP on Received ISO message. */
303 #define HCI_PDUMP_RX_ISO(len, pBuf)
304 
305 /*! \brief 0 argument DM info trace. */
306 #define DM_TRACE_INFO0(msg) WSF_TRACE0("DM", "INFO", msg)
307 /*! \brief 1 argument DM info trace. */
308 #define DM_TRACE_INFO1(msg, var1) WSF_TRACE1("DM", "INFO", msg, var1)
309 /*! \brief 2 argument DM info trace. */
310 #define DM_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("DM", "INFO", msg, var1, var2)
311 /*! \brief 3 argument DM info trace. */
312 #define DM_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("DM", "INFO", msg, var1, var2, var3)
313 /*! \brief 0 argument DM warning trace. */
314 #define DM_TRACE_WARN0(msg) WSF_TRACE0("DM", "WARN", msg)
315 /*! \brief 1 argument DM warning trace. */
316 #define DM_TRACE_WARN1(msg, var1) WSF_TRACE1("DM", "WARN", msg, var1)
317 /*! \brief 2 argument DM warning trace. */
318 #define DM_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("DM", "WARN", msg, var1, var2)
319 /*! \brief 3 argument DM warning trace. */
320 #define DM_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("DM", "WARN", msg, var1, var2, var3)
321 /*! \brief 0 argument DM error trace. */
322 #define DM_TRACE_ERR0(msg) WSF_TRACE0("DM", "ERR", msg)
323 /*! \brief 1 argument DM error trace. */
324 #define DM_TRACE_ERR1(msg, var1) WSF_TRACE1("DM", "ERR", msg, var1)
325 /*! \brief 2 argument DM error trace. */
326 #define DM_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("DM", "ERR", msg, var1, var2)
327 /*! \brief 3 argument DM error trace. */
328 #define DM_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("DM", "ERR", msg, var1, var2, var3)
329 /*! \brief 0 argument DM buffer allocation trace. */
330 #define DM_TRACE_ALLOC0(msg) WSF_TRACE0("DM", "ALLOC", msg)
331 /*! \brief 1 argument DM buffer allocation trace. */
332 #define DM_TRACE_ALLOC1(msg, var1) WSF_TRACE1("DM", "ALLOC", msg, var1)
333 /*! \brief 2 argument DM buffer allocation trace. */
334 #define DM_TRACE_ALLOC2(msg, var1, var2) WSF_TRACE2("DM", "ALLOC", msg, var1, var2)
335 /*! \brief 3 argument DM buffer allocation trace. */
336 #define DM_TRACE_ALLOC3(msg, var1, var2, var3) WSF_TRACE3("DM", "ALLOC", msg, var1, var2, var3)
337 /*! \brief 0 argument DM buffer free trace. */
338 #define DM_TRACE_FREE0(msg) WSF_TRACE0("DM", "FREE", msg)
339 /*! \brief 1 argument DM buffer free trace. */
340 #define DM_TRACE_FREE1(msg, var1) WSF_TRACE1("DM", "FREE", msg, var1)
341 /*! \brief 2 argument DM buffer free trace. */
342 #define DM_TRACE_FREE2(msg, var1, var2) WSF_TRACE2("DM", "FREE", msg, var1, var2)
343 /*! \brief 3 argument DM buffer free trace. */
344 #define DM_TRACE_FREE3(msg, var1, var2, var3) WSF_TRACE3("DM", "FREE", msg, var1, var2, var3)
345 
346 /*! \brief 0 argument L2C info trace. */
347 #define L2C_TRACE_INFO0(msg) WSF_TRACE0("L2C", "INFO", msg)
348 /*! \brief 1 argument L2C info trace. */
349 #define L2C_TRACE_INFO1(msg, var1) WSF_TRACE1("L2C", "INFO", msg, var1)
350 /*! \brief 2 argument L2C info trace. */
351 #define L2C_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("L2C", "INFO", msg, var1, var2)
352 /*! \brief 3 argument L2C info trace. */
353 #define L2C_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("L2C", "INFO", msg, var1, var2, var3)
354 /*! \brief 0 argument L2C warning trace. */
355 #define L2C_TRACE_WARN0(msg) WSF_TRACE0("L2C", "WARN", msg)
356 /*! \brief 1 argument L2C warning trace. */
357 #define L2C_TRACE_WARN1(msg, var1) WSF_TRACE1("L2C", "WARN", msg, var1)
358 /*! \brief 2 argument L2C warning trace. */
359 #define L2C_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("L2C", "WARN", msg, var1, var2)
360 /*! \brief 3 argument L2C warning trace. */
361 #define L2C_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("L2C", "WARN", msg, var1, var2, var3)
362 /*! \brief 0 argument L2C error trace. */
363 #define L2C_TRACE_ERR0(msg) WSF_TRACE0("L2C", "ERR", msg)
364 /*! \brief 1 argument L2C error trace. */
365 #define L2C_TRACE_ERR1(msg, var1) WSF_TRACE1("L2C", "ERR", msg, var1)
366 /*! \brief 2 argument L2C error trace. */
367 #define L2C_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("L2C", "ERR", msg, var1, var2)
368 /*! \brief 3 argument L2C error trace. */
369 #define L2C_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("L2C", "ERR", msg, var1, var2, var3)
370 
371 /*! \brief 0 argument ATT info trace. */
372 #define ATT_TRACE_INFO0(msg) WSF_TRACE0("ATT", "INFO", msg)
373 /*! \brief 1 argument ATT info trace. */
374 #define ATT_TRACE_INFO1(msg, var1) WSF_TRACE1("ATT", "INFO", msg, var1)
375 /*! \brief 2 argument ATT info trace. */
376 #define ATT_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("ATT", "INFO", msg, var1, var2)
377 /*! \brief 3 argument ATT info trace. */
378 #define ATT_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("ATT", "INFO", msg, var1, var2, var3)
379 /*! \brief 0 argument ATT warning trace. */
380 #define ATT_TRACE_WARN0(msg) WSF_TRACE0("ATT", "WARN", msg)
381 /*! \brief 1 argument ATT warning trace. */
382 #define ATT_TRACE_WARN1(msg, var1) WSF_TRACE1("ATT", "WARN", msg, var1)
383 /*! \brief 2 argument ATT warning trace. */
384 #define ATT_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("ATT", "WARN", msg, var1, var2)
385 /*! \brief 3 argument ATT warning trace. */
386 #define ATT_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("ATT", "WARN", msg, var1, var2, var3)
387 /*! \brief 0 argument ATT error trace. */
388 #define ATT_TRACE_ERR0(msg) WSF_TRACE0("ATT", "ERR", msg)
389 /*! \brief 1 argument ATT error trace. */
390 #define ATT_TRACE_ERR1(msg, var1) WSF_TRACE1("ATT", "ERR", msg, var1)
391 /*! \brief 2 argument ATT error trace. */
392 #define ATT_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("ATT", "ERR", msg, var1, var2)
393 /*! \brief 3 argument ATT error trace. */
394 #define ATT_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("ATT", "ERR", msg, var1, var2, var3)
395 
396 /*! \brief 0 argument EATT info trace. */
397 #define EATT_TRACE_INFO0(msg) WSF_TRACE0("EATT", "INFO", msg)
398 /*! \brief 1 argument EATT info trace. */
399 #define EATT_TRACE_INFO1(msg, var1) WSF_TRACE1("EATT", "INFO", msg, var1)
400 /*! \brief 2 argument EATT info trace. */
401 #define EATT_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("EATT", "INFO", msg, var1, var2)
402 /*! \brief 3 argument EATT info trace. */
403 #define EATT_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("EATT", "INFO", msg, var1, var2, var3)
404 /*! \brief 0 argument EATT warning trace. */
405 #define EATT_TRACE_WARN0(msg) WSF_TRACE0("EATT", "WARN", msg)
406 /*! \brief 1 argument EATT warning trace. */
407 #define EATT_TRACE_WARN1(msg, var1) WSF_TRACE1("EATT", "WARN", msg, var1)
408 /*! \brief 2 argument EATT warning trace. */
409 #define EATT_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("EATT", "WARN", msg, var1, var2)
410 /*! \brief 3 argument EATT warning trace. */
411 #define EATT_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("EATT", "WARN", msg, var1, var2, var3)
412 /*! \brief 0 argument EATT error trace. */
413 #define EATT_TRACE_ERR0(msg) WSF_TRACE0("EATT", "ERR", msg)
414 /*! \brief 1 argument EATT error trace. */
415 #define EATT_TRACE_ERR1(msg, var1) WSF_TRACE1("EATT", "ERR", msg, var1)
416 /*! \brief 2 argument EATT error trace. */
417 #define EATT_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("EATT", "ERR", msg, var1, var2)
418 /*! \brief 3 argument EATT error trace. */
419 #define EATT_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("EATT", "ERR", msg, var1, var2, var3)
420 
421 /*! \brief 0 argument SMP info trace. */
422 #define SMP_TRACE_INFO0(msg) WSF_TRACE0("SMP", "INFO", msg)
423 /*! \brief 1 argument SMP info trace. */
424 #define SMP_TRACE_INFO1(msg, var1) WSF_TRACE1("SMP", "INFO", msg, var1)
425 /*! \brief 2 argument SMP info trace. */
426 #define SMP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("SMP", "INFO", msg, var1, var2)
427 /*! \brief 3 argument SMP info trace. */
428 #define SMP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("SMP", "INFO", msg, var1, var2, var3)
429 /*! \brief 0 argument SMP warning trace. */
430 #define SMP_TRACE_WARN0(msg) WSF_TRACE0("SMP", "WARN", msg)
431 /*! \brief 1 argument SMP warning trace. */
432 #define SMP_TRACE_WARN1(msg, var1) WSF_TRACE1("SMP", "WARN", msg, var1)
433 /*! \brief 2 argument SMP warning trace. */
434 #define SMP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("SMP", "WARN", msg, var1, var2)
435 /*! \brief 3 argument SMP warning trace. */
436 #define SMP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("SMP", "WARN", msg, var1, var2, var3)
437 /*! \brief 0 argument SMP error trace. */
438 #define SMP_TRACE_ERR0(msg) WSF_TRACE0("SMP", "ERR", msg)
439 /*! \brief 1 argument SMP error trace. */
440 #define SMP_TRACE_ERR1(msg, var1) WSF_TRACE1("SMP", "ERR", msg, var1)
441 /*! \brief 2 argument SMP error trace. */
442 #define SMP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("SMP", "ERR", msg, var1, var2)
443 /*! \brief 3 argument SMP error trace. */
444 #define SMP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("SMP", "ERR", msg, var1, var2, var3)
445 
446 /*! \brief 0 argument App info trace. */
447 #define APP_TRACE_INFO0(msg) WSF_TRACE0("APP", "INFO", msg)
448 /*! \brief 1 argument App info trace. */
449 #define APP_TRACE_INFO1(msg, var1) WSF_TRACE1("APP", "INFO", msg, var1)
450 /*! \brief 2 argument App info trace. */
451 #define APP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("APP", "INFO", msg, var1, var2)
452 /*! \brief 3 argument App info trace. */
453 #define APP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("APP", "INFO", msg, var1, var2, var3)
454 /*! \brief 4 argument App info trace. */
455 #define APP_TRACE_INFO4(msg, var1, var2, var3, var4) \
456  WSF_TRACE4(INFO, APP, msg, var1, var2, var3, var4)
457 /*! \brief 5 argument App info trace. */
458 #define APP_TRACE_INFO5(msg, var1, var2, var3, var4, var5) \
459  WSF_TRACE5(INFO, APP, msg, var1, var2, var3, var4, var5)
460 /*! \brief 6 argument App info trace. */
461 #define APP_TRACE_INFO6(msg, var1, var2, var3, var4, var5, var6) \
462  WSF_TRACE6(INFO, APP, msg, var1, var2, var3, var4, var5, var6)
463 /*! \brief 7 argument App info trace. */
464 #define APP_TRACE_INFO7(msg, var1, var2, var3, var4, var5, var6, var7) \
465  WSF_TRACE7(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7)
466 /*! \brief 8 argument App info trace. */
467 #define APP_TRACE_INFO8(msg, var1, var2, var3, var4, var5, var6, var7, var8) \
468  WSF_TRACE8(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8)
469 /*! \brief 9 argument App info trace. */
470 #define APP_TRACE_INFO9(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \
471  WSF_TRACE9(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9)
472 /*! \brief 12 argument App info trace. */
473 #define APP_TRACE_INFO12(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \
474  WSF_TRACE12(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
475 /*! \brief 0 argument App warning trace. */
476 #define APP_TRACE_WARN0(msg) WSF_TRACE0("APP", "WARN", msg)
477 /*! \brief 1 argument App warning trace. */
478 #define APP_TRACE_WARN1(msg, var1) WSF_TRACE1("APP", "WARN", msg, var1)
479 /*! \brief 2 argument App warning trace. */
480 #define APP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("APP", "WARN", msg, var1, var2)
481 /*! \brief 3 argument App warning trace. */
482 #define APP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("APP", "WARN", msg, var1, var2, var3)
483 /*! \brief 0 argument App error trace. */
484 #define APP_TRACE_ERR0(msg) WSF_TRACE0("APP", "ERR", msg)
485 /*! \brief 1 argument App error trace. */
486 #define APP_TRACE_ERR1(msg, var1) WSF_TRACE1("APP", "ERR", msg, var1)
487 /*! \brief 2 argument App error trace. */
488 #define APP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("APP", "ERR", msg, var1, var2)
489 /*! \brief 3 argument App error trace. */
490 #define APP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("APP", "ERR", msg, var1, var2, var3)
491 
492 /*! \brief 0 argument LL info trace. */
493 #if (LL_TRACE_ENABLED == TRUE)
494 #define LL_TRACE_INFO0(msg) WSF_TRACE0("LL", "INFO", msg)
495 /*! \brief 1 argument LL info trace. */
496 #define LL_TRACE_INFO1(msg, var1) WSF_TRACE1("LL", "INFO", msg, var1)
497 /*! \brief 2 argument LL info trace. */
498 #define LL_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("LL", "INFO", msg, var1, var2)
499 /*! \brief 3 argument LL info trace. */
500 #define LL_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("LL", "INFO", msg, var1, var2, var3)
501 /*! \brief 0 argument LL warning trace. */
502 #define LL_TRACE_WARN0(msg) WSF_TRACE0("LL", "WARN", msg)
503 /*! \brief 1 argument LL warning trace. */
504 #define LL_TRACE_WARN1(msg, var1) WSF_TRACE1("LL", "WARN", msg, var1)
505 /*! \brief 2 argument LL warning trace. */
506 #define LL_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("LL", "WARN", msg, var1, var2)
507 /*! \brief 3 argument LL warning trace. */
508 #define LL_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("LL", "WARN", msg, var1, var2, var3)
509 /*! \brief 0 argument LL error trace. */
510 #define LL_TRACE_ERR0(msg) WSF_TRACE0("LL", "ERR", msg)
511 /*! \brief 1 argument LL error trace. */
512 #define LL_TRACE_ERR1(msg, var1) WSF_TRACE1("LL", "ERR", msg, var1)
513 /*! \brief 2 argument LL error trace. */
514 #define LL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("LL", "ERR", msg, var1, var2)
515 /*! \brief 3 argument LL error trace. */
516 #define LL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("LL", "ERR", msg, var1, var2, var3)
517 
518 /*! \brief 0 argument BBP warning trace. */
519 #define BBP_TRACE_INFO0(msg) WSF_TRACE0("BBP", "INFO", msg)
520 /*! \brief 1 argument BBP warning trace. */
521 #define BBP_TRACE_INFO1(msg, var1) WSF_TRACE1("BBP", "INFO", msg, var1)
522 /*! \brief 2 argument BBP warning trace. */
523 #define BBP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("BBP", "INFO", msg, var1, var2)
524 /*! \brief 3 argument BBP info trace. */
525 #define BBP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("BBP", "INFO", msg, var1, var2, var3)
526 /*! \brief 0 argument BBP warning trace. */
527 #define BBP_TRACE_WARN0(msg) WSF_TRACE0("BBP", "WARN", msg)
528 /*! \brief 1 argument BBP warning trace. */
529 #define BBP_TRACE_WARN1(msg, var1) WSF_TRACE1("BBP", "WARN", msg, var1)
530 /*! \brief 2 argument BBP warning trace. */
531 #define BBP_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("BBP", "WARN", msg, var1, var2)
532 /*! \brief 3 argument BBP warning trace. */
533 #define BBP_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("BBP", "WARN", msg, var1, var2, var3)
534 /*! \brief 0 argument BBP error trace. */
535 #define BBP_TRACE_ERR0(msg) WSF_TRACE0("BBP", "ERR", msg)
536 /*! \brief 1 argument BBP error trace. */
537 #define BBP_TRACE_ERR1(msg, var1) WSF_TRACE1("BBP", "ERR", msg, var1)
538 /*! \brief 2 argument BBP error trace. */
539 #define BBP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("BBP", "ERR", msg, var1, var2)
540 /*! \brief 3 argument BBP error trace. */
541 #define BBP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("BBP", "ERR", msg, var1, var2, var3)
542 #else /* LL_TRACE_ENABLED */
543 #define LL_TRACE_INFO0(msg)
544 /*! \brief 1 argument LL info trace. */
545 #define LL_TRACE_INFO1(msg, var1)
546 /*! \brief 2 argument LL info trace. */
547 #define LL_TRACE_INFO2(msg, var1, var2)
548 /*! \brief 3 argument LL info trace. */
549 #define LL_TRACE_INFO3(msg, var1, var2, var3)
550 /*! \brief 0 argument LL warning trace. */
551 #define LL_TRACE_WARN0(msg)
552 /*! \brief 1 argument LL warning trace. */
553 #define LL_TRACE_WARN1(msg, var1)
554 /*! \brief 2 argument LL warning trace. */
555 #define LL_TRACE_WARN2(msg, var1, var2)
556 /*! \brief 3 argument LL warning trace. */
557 #define LL_TRACE_WARN3(msg, var1, var2, var3)
558 /*! \brief 0 argument LL error trace. */
559 #define LL_TRACE_ERR0(msg)
560 /*! \brief 1 argument LL error trace. */
561 #define LL_TRACE_ERR1(msg, var1)
562 /*! \brief 2 argument LL error trace. */
563 #define LL_TRACE_ERR2(msg, var1, var2)
564 /*! \brief 3 argument LL error trace. */
565 #define LL_TRACE_ERR3(msg, var1, var2, var3)
566 
567 /*! \brief 0 argument BBP warning trace. */
568 #define BBP_TRACE_INFO0(msg)
569 /*! \brief 1 argument BBP warning trace. */
570 #define BBP_TRACE_INFO1(msg, var1)
571 /*! \brief 2 argument BBP warning trace. */
572 #define BBP_TRACE_INFO2(msg, var1, var2)
573 /*! \brief 3 argument BBP info trace. */
574 #define BBP_TRACE_INFO3(msg, var1, var2, var3)
575 /*! \brief 0 argument BBP warning trace. */
576 #define BBP_TRACE_WARN0(msg)
577 /*! \brief 1 argument BBP warning trace. */
578 #define BBP_TRACE_WARN1(msg, var1)
579 /*! \brief 2 argument BBP warning trace. */
580 #define BBP_TRACE_WARN2(msg, var1, var2)
581 /*! \brief 3 argument BBP warning trace. */
582 #define BBP_TRACE_WARN3(msg, var1, var2, var3)
583 /*! \brief 0 argument BBP error trace. */
584 #define BBP_TRACE_ERR0(msg)
585 /*! \brief 1 argument BBP error trace. */
586 #define BBP_TRACE_ERR1(msg, var1)
587 /*! \brief 2 argument BBP error trace. */
588 #define BBP_TRACE_ERR2(msg, var1, var2)
589 /*! \brief 3 argument BBP error trace. */
590 #define BBP_TRACE_ERR3(msg, var1, var2, var3)
591 #endif /* LL_TRACE_ENABLED */
592 
593 #if (AUD_TRACE_ENABLED == TRUE)
594 /*! \brief 0 argument AUD info trace. */
595 #define AUD_TRACE_INFO0(msg) WSF_TRACE0("AUD", "INFO", msg)
596 /*! \brief 1 argument AUD info trace. */
597 #define AUD_TRACE_INFO1(msg, var1) WSF_TRACE1("AUD", "INFO", msg, var1)
598 /*! \brief 2 argument AUD info trace. */
599 #define AUD_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("AUD", "INFO", msg, var1, var2)
600 /*! \brief 3 argument AUD info trace. */
601 #define AUD_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("AUD", "INFO", msg, var1, var2, var3)
602 /*! \brief 0 argument AUD warning trace. */
603 #define AUD_TRACE_WARN0(msg) WSF_TRACE0("AUD", "WARN", msg)
604 /*! \brief 1 argument AUD warning trace. */
605 #define AUD_TRACE_WARN1(msg, var1) WSF_TRACE1("AUD", "WARN", msg, var1)
606 /*! \brief 2 argument AUD warning trace. */
607 #define AUD_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("AUD", "WARN", msg, var1, var2)
608 /*! \brief 3 argument AUD warning trace. */
609 #define AUD_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("AUD", "WARN", msg, var1, var2, var3)
610 /*! \brief 0 argument AUD error trace. */
611 #define AUD_TRACE_ERR0(msg) WSF_TRACE0("AUD", "ERR", msg)
612 /*! \brief 1 argument AUD error trace. */
613 #define AUD_TRACE_ERR1(msg, var1) WSF_TRACE1("AUD", "ERR", msg, var1)
614 /*! \brief 2 argument AUD error trace. */
615 #define AUD_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("AUD", "ERR", msg, var1, var2)
616 /*! \brief 3 argument AUD error trace. */
617 #define AUD_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("AUD", "ERR", msg, var1, var2, var3)
618 #else /* AUD_TRACE_ENABLED */
619 /*! \brief 0 argument AUD info trace. */
620 #define AUD_TRACE_INFO0(msg)
621 /*! \brief 1 argument AUD info trace. */
622 #define AUD_TRACE_INFO1(msg, var1)
623 /*! \brief 2 argument AUD info trace. */
624 #define AUD_TRACE_INFO2(msg, var1, var2)
625 /*! \brief 3 argument AUD info trace. */
626 #define AUD_TRACE_INFO3(msg, var1, var2, var3)
627 /*! \brief 0 argument AUD warning trace. */
628 #define AUD_TRACE_WARN0(msg)
629 /*! \brief 1 argument AUD warning trace. */
630 #define AUD_TRACE_WARN1(msg, var1)
631 /*! \brief 2 argument AUD warning trace. */
632 #define AUD_TRACE_WARN2(msg, var1, var2)
633 /*! \brief 3 argument AUD warning trace. */
634 #define AUD_TRACE_WARN3(msg, var1, var2, var3)
635 /*! \brief 0 argument AUD error trace. */
636 #define AUD_TRACE_ERR0(msg)
637 /*! \brief 1 argument AUD error trace. */
638 #define AUD_TRACE_ERR1(msg, var1)
639 /*! \brief 2 argument AUD error trace. */
640 #define AUD_TRACE_ERR2(msg, var1, var2)
641 /*! \brief 3 argument AUD error trace. */
642 #define AUD_TRACE_ERR3(msg, var1, var2, var3)
643 #endif /* AUD_TRACE_ENABLED */
644 
645 /*! \brief 0 argument MESH info trace. */
646 #define MESH_TRACE_INFO0(msg) WSF_TRACE0("MESH", "INFO", msg)
647 /*! \brief 1 argument MESH info trace. */
648 #define MESH_TRACE_INFO1(msg, var1) WSF_TRACE1("MESH", "INFO", msg, var1)
649 /*! \brief 2 argument MESH info trace. */
650 #define MESH_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MESH", "INFO", msg, var1, var2)
651 /*! \brief 3 argument MESH info trace. */
652 #define MESH_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MESH", "INFO", msg, var1, var2, var3)
653 /*! \brief 0 argument MESH warning trace. */
654 #define MESH_TRACE_WARN0(msg) WSF_TRACE0("MESH", "WARN", msg)
655 /*! \brief 1 argument MESH warning trace. */
656 #define MESH_TRACE_WARN1(msg, var1) WSF_TRACE1("MESH", "WARN", msg, var1)
657 /*! \brief 2 argument MESH warning trace. */
658 #define MESH_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MESH", "WARN", msg, var1, var2)
659 /*! \brief 3 argument MESH warning trace. */
660 #define MESH_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MESH", "WARN", msg, var1, var2, var3)
661 /*! \brief 0 argument MESH error trace. */
662 #define MESH_TRACE_ERR0(msg) WSF_TRACE0("MESH", "ERR", msg)
663 /*! \brief 1 argument MESH error trace. */
664 #define MESH_TRACE_ERR1(msg, var1) WSF_TRACE1("MESH", "ERR", msg, var1)
665 /*! \brief 2 argument MESH error trace. */
666 #define MESH_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MESH", "ERR", msg, var1, var2)
667 /*! \brief 3 argument MESH error trace. */
668 #define MESH_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MESH", "ERR", msg, var1, var2, var3)
669 
670 /*! \brief 0 argument MMDL info trace. */
671 #define MMDL_TRACE_INFO0(msg) WSF_TRACE0("MMDL", "INFO", msg)
672 /*! \brief 1 argument MMDL info trace. */
673 #define MMDL_TRACE_INFO1(msg, var1) WSF_TRACE1("MMDL", "INFO", msg, var1)
674 /*! \brief 2 argument MMDL info trace. */
675 #define MMDL_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MMDL", "INFO", msg, var1, var2)
676 /*! \brief 3 argument MMDL info trace. */
677 #define MMDL_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "INFO", msg, var1, var2, var3)
678 /*! \brief 0 argument MMDL warning trace. */
679 #define MMDL_TRACE_WARN0(msg) WSF_TRACE0("MMDL", "WARN", msg)
680 /*! \brief 1 argument MMDL warning trace. */
681 #define MMDL_TRACE_WARN1(msg, var1) WSF_TRACE1("MMDL", "WARN", msg, var1)
682 /*! \brief 2 argument MMDL warning trace. */
683 #define MMDL_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MMDL", "WARN", msg, var1, var2)
684 /*! \brief 3 argument MMDL warning trace. */
685 #define MMDL_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "WARN", msg, var1, var2, var3)
686 /*! \brief 0 argument MMDL error trace. */
687 #define MMDL_TRACE_ERR0(msg) WSF_TRACE0("MMDL", "ERR", msg)
688 /*! \brief 1 argument MMDL error trace. */
689 #define MMDL_TRACE_ERR1(msg, var1) WSF_TRACE1("MMDL", "ERR", msg, var1)
690 /*! \brief 2 argument MMDL error trace. */
691 #define MMDL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MMDL", "ERR", msg, var1, var2)
692 /*! \brief 3 argument MMDL error trace. */
693 #define MMDL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "ERR", msg, var1, var2, var3)
694 
695 /*! \brief Enable LL trace. */
696 #if (WSF_TRACE_ENABLED == TRUE) || (WSF_TOKEN_ENABLED == TRUE)
697 #define LL_TRACE_ENABLE(ena) WsfTraceEnable(ena)
698 #else
699 #define LL_TRACE_ENABLE(ena)
700 #endif
701 
702 /*! \} */ /* WSF_TRACE_API */
703 
704 #ifdef __cplusplus
705 };
706 #endif
707 
708 #endif /* WSF_TRACE_H */
void WsfTraceEnable(bool_t enable)
Enable trace messages.
void(* WsfBt4TraceCback_t)(const char *pStr, va_list args)
BT4 Platform trace callback.
Definition: wsf_trace.h:68
void WsfToken(uint32_t tok, uint32_t var)
Output tokenized message.
bool_t(* WsfTraceHandler_t)(const uint8_t *pBuf, uint32_t len)
Token event handler.
Definition: wsf_trace.h:65
void WsfTraceRegisterHandler(WsfTraceHandler_t traceCback)
Register trace handler.
void WsfTrace(const char *pStr,...)
Output trace message.
bool_t WsfTokenService(void)
Service the trace ring buffer.
void WsfTraceRegister(WsfBt4TraceCback_t cback)
Register BT4 platform trace callback function.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.