blob: 4f8f4a3dcaeaeaf03aa76972999d8c16bf3b52a9 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 * This file contains definitions for implementing the
22 * diagnostic trace message service.
23 *
24 ******************************************************************************/
25
26#ifndef BT_TRACE_H
27#define BT_TRACE_H
28
29#ifndef BTTRC_INCLUDED
30#define BTTRC_INCLUDED FALSE
31#endif
32#ifndef BTTRC_PARSER_INCLUDED
33#define BTTRC_PARSER_INCLUDED FALSE
34#endif
35#ifndef MAX_TRACE_RAM_SIZE
36#define MAX_TRACE_RAM_SIZE 10000
37#endif
38
39/* BTE tracing IDs for debug purposes */
40/* LayerIDs for stack */
41#define BTTRC_ID_STK_GKI 1
42#define BTTRC_ID_STK_BTU 2
43#define BTTRC_ID_STK_HCI 3
44#define BTTRC_ID_STK_L2CAP 4
45#define BTTRC_ID_STK_RFCM_MX 5
46#define BTTRC_ID_STK_RFCM_PRT 6
47#define BTTRC_ID_STK_OBEX_C 7
48#define BTTRC_ID_STK_OBEX_S 8
49#define BTTRC_ID_STK_AVCT 9
50#define BTTRC_ID_STK_AVDT 10
51#define BTTRC_ID_STK_AVRC 11
52#define BTTRC_ID_STK_BIC 12
53#define BTTRC_ID_STK_BIS 13
54#define BTTRC_ID_STK_BNEP 14
55#define BTTRC_ID_STK_BPP 15
56#define BTTRC_ID_STK_BTM_ACL 16
57#define BTTRC_ID_STK_BTM_PM 17
58#define BTTRC_ID_STK_BTM_DEV_CTRL 18
59#define BTTRC_ID_STK_BTM_SVC_DSC 19
60#define BTTRC_ID_STK_BTM_INQ 20
61#define BTTRC_ID_STK_BTM_SCO 21
62#define BTTRC_ID_STK_BTM_SEC 22
63#define BTTRC_ID_STK_DUN 23
64#define BTTRC_ID_STK_HID 24
65#define BTTRC_ID_STK_HSP2 25
66#define BTTRC_ID_STK_CTP 26
67#define BTTRC_ID_STK_FTC 27
68#define BTTRC_ID_STK_FTS 28
69#define BTTRC_ID_STK_GAP 29
70#define BTTRC_ID_STK_GOEP 30
71#define BTTRC_ID_STK_HCRP 31
72#define BTTRC_ID_STK_ICP 32
73#define BTTRC_ID_STK_OPC 33
74#define BTTRC_ID_STK_OPS 34
75#define BTTRC_ID_STK_PAN 35
76#define BTTRC_ID_STK_SAP 36
77#define BTTRC_ID_STK_SDP 37
78#define BTTRC_ID_STK_SLIP 38
79#define BTTRC_ID_STK_SPP 39
80#define BTTRC_ID_STK_TCS 40
81#define BTTRC_ID_STK_VDP 41
82#define BTTRC_ID_STK_MCAP 42
83#define BTTRC_ID_STK_GATT 43
84#define BTTRC_ID_STK_SMP 44
85#define BTTRC_ID_STK_NFC 45
86#define BTTRC_ID_STK_NCI 46
87#define BTTRC_ID_STK_IDEP 47
88#define BTTRC_ID_STK_NDEP 48
89#define BTTRC_ID_STK_LLCP 49
90#define BTTRC_ID_STK_RW 50
91#define BTTRC_ID_STK_CE 51
92#define BTTRC_ID_STK_SNEP 52
93#define BTTRC_ID_STK_NDEF 53
94
95
96/* LayerIDs for BTA */
97#define BTTRC_ID_BTA_ACC 55 /* Advanced Camera Client */
98#define BTTRC_ID_BTA_AG 56 /* audio gateway */
99#define BTTRC_ID_BTA_AV 57 /* Advanced audio */
100#define BTTRC_ID_BTA_BIC 58 /* Basic Imaging Client */
101#define BTTRC_ID_BTA_BIS 59 /* Basic Imaging Server */
102#define BTTRC_ID_BTA_BP 60 /* Basic Printing Client */
103#define BTTRC_ID_BTA_CG 61
104#define BTTRC_ID_BTA_CT 62 /* cordless telephony terminal */
105#define BTTRC_ID_BTA_DG 63 /* data gateway */
106#define BTTRC_ID_BTA_DM 64 /* device manager */
107#define BTTRC_ID_BTA_DM_SRCH 65 /* device manager search */
108#define BTTRC_ID_BTA_DM_SEC 66 /* device manager security */
109#define BTTRC_ID_BTA_FM 67
110#define BTTRC_ID_BTA_FTC 68 /* file transfer client */
111#define BTTRC_ID_BTA_FTS 69 /* file transfer server */
112#define BTTRC_ID_BTA_HIDH 70
113#define BTTRC_ID_BTA_HIDD 71
114#define BTTRC_ID_BTA_JV 72
115#define BTTRC_ID_BTA_OPC 73 /* object push client */
116#define BTTRC_ID_BTA_OPS 74 /* object push server */
117#define BTTRC_ID_BTA_PAN 75 /* Personal Area Networking */
118#define BTTRC_ID_BTA_PR 76 /* Printer client */
119#define BTTRC_ID_BTA_SC 77 /* SIM Card Access server */
120#define BTTRC_ID_BTA_SS 78 /* synchronization server */
121#define BTTRC_ID_BTA_SYS 79 /* system manager */
122#define BTTRC_ID_AVDT_SCB 80 /* avdt scb */
123#define BTTRC_ID_AVDT_CCB 81 /* avdt ccb */
124
125// btla-specific ++
126/* LayerIDs added for BTL-A. Probably should modify bte_logmsg.c in future. */
127#define BTTRC_ID_STK_RFCOMM 82
128#define BTTRC_ID_STK_RFCOMM_DATA 83
129#define BTTRC_ID_STK_OBEX 84
130#define BTTRC_ID_STK_A2D 85
131#define BTTRC_ID_STK_BIP 86
132
133/* LayerIDs for BT APP */
134#define BTTRC_ID_BTAPP 87
135#define BTTRC_ID_BT_PROTOCOL 88 /* this is a temporary solution to allow dynamic
136 enable/disable of BT_PROTOCOL_TRACE */
137#define BTTRC_ID_MAX_ID BTTRC_ID_BT_PROTOCOL
138// btla-specific --
139#define BTTRC_ID_ALL_LAYERS 0xFF /* all trace layers */
140typedef UINT8 tBTTRC_LAYER_ID;
141
142/* Trace type definitions. Note that these are mutually exclusive in a trace. This
143means that any trace can be either error,warning,api,event or dbg */
144#define BTTRC_TYPE_ERROR 0x01 /* Traces for error situation */
145#define BTTRC_TYPE_WARNING 0x02 /* Traces for warning situation */
146#define BTTRC_TYPE_API 0x04 /* Traces for API */
147#define BTTRC_TYPE_EVENT 0x08 /* Traces for EVENT */
148#define BTTRC_TYPE_ACTION 0x10 /* Traces for Action functions */
149#define BTTRC_TYPE_DBG 0x20 /* Traces for debugging purpose */
150typedef UINT8 tBTTRC_TYPE;
151
152/* Masks to identify the stack that originated the trace */
153#define BTTRC_TRACE_LITE 0x80 /* MM Lite stack */
154#define BTTRC_TRACE_EMBD 0x40 /* Embedded host stack */
155
156/* Parameter datatypes used in Trace APIs */
157#define BTTRC_PARAM_UINT8 1
158#define BTTRC_PARAM_UINT16 2
159#define BTTRC_PARAM_UINT32 3
160typedef UINT8 tBTTRC_PARAM_TYPE;
161
162/* Special token definitions */
163#define BTTRC_TOKEN_SM_STATE 0xFFFF /* Token indicating the State of a State m/c */
164
165// btla-specific ++
166typedef struct {
167 tBTTRC_LAYER_ID layer_id;
168 tBTTRC_TYPE type; /* TODO: use tBTTRC_TYPE instead of "classical level 0-5" */
169} tBTTRC_LEVEL;
170
171typedef UINT8 (tBTTRC_SET_TRACE_LEVEL)( UINT8 );
172
173typedef struct {
174 const tBTTRC_LAYER_ID layer_id_start;
175 const tBTTRC_LAYER_ID layer_id_end;
176 tBTTRC_SET_TRACE_LEVEL *p_f;
177 const char *trc_name;
178 UINT8 trace_level;
179} tBTTRC_FUNC_MAP;
180
181extern tBTTRC_FUNC_MAP bttrc_set_level_map[];
182extern const UINT16 bttrc_map_size;
183extern BT_API tBTTRC_LEVEL * BTA_SysSetTraceLevel( tBTTRC_LEVEL * p_levels );
184// btla-specific --
185
186
187#ifdef __cplusplus
188extern "C" {
189#endif
190
191/* External declaration for appl_trace_level here to avoid to add the declaration in all the files using APPL_TRACExxx macros */
192extern UINT8 appl_trace_level ;
193
194// btla-specific ++
195EXPORT_API extern void BTE_InitTraceLevels( void );
196// btla-specific --
197
198/* Prototype for message logging function. */
199EXPORT_API extern void LogMsg (UINT32 trace_set_mask, const char *fmt_str, ...);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800200
201/* Prototype for stack tracing function. */
202EXPORT_API extern void BTTRC_StackTrace0(tBTTRC_LAYER_ID layer_id,
203 tBTTRC_TYPE type,
204 UINT16 token);
205EXPORT_API extern void BTTRC_StackTrace1(tBTTRC_LAYER_ID layer_id,
206 tBTTRC_TYPE type,
207 UINT16 token,
208 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val);
209EXPORT_API extern void BTTRC_StackTrace2(tBTTRC_LAYER_ID layer_id,
210 tBTTRC_TYPE type,
211 UINT16 token,
212 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
213 tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val);
214EXPORT_API extern void BTTRC_StackTrace3(tBTTRC_LAYER_ID layer_id,
215 tBTTRC_TYPE type,
216 UINT16 token,
217 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
218 tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
219 tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val);
220EXPORT_API extern void BTTRC_StackTrace4(tBTTRC_LAYER_ID layer_id,
221 tBTTRC_TYPE type,
222 UINT16 token,
223 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
224 tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
225 tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
226 tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val);
227EXPORT_API extern void BTTRC_StackTrace5(tBTTRC_LAYER_ID layer_id,
228 tBTTRC_TYPE type,
229 UINT16 token,
230 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
231 tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
232 tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
233 tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val,
234 tBTTRC_PARAM_TYPE p5_type, UINT32 p5_val);
235EXPORT_API extern void BTTRC_StackTrace6(tBTTRC_LAYER_ID layer_id,
236 tBTTRC_TYPE type,
237 UINT16 token,
238 tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
239 tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
240 tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
241 tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val,
242 tBTTRC_PARAM_TYPE p5_type, UINT32 p5_val,
243 tBTTRC_PARAM_TYPE p6_type, UINT32 p6_val);
244
245// btla-specific ++
246/* p_levels must be a 0 terminated list ! */
247//EXPORT_API extern tBTTRC_LEVEL * BTA_SysSetTraceLevel( tBTTRC_LEVEL * p_levels );
248// btla-specific --
249
250#ifdef __cplusplus
251}
252#endif
253
254/******************************************************************************
255**
256** Trace configurable parameters
257**
258******************************************************************************/
259
260/* Enables or disables verbose trace information. */
261#ifndef BT_TRACE_VERBOSE
262#define BT_TRACE_VERBOSE FALSE
263#endif
264
265/* Enables or disables all trace messages. */
266#ifndef BT_USE_TRACES
267#define BT_USE_TRACES TRUE
268#endif
269
270
271/******************************************************************************
272**
273** Trace Levels
274**
275** The following values may be used for different levels:
276** BT_TRACE_LEVEL_NONE 0 * No trace messages to be generated
277** BT_TRACE_LEVEL_ERROR 1 * Error condition trace messages
278** BT_TRACE_LEVEL_WARNING 2 * Warning condition trace messages
279** BT_TRACE_LEVEL_API 3 * API traces
280** BT_TRACE_LEVEL_EVENT 4 * Debug messages for events
281** BT_TRACE_LEVEL_DEBUG 5 * Debug messages (general)
282******************************************************************************/
283
284// btla-specific ++
285/* Core Stack default trace levels */
286#ifndef HCI_INITIAL_TRACE_LEVEL
287#define HCI_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
288#endif
289
290#ifndef BTM_INITIAL_TRACE_LEVEL
291#define BTM_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
292#endif
293
294#ifndef L2CAP_INITIAL_TRACE_LEVEL
295#define L2CAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
296#endif
297
298#ifndef LLCP_INITIAL_TRACE_LEVEL
299#define LLCP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
300#endif
301
302#ifndef AMP_INITIAL_TRACE_LEVEL
303#define AMP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
304#endif
305
306#ifndef RFCOMM_INITIAL_TRACE_LEVEL
307#define RFCOMM_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
308#endif
309
310#ifndef OBX_INITIAL_TRACE_LEVEL
311#define OBX_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
312#endif
313
314#ifndef SDP_INITIAL_TRACE_LEVEL
315#define SDP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
316#endif
317
318#ifndef TCS_INITIAL_TRACE_LEVEL
319#define TCS_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
320#endif
321
322/* Profile default trace levels */
323#ifndef DUN_INITIAL_TRACE_LEVEL
324#define DUN_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
325#endif
326
327#ifndef GAP_INITIAL_TRACE_LEVEL
328#define GAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
329#endif
330
331#ifndef GOEP_INITIAL_TRACE_LEVEL
332#define GOEP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
333#endif
334
335#ifndef HSP2_INITIAL_TRACE_LEVEL
336#define HSP2_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
337#endif
338
339#ifndef SPP_INITIAL_TRACE_LEVEL
340#define SPP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
341#endif
342
343#ifndef ICP_INITIAL_TRACE_LEVEL
344#define ICP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
345#endif
346
347#ifndef CTP_INITIAL_TRACE_LEVEL
348#define CTP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
349#endif
350
351#ifndef HCRP_INITIAL_TRACE_LEVEL
352#define HCRP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
353#endif
354
355#ifndef HCRPM_INITIAL_TRACE_LEVEL
356#define HCRPM_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
357#endif
358
359#ifndef BPP_INITIAL_TRACE_LEVEL
360#define BPP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
361#endif
362
363#ifndef BIP_INITIAL_TRACE_LEVEL
364#define BIP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
365#endif
366
367#ifndef BNEP_INITIAL_TRACE_LEVEL
368#define BNEP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
369#endif
370
371#ifndef PAN_INITIAL_TRACE_LEVEL
372#define PAN_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
373#endif
374
375#ifndef SAP_INITIAL_TRACE_LEVEL
376#define SAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
377#endif
378
379#ifndef FTP_INITIAL_TRACE_LEVEL
380#define FTP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
381#endif
382
383#ifndef OPP_INITIAL_TRACE_LEVEL
384#define OPP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
385#endif
386
387#ifndef HFP_INITIAL_TRACE_LEVEL
388#define HFP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
389#endif
390
391#ifndef PAP_INITIAL_TRACE_LEVEL
392#define PAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
393#endif
394
395#ifndef A2D_INITIAL_TRACE_LEVEL
396#define A2D_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
397#endif
398
399#ifndef VDP_INITIAL_TRACE_LEVEL
400#define VDP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
401#endif
402
403#ifndef AVDT_INITIAL_TRACE_LEVEL
404#define AVDT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
405#endif
406
407#ifndef AVCT_INITIAL_TRACE_LEVEL
408#define AVCT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
409#endif
410
411#ifndef AVRC_INITIAL_TRACE_LEVEL
412#define AVRC_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
413#endif
414
415#ifndef MCA_INITIAL_TRACE_LEVEL
416#define MCA_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
417#endif
418
419#ifndef HID_INITIAL_TRACE_LEVEL
420#define HID_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
421#endif
422
423/* Application and other default trace levels */
424#ifndef RPC_INITIAL_TRACE_LEVEL
425#define RPC_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
426#endif
427
428#ifndef APPL_INITIAL_TRACE_LEVEL
429#define APPL_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
430#endif
431
432#ifndef BT_TRACE_APPL
433#define BT_TRACE_APPL BT_USE_TRACES
434#endif
435
436#ifndef NFC_INITIAL_TRACE_LEVEL
437#define NFC_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
438#endif
439
440#ifndef GATT_INITIAL_TRACE_LEVEL
441#define GATT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
442#endif
443
444#ifndef SMP_INITIAL_TRACE_LEVEL
445#define SMP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
446#endif
447// btla-specific --
448
449
450#if (BTTRC_INCLUDED == TRUE)
451/***************************************************************************************/
452/* BTTRC MACROS */
453
454#define BTTRC_EVENT(lid, event, state) \
455 {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, event, BTTRC_PARAM_UINT8, state);}
456#define BTTRC_ACTION(lid, action) \
457 {BTTRC_StackTrace0(lid, BTTRC_TYPE_ACTION, action);}
458#define BTTRC_STATE(lid, state) \
459 {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, BTTRC_TOKEN_SM_STATE, BTTRC_PARAM_UINT8, state);}
460
461#define BTTRC_API0(lid, api) \
462 {BTTRC_StackTrace0(lid, BTTRC_TYPE_API, api);}
463#define BTTRC_API1(lid, api, p1_t,p1_v) \
464 {BTTRC_StackTrace1(lid, BTTRC_TYPE_API, api, p1_t,p1_v);}
465#define BTTRC_API2(lid, api, p1_t,p1_v,p2_t,p2_v) \
466 {BTTRC_StackTrace2(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v);}
467#define BTTRC_API3(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v) \
468 {BTTRC_StackTrace3(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
469#define BTTRC_API4(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v) \
470 {BTTRC_StackTrace4(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
471#define BTTRC_API5(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v) \
472 {BTTRC_StackTrace5(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
473#define BTTRC_API6(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v) \
474 {BTTRC_StackTrace6(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
475
476
477#define BTTRC_DBG0(lid, dbg) \
478 {BTTRC_StackTrace0(lid, BTTRC_TYPE_DBG, dbg);}
479#define BTTRC_DBG1(lid, dbg, p1_t,p1_v) \
480 {BTTRC_StackTrace1(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v);}
481#define BTTRC_DBG2(lid, dbg, p1_t,p1_v,p2_t,p2_v) \
482 {BTTRC_StackTrace2(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v);}
483#define BTTRC_DBG3(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v) \
484 {BTTRC_StackTrace3(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
485#define BTTRC_DBG4(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v) \
486 {BTTRC_StackTrace4(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
487#define BTTRC_DBG5(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v) \
488 {BTTRC_StackTrace5(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
489#define BTTRC_DBG6(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v) \
490 {BTTRC_StackTrace6(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
491
492/***************************************************************************************/
493/*AVDT MACROS */
494
495#define BTTRC_AVDT_API0(api) \
496 BTTRC_API0(BTTRC_ID_STK_AVDT, api)
497#define BTTRC_AVDT_API1(api, p1_t, p1_v) \
498 BTTRC_API1(BTTRC_ID_STK_AVDT, api, p1_t, p1_v)
499#define BTTRC_AVDT_API2(api, p1_t, p1_v, p2_t, p2_v) \
500 BTTRC_API2(BTTRC_ID_STK_AVDT, api, p1_t, p1_v, p2_t, p2_v)
501/***************************************************************************************/
502/*AVDT_SCB MACROS */
503
504#define BTTRC_AVDT_SCB_EVENT(event, state) \
505 BTTRC_EVENT(BTTRC_ID_AVDT_SCB, event, state)
506#define BTTRC_AVDT_SCB_ACTION(action) \
507 BTTRC_ACTION(BTTRC_ID_AVDT_SCB, action)
508#define BTTRC_AVDT_SCB_STATE(next_state) \
509 BTTRC_STATE(BTTRC_ID_AVDT_SCB, next_state)
510
511#define BTTRC_AVDT_SCB_DBG0(dbg) \
512 BTTRC_DBG0(BTTRC_ID_AVDT_SCB, dbg)
513#define BTTRC_AVDT_SCB_DBG1(dbg, p1_t,p1_v) \
514 BTTRC_DBG1(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v)
515#define BTTRC_AVDT_SCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v) \
516 BTTRC_DBG2(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v)
517#define BTTRC_AVDT_SCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v) \
518 BTTRC_DBG3(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
519#define BTTRC_AVDT_SCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v) \
520 BTTRC_DBG4(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
521#define BTTRC_AVDT_SCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v) \
522 BTTRC_DBG5(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
523#define BTTRC_AVDT_SCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v) \
524 BTTRC_DBG6(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
525/***************************************************************************************/
526/*AVDT_CCB MACROS */
527
528#define BTTRC_AVDT_CCB_EVENT(event, state) \
529 BTTRC_EVENT(BTTRC_ID_AVDT_CCB, event, state)
530#define BTTRC_AVDT_CCB_ACTION(action) \
531 BTTRC_ACTION(BTTRC_ID_AVDT_CCB, action)
532#define BTTRC_AVDT_CCB_STATE(next_state) \
533 BTTRC_STATE(BTTRC_ID_AVDT_CCB, next_state)
534
535#define BTTRC_AVDT_CCB_DBG0(dbg) \
536 BTTRC_DBG0(BTTRC_ID_AVDT_CCB, dbg)
537#define BTTRC_AVDT_CCB_DBG1(dbg, p1_t,p1_v) \
538 BTTRC_DBG1(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v)
539#define BTTRC_AVDT_CCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v) \
540 BTTRC_DBG2(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v)
541#define BTTRC_AVDT_CCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v) \
542 BTTRC_DBG3(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
543#define BTTRC_AVDT_CCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v) \
544 BTTRC_DBG4(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
545#define BTTRC_AVDT_CCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v) \
546 BTTRC_DBG5(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
547#define BTTRC_AVDT_CCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v) \
548 BTTRC_DBG6(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
549/***************************************************************************************/
550
551#else /*BTTRC_INCLUDED*/
552
553/***************************************************************************************/
554/* BTTRC MACROS */
555
556#define BTTRC_EVENT(lid, event, state)
557#define BTTRC_ACTION(lid, action)
558#define BTTRC_STATE(lid, state)
559
560#define BTTRC_API0(lid, api)
561#define BTTRC_API1(lid, api, p1_t, p1_v)
562#define BTTRC_API2(lid, api, p1_t, p1_v, p2_t, p2_v)
563#define BTTRC_API3(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
564#define BTTRC_API4(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
565#define BTTRC_API5(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
566#define BTTRC_API6(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
567
568
569#define BTTRC_DBG0(lid, dbg)
570#define BTTRC_DBG1(lid, dbg, p1_t,p1_v)
571#define BTTRC_DBG2(lid, dbg, p1_t,p1_v,p2_t,p2_v)
572#define BTTRC_DBG3(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
573#define BTTRC_DBG4(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
574#define BTTRC_DBG5(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
575#define BTTRC_DBG6(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
576
577/***************************************************************************************/
578/*AVDT MACROS */
579#define BTTRC_AVDT_API0(api)
580#define BTTRC_AVDT_API1(api, p1_t,p1_v)
581#define BTTRC_AVDT_API2(api, p1_t,p1_v,p2_t,p2_v)
582/***************************************************************************************/
583/*AVDT_SCB MACROS */
584
585#define BTTRC_AVDT_SCB_EVENT(event, state)
586#define BTTRC_AVDT_SCB_ACTION(action)
587#define BTTRC_AVDT_SCB_STATE(next_state)
588
589#define BTTRC_AVDT_SCB_DBG0(dbg)
590#define BTTRC_AVDT_SCB_DBG1(dbg, p1_t,p1_v)
591#define BTTRC_AVDT_SCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)
592#define BTTRC_AVDT_SCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
593#define BTTRC_AVDT_SCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
594#define BTTRC_AVDT_SCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
595#define BTTRC_AVDT_SCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
596
597/***************************************************************************************/
598/*AVDT_CCB MACROS */
599
600#define BTTRC_AVDT_CCB_EVENT(event, state)
601#define BTTRC_AVDT_CCB_ACTION(action)
602#define BTTRC_AVDT_CCB_STATE(next_state)
603
604#define BTTRC_AVDT_CCB_DBG0(dbg)
605#define BTTRC_AVDT_CCB_DBG1(dbg, p1_t,p1_v)
606#define BTTRC_AVDT_CCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)
607#define BTTRC_AVDT_CCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
608#define BTTRC_AVDT_CCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
609#define BTTRC_AVDT_CCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
610#define BTTRC_AVDT_CCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
611
612/***************************************************************************************/
613
614#endif /*BTTRC_INCLUDED*/
615
616
617#if (BT_USE_TRACES == TRUE)
618
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700619#define BT_TRACE(l,t,...) LogMsg((TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t)), ##__VA_ARGS__)
620#define BT_ERROR_TRACE(l,...) LogMsg(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR, ##__VA_ARGS__)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800621
622/* Define tracing for the HCI unit
623*/
The Android Open Source Project5738f832012-12-12 16:00:35 -0800624
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700625#define HCI_TRACE_ERROR(...) {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
626#define HCI_TRACE_WARNING(...) {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
627#define HCI_TRACE_EVENT(...) {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
628#define HCI_TRACE_DEBUG(...) {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800629
630
631/* Define tracing for BTM
632*/
Sharvil Nanavati83c5256f2014-05-04 00:46:57 -0700633#define BTM_TRACE_ERROR(...) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
634#define BTM_TRACE_WARNING(...) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
635#define BTM_TRACE_API(...) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_API, ##__VA_ARGS__);}
636#define BTM_TRACE_EVENT(...) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
637#define BTM_TRACE_DEBUG(...) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800638
639
640/* Define tracing for the L2CAP unit
641*/
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700642#define L2CAP_TRACE_ERROR(...) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
643#define L2CAP_TRACE_WARNING(...) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
644#define L2CAP_TRACE_API(...) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_L2CAP, TRACE_TYPE_API, ##__VA_ARGS__);}
645#define L2CAP_TRACE_EVENT(...) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
646#define L2CAP_TRACE_DEBUG(...) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800647
648/* Define tracing for the SDP unit
649*/
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700650#define SDP_TRACE_ERROR(...) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
651#define SDP_TRACE_WARNING(...) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
652#define SDP_TRACE_API(...) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SDP, TRACE_TYPE_API, ##__VA_ARGS__);}
653#define SDP_TRACE_EVENT(...) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
654#define SDP_TRACE_DEBUG(...) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800655
656/* Define tracing for the RFCOMM unit
657*/
Sharvil Nanavatid5bba902014-05-04 01:33:15 -0700658#define RFCOMM_TRACE_ERROR(...) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
659#define RFCOMM_TRACE_WARNING(...) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
660#define RFCOMM_TRACE_API(...) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, ##__VA_ARGS__);}
661#define RFCOMM_TRACE_EVENT(...) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
662#define RFCOMM_TRACE_DEBUG(...) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800663
664/* Generic Access Profile traces */
Sharvil Nanavatid5bba902014-05-04 01:33:15 -0700665#define GAP_TRACE_ERROR(...) {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
666#define GAP_TRACE_EVENT(...) {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
667#define GAP_TRACE_API(...) {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_GAP, TRACE_TYPE_API, ##__VA_ARGS__);}
668#define GAP_TRACE_WARNING(...) {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800669
670/* define traces for HID Host */
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700671#define HIDH_TRACE_ERROR(...) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_HID, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
672#define HIDH_TRACE_WARNING(...) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_HID, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
673#define HIDH_TRACE_API(...) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_HID, TRACE_TYPE_API, ##__VA_ARGS__);}
674#define HIDH_TRACE_EVENT(...) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_HID, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
675#define HIDH_TRACE_DEBUG(...) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800676
The Android Open Source Project5738f832012-12-12 16:00:35 -0800677/* define traces for BNEP */
678
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700679#define BNEP_TRACE_ERROR(...) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
680#define BNEP_TRACE_WARNING(...) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
681#define BNEP_TRACE_API(...) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_BNEP, TRACE_TYPE_API, ##__VA_ARGS__);}
682#define BNEP_TRACE_EVENT(...) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
683#define BNEP_TRACE_DEBUG(...) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800684
685/* define traces for PAN */
686
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700687#define PAN_TRACE_ERROR(...) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
688#define PAN_TRACE_WARNING(...) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
689#define PAN_TRACE_API(...) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_PAN, TRACE_TYPE_API, ##__VA_ARGS__);}
690#define PAN_TRACE_EVENT(...) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
691#define PAN_TRACE_DEBUG(...) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800692
The Android Open Source Project5738f832012-12-12 16:00:35 -0800693/* Define tracing for the A2DP profile
694*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700695#define A2D_TRACE_ERROR(...) {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,##__VA_ARGS__);}
696#define A2D_TRACE_WARNING(...) {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,##__VA_ARGS__);}
697#define A2D_TRACE_EVENT(...) {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,##__VA_ARGS__);}
698#define A2D_TRACE_DEBUG(...) {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,##__VA_ARGS__);}
699#define A2D_TRACE_API(...) {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_A2D, TRACE_TYPE_API,##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800700
The Android Open Source Project5738f832012-12-12 16:00:35 -0800701/* AVDTP
702*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700703#define AVDT_TRACE_ERROR(...) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
704#define AVDT_TRACE_WARNING(...) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
705#define AVDT_TRACE_EVENT(...) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
706#define AVDT_TRACE_DEBUG(...) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
707#define AVDT_TRACE_API(...) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800708
709/* Define tracing for the AVCTP protocol
710*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700711#define AVCT_TRACE_ERROR(...) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
712#define AVCT_TRACE_WARNING(...) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
713#define AVCT_TRACE_EVENT(...) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
714#define AVCT_TRACE_DEBUG(...) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
715#define AVCT_TRACE_API(...) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800716
717/* Define tracing for the AVRCP profile
718*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700719#define AVRC_TRACE_ERROR(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
720#define AVRC_TRACE_WARNING(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
721#define AVRC_TRACE_EVENT(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
722#define AVRC_TRACE_DEBUG(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
723#define AVRC_TRACE_API(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800724
725/* MCAP
726*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700727#define MCA_TRACE_ERROR(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
728#define MCA_TRACE_WARNING(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
729#define MCA_TRACE_EVENT(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
730#define MCA_TRACE_DEBUG(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
731#define MCA_TRACE_API(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800732
The Android Open Source Project5738f832012-12-12 16:00:35 -0800733/* Define tracing for the ATT/GATT unit
734*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700735#define GATT_TRACE_ERROR(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
736#define GATT_TRACE_WARNING(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
737#define GATT_TRACE_API(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, ##__VA_ARGS__);}
738#define GATT_TRACE_EVENT(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
739#define GATT_TRACE_DEBUG(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800740
741/* Define tracing for the SMP unit
742*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700743#define SMP_TRACE_ERROR(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, ##__VA_ARGS__);}
744#define SMP_TRACE_WARNING(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, ##__VA_ARGS__);}
745#define SMP_TRACE_API(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, ##__VA_ARGS__);}
746#define SMP_TRACE_EVENT(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, ##__VA_ARGS__);}
747#define SMP_TRACE_DEBUG(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);}
The Android Open Source Project5738f832012-12-12 16:00:35 -0800748
749/* END OF USE TRACES */
750#else
751
Sharvil Nanavati02124872014-05-03 23:06:49 -0700752#define BT_TRACE(l,t,...)
753#define BT_BT_ERROR_TRACE(l,...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800754
755/* Define tracing for the HCI unit
756*/
Sharvil Nanavati83c5256f2014-05-04 00:46:57 -0700757#define HCI_TRACE_ERROR(...)
758#define HCI_TRACE_WARNING(...)
759#define HCI_TRACE_EVENT(...)
760#define HCI_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800761
762
763/* Define tracing for BTM
764*/
Sharvil Nanavati83c5256f2014-05-04 00:46:57 -0700765#define BTM_TRACE_ERROR(...)
766#define BTM_TRACE_WARNING(...)
767#define BTM_TRACE_API(...)
768#define BTM_TRACE_EVENT(...)
769#define BTM_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800770
771
772/* Define tracing for the L2CAP unit
773*/
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700774#define L2CAP_TRACE_ERROR(...)
775#define L2CAP_TRACE_WARNING(...)
776#define L2CAP_TRACE_API(...)
777#define L2CAP_TRACE_EVENT(...)
778#define L2CAP_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800779
780/* Define tracing for the SDP unit
781*/
Sharvil Nanavatia51c9d92014-05-04 01:08:21 -0700782#define SDP_TRACE_ERROR(...)
783#define SDP_TRACE_WARNING(...)
784#define SDP_TRACE_API(...)
785#define SDP_TRACE_EVENT(...)
786#define SDP_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800787
788/* Define tracing for the RFCOMM unit
789*/
Sharvil Nanavatid5bba902014-05-04 01:33:15 -0700790#define RFCOMM_TRACE_ERROR(...)
791#define RFCOMM_TRACE_WARNING(...)
792#define RFCOMM_TRACE_API(...)
793#define RFCOMM_TRACE_EVENT(...)
794#define RFCOMM_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800795
796/* Generic Access Profile traces */
Sharvil Nanavatid5bba902014-05-04 01:33:15 -0700797#define GAP_TRACE_ERROR(...)
798#define GAP_TRACE_EVENT(...)
799#define GAP_TRACE_API(...)
800#define GAP_TRACE_WARNING(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800801
802/* define traces for HID Host */
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700803#define HIDH_TRACE_ERROR(...)
804#define HIDH_TRACE_WARNING(...)
805#define HIDH_TRACE_API(...)
806#define HIDH_TRACE_EVENT(...)
807#define HIDH_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800808
The Android Open Source Project5738f832012-12-12 16:00:35 -0800809/* define traces for BNEP */
810
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700811#define BNEP_TRACE_ERROR(...)
812#define BNEP_TRACE_WARNING(...)
813#define BNEP_TRACE_API(...)
814#define BNEP_TRACE_EVENT(...)
815#define BNEP_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800816
The Android Open Source Project5738f832012-12-12 16:00:35 -0800817/* define traces for PAN */
818
Sharvil Nanavatid6e1b1e2014-05-04 09:41:24 -0700819#define PAN_TRACE_ERROR(...)
820#define PAN_TRACE_WARNING(...)
821#define PAN_TRACE_API(...)
822#define PAN_TRACE_EVENT(...)
823#define PAN_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800824
The Android Open Source Project5738f832012-12-12 16:00:35 -0800825/* Define tracing for the A2DP profile
826*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700827#define A2D_TRACE_ERROR(...)
828#define A2D_TRACE_WARNING(...)
829#define A2D_TRACE_EVENT(...)
830#define A2D_TRACE_DEBUG(...)
831#define A2D_TRACE_API(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800832
The Android Open Source Project5738f832012-12-12 16:00:35 -0800833/* AVDTP
834*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700835#define AVDT_TRACE_ERROR(...)
836#define AVDT_TRACE_WARNING(...)
837#define AVDT_TRACE_EVENT(...)
838#define AVDT_TRACE_DEBUG(...)
839#define AVDT_TRACE_API(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800840
841/* Define tracing for the AVCTP protocol
842*/
Sharvil Nanavati158084e2014-05-04 09:53:44 -0700843#define AVCT_TRACE_ERROR(...)
844#define AVCT_TRACE_WARNING(...)
845#define AVCT_TRACE_EVENT(...)
846#define AVCT_TRACE_DEBUG(...)
847#define AVCT_TRACE_API(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800848
849/* Define tracing for the AVRCP profile
850*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700851#define AVRC_TRACE_ERROR(...)
852#define AVRC_TRACE_WARNING(...)
853#define AVRC_TRACE_EVENT(...)
854#define AVRC_TRACE_DEBUG(...)
855#define AVRC_TRACE_API(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800856
857/* MCAP
858*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700859#define MCA_TRACE_ERROR(...)
860#define MCA_TRACE_WARNING(...)
861#define MCA_TRACE_EVENT(...)
862#define MCA_TRACE_DEBUG(...)
863#define MCA_TRACE_API(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800864
The Android Open Source Project5738f832012-12-12 16:00:35 -0800865/* Define tracing for the GATT
866*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700867#define GATT_TRACE_ERROR(...)
868#define GATT_TRACE_WARNING(...)
869#define GATT_TRACE_API(...)
870#define GATT_TRACE_EVENT(...)
871#define GATT_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800872
873/* Define tracing for the SMP unit
874*/
Sharvil Nanavatib44cc592014-05-04 10:03:35 -0700875#define SMP_TRACE_ERROR(...)
876#define SMP_TRACE_WARNING(...)
877#define SMP_TRACE_API(...)
878#define SMP_TRACE_EVENT(...)
879#define SMP_TRACE_DEBUG(...)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800880
881#endif
882
883#if (BT_TRACE_BTIF == TRUE)
884
885extern UINT8 btif_trace_level;
886
887/* define traces for application */
Sharvil Nanavati02124872014-05-03 23:06:49 -0700888#define BTIF_TRACE_ERROR0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, (m));}
889#define BTIF_TRACE_ERROR1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800890 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700891#define BTIF_TRACE_ERROR2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800892 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700893#define BTIF_TRACE_ERROR3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800894 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700895#define BTIF_TRACE_ERROR4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800896 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700897#define BTIF_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800898 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700899#define BTIF_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800900 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
901
Sharvil Nanavati02124872014-05-03 23:06:49 -0700902#define BTIF_TRACE_WARNING0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, (m));}
903#define BTIF_TRACE_WARNING1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800904 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700905#define BTIF_TRACE_WARNING2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800906 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700907#define BTIF_TRACE_WARNING3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800908 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700909#define BTIF_TRACE_WARNING4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800910 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700911#define BTIF_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800912 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700913#define BTIF_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800914 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
915
Sharvil Nanavati02124872014-05-03 23:06:49 -0700916#define BTIF_TRACE_API0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, (m));}
917#define BTIF_TRACE_API1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800918 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700919#define BTIF_TRACE_API2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800920 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700921#define BTIF_TRACE_API3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800922 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700923#define BTIF_TRACE_API4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800924 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700925#define BTIF_TRACE_API5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800926 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700927#define BTIF_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800928 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
929
Sharvil Nanavati02124872014-05-03 23:06:49 -0700930#define BTIF_TRACE_EVENT0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, (m));}
931#define BTIF_TRACE_EVENT1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800932 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700933#define BTIF_TRACE_EVENT2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800934 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700935#define BTIF_TRACE_EVENT3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800936 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700937#define BTIF_TRACE_EVENT4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800938 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700939#define BTIF_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800940 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700941#define BTIF_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800942 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
943
Sharvil Nanavati02124872014-05-03 23:06:49 -0700944#define BTIF_TRACE_DEBUG0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m));}
945#define BTIF_TRACE_DEBUG1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800946 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700947#define BTIF_TRACE_DEBUG2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800948 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700949#define BTIF_TRACE_DEBUG3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800950 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700951#define BTIF_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800952 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700953#define BTIF_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800954 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700955#define BTIF_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800956 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
957
Sharvil Nanavati02124872014-05-03 23:06:49 -0700958#define BTIF_TRACE_VERBOSE0(m) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m));}
959#define BTIF_TRACE_VERBOSE1(m,p1) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800960 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700961#define BTIF_TRACE_VERBOSE2(m,p1,p2) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800962 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700963#define BTIF_TRACE_VERBOSE3(m,p1,p2,p3) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800964 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700965#define BTIF_TRACE_VERBOSE4(m,p1,p2,p3,p4) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800966 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700967#define BTIF_TRACE_VERBOSE5(m,p1,p2,p3,p4,p5) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800968 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -0700969#define BTIF_TRACE_VERBOSE6(m,p1,p2,p3,p4,p5,p6) {if (btif_trace_level >= BT_TRACE_LEVEL_VERBOSE) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -0800970 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
971
972#else
973/* define traces for Application */
974
975#define BTIF_TRACE_ERROR0(m)
976#define BTIF_TRACE_ERROR1(m,p1)
977#define BTIF_TRACE_ERROR2(m,p1,p2)
978#define BTIF_TRACE_ERROR3(m,p1,p2,p3)
979#define BTIF_TRACE_ERROR4(m,p1,p2,p3,p4)
980#define BTIF_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
981#define BTIF_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
982#define BTIF_TRACE_ERROR7(m,p1,p2,p3,p4,p5,p6,p7)
983
984
985#define BTIF_TRACE_WARNING0(m)
986#define BTIF_TRACE_WARNING1(m,p1)
987#define BTIF_TRACE_WARNING2(m,p1,p2)
988#define BTIF_TRACE_WARNING3(m,p1,p2,p3)
989#define BTIF_TRACE_WARNING4(m,p1,p2,p3,p4)
990#define BTIF_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
991#define BTIF_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
992#define BTIF_TRACE_WARNING7(m,p1,p2,p3,p4,p5,p6,p7)
993
994
995#define BTIF_TRACE_API0(m)
996#define BTIF_TRACE_API1(m,p1)
997#define BTIF_TRACE_API2(m,p1,p2)
998#define BTIF_TRACE_API3(m,p1,p2,p3)
999#define BTIF_TRACE_API4(m,p1,p2,p3,p4)
1000#define BTIF_TRACE_API5(m,p1,p2,p3,p4,p5)
1001#define BTIF_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
1002
1003#define BTIF_TRACE_EVENT0(m)
1004#define BTIF_TRACE_EVENT1(m,p1)
1005#define BTIF_TRACE_EVENT2(m,p1,p2)
1006#define BTIF_TRACE_EVENT3(m,p1,p2,p3)
1007#define BTIF_TRACE_EVENT4(m,p1,p2,p3,p4)
1008#define BTIF_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
1009#define BTIF_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
1010
1011#define BTIF_TRACE_DEBUG0(m)
1012#define BTIF_TRACE_DEBUG1(m,p1)
1013#define BTIF_TRACE_DEBUG2(m,p1,p2)
1014#define BTIF_TRACE_DEBUG3(m,p1,p2,p3)
1015#define BTIF_TRACE_DEBUG4(m,p1,p2,p3,p4)
1016#define BTIF_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
1017#define BTIF_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
1018#define BTIF_TRACE_DEBUG7(m,p1,p2,p3,p4,p5,p6,p7)
1019#define BTIF_TRACE_DEBUG8(m,p1,p2,p3,p4,p5,p6,p7,p8)
1020
1021
1022
1023
1024#define BTIF_TRACE_VERBOSE0(m)
1025#define BTIF_TRACE_VERBOSE1(m,p1)
1026#define BTIF_TRACE_VERBOSE2(m,p1,p2)
1027#define BTIF_TRACE_VERBOSE3(m,p1,p2,p3)
1028#define BTIF_TRACE_VERBOSE4(m,p1,p2,p3,p4)
1029#define BTIF_TRACE_VERBOSE5(m,p1,p2,p3,p4,p5)
1030#define BTIF_TRACE_VERBOSE6(m,p1,p2,p3,p4,p5,p6)
1031
1032#endif
1033
1034
1035#if (BT_USE_TRACES == TRUE || BT_TRACE_APPL == TRUE)
1036
1037/* define traces for application */
Sharvil Nanavati02124872014-05-03 23:06:49 -07001038#define APPL_TRACE_ERROR0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, (m));}
1039#define APPL_TRACE_ERROR1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001040 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001041#define APPL_TRACE_ERROR2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001042 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001043#define APPL_TRACE_ERROR3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001044 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001045#define APPL_TRACE_ERROR4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001046 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001047#define APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001048 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001049#define APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001050 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
1051
Sharvil Nanavati02124872014-05-03 23:06:49 -07001052#define APPL_TRACE_WARNING0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, (m));}
1053#define APPL_TRACE_WARNING1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001054 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001055#define APPL_TRACE_WARNING2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001056 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001057#define APPL_TRACE_WARNING3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001058 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001059#define APPL_TRACE_WARNING4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001060 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001061#define APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001062 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001063#define APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001064 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
1065
Sharvil Nanavati02124872014-05-03 23:06:49 -07001066#define APPL_TRACE_API0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, (m));}
1067#define APPL_TRACE_API1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001068 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001069#define APPL_TRACE_API2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001070 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001071#define APPL_TRACE_API3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001072 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001073#define APPL_TRACE_API4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001074 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001075#define APPL_TRACE_API5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001076 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001077#define APPL_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001078 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
1079
Sharvil Nanavati02124872014-05-03 23:06:49 -07001080#define APPL_TRACE_EVENT0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, (m));}
1081#define APPL_TRACE_EVENT1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001082 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001083#define APPL_TRACE_EVENT2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001084 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001085#define APPL_TRACE_EVENT3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001086 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001087#define APPL_TRACE_EVENT4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001088 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001089#define APPL_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001090 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001091#define APPL_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001092 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
1093
Sharvil Nanavati02124872014-05-03 23:06:49 -07001094#define APPL_TRACE_DEBUG0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m));}
1095#define APPL_TRACE_DEBUG1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001096 (m), (UINT32)(p1));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001097#define APPL_TRACE_DEBUG2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001098 (m), (UINT32)(p1), (UINT32)(p2));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001099#define APPL_TRACE_DEBUG3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001100 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001101#define APPL_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001102 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001103#define APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001104 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
Sharvil Nanavati02124872014-05-03 23:06:49 -07001105#define APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
The Android Open Source Project5738f832012-12-12 16:00:35 -08001106 (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001107
1108#define APPL_TRACE_VERBOSE0(m) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001109 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m));}
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001110#define APPL_TRACE_VERBOSE1(m,p1) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001111 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001112 (UINT32)(p1));}
1113#define APPL_TRACE_VERBOSE2(m,p1,p2) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001114 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001115 (UINT32)(p1), (UINT32)(p2));}
1116#define APPL_TRACE_VERBOSE3(m,p1,p2,p3) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001117 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001118 (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
1119#define APPL_TRACE_VERBOSE4(m,p1,p2,p3,p4) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001120 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001121 (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
1122#define APPL_TRACE_VERBOSE5(m,p1,p2,p3,p4,p5) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001123 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001124 (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
1125#define APPL_TRACE_VERBOSE6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_VERBOSE)\
Sharvil Nanavati02124872014-05-03 23:06:49 -07001126 LogMsg(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m), \
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001127 (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
1128
The Android Open Source Project5738f832012-12-12 16:00:35 -08001129#else
1130/* define traces for Application */
1131
1132#define APPL_TRACE_ERROR0(m)
1133#define APPL_TRACE_ERROR1(m,p1)
1134#define APPL_TRACE_ERROR2(m,p1,p2)
1135#define APPL_TRACE_ERROR3(m,p1,p2,p3)
1136#define APPL_TRACE_ERROR4(m,p1,p2,p3,p4)
1137#define APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
1138#define APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
1139
1140#define APPL_TRACE_WARNING0(m)
1141#define APPL_TRACE_WARNING1(m,p1)
1142#define APPL_TRACE_WARNING2(m,p1,p2)
1143#define APPL_TRACE_WARNING3(m,p1,p2,p3)
1144#define APPL_TRACE_WARNING4(m,p1,p2,p3,p4)
1145#define APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
1146#define APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
1147
1148#define APPL_TRACE_API0(m)
1149#define APPL_TRACE_API1(m,p1)
1150#define APPL_TRACE_API2(m,p1,p2)
1151#define APPL_TRACE_API3(m,p1,p2,p3)
1152#define APPL_TRACE_API4(m,p1,p2,p3,p4)
1153#define APPL_TRACE_API5(m,p1,p2,p3,p4,p5)
1154#define APPL_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
1155
1156#define APPL_TRACE_EVENT0(m)
1157#define APPL_TRACE_EVENT1(m,p1)
1158#define APPL_TRACE_EVENT2(m,p1,p2)
1159#define APPL_TRACE_EVENT3(m,p1,p2,p3)
1160#define APPL_TRACE_EVENT4(m,p1,p2,p3,p4)
1161#define APPL_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
1162#define APPL_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
1163
1164#define APPL_TRACE_DEBUG0(m)
1165#define APPL_TRACE_DEBUG1(m,p1)
1166#define APPL_TRACE_DEBUG2(m,p1,p2)
1167#define APPL_TRACE_DEBUG3(m,p1,p2,p3)
1168#define APPL_TRACE_DEBUG4(m,p1,p2,p3,p4)
1169#define APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
1170#define APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
1171
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001172#define APPL_TRACE_VERBOSE0(m)
1173#define APPL_TRACE_VERBOSE1(m,p1)
1174#define APPL_TRACE_VERBOSE2(m,p1,p2)
1175#define APPL_TRACE_VERBOSE3(m,p1,p2,p3)
1176#define APPL_TRACE_VERBOSE4(m,p1,p2,p3,p4)
1177#define APPL_TRACE_VERBOSE5(m,p1,p2,p3,p4,p5)
1178#define APPL_TRACE_VERBOSE6(m,p1,p2,p3,p4,p5,p6)
1179
The Android Open Source Project5738f832012-12-12 16:00:35 -08001180#endif
1181
The Android Open Source Project5738f832012-12-12 16:00:35 -08001182#if defined(DRV_DEBUG_MSG) && (DRV_DEBUG_MSG == TRUE)
1183/* Driver Trace macros
1184*/
1185#define DRV_TRACE_WARNING0(m) APPL_TRACE_WARNING0(m)
1186#define DRV_TRACE_WARNING1(m,p1) APPL_TRACE_WARNING1(m,p1)
1187#define DRV_TRACE_WARNING2(m,p1,p2) APPL_TRACE_WARNING2(m,p1,p2)
1188#define DRV_TRACE_WARNING3(m,p1,p2,p3) APPL_TRACE_WARNING3(m,p1,p2,p3)
1189#define DRV_TRACE_WARNING4(m,p1,p2,p3,p4) APPL_TRACE_WARNING4(m,p1,p2,p3,p4)
1190#define DRV_TRACE_WARNING5(m,p1,p2,p3,p4,p5) APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
1191#define DRV_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
1192#else
1193/* Driver Trace macros
1194*/
1195#define DRV_TRACE_WARNING0(m)
1196#define DRV_TRACE_WARNING1(m,p1)
1197#define DRV_TRACE_WARNING2(m,p1,p2)
1198#define DRV_TRACE_WARNING3(m,p1,p2,p3)
1199#define DRV_TRACE_WARNING4(m,p1,p2,p3,p4)
1200#define DRV_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
1201#define DRV_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
1202#endif
1203
1204#define DRV_TRACE_ERROR0(m) APPL_TRACE_ERROR0(m)
1205#define DRV_TRACE_ERROR1(m,p1) APPL_TRACE_ERROR1(m,p1)
1206#define DRV_TRACE_ERROR2(m,p1,p2) APPL_TRACE_ERROR2(m,p1,p2)
1207#define DRV_TRACE_ERROR3(m,p1,p2,p3) APPL_TRACE_ERROR3(m,p1,p2,p3)
1208#define DRV_TRACE_ERROR4(m,p1,p2,p3,p4) APPL_TRACE_ERROR4(m,p1,p2,p3,p4)
1209#define DRV_TRACE_ERROR5(m,p1,p2,p3,p4,p5) APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
1210#define DRV_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
1211
1212/* Driver Trace macros
1213*/
1214#define DRV_TRACE_DEBUG0(m) APPL_TRACE_DEBUG0(m)
1215#define DRV_TRACE_DEBUG1(m,p1) APPL_TRACE_DEBUG1(m,p1)
1216#define DRV_TRACE_DEBUG2(m,p1,p2) APPL_TRACE_DEBUG2(m,p1,p2)
1217#define DRV_TRACE_DEBUG3(m,p1,p2,p3) APPL_TRACE_DEBUG3(m,p1,p2,p3)
1218#define DRV_TRACE_DEBUG4(m,p1,p2,p3,p4) APPL_TRACE_DEBUG4(m,p1,p2,p3,p4)
1219#define DRV_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
1220#define DRV_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
1221
zzy7939ed02013-09-27 17:05:37 -07001222/* Simplified Trace Helper Macro
1223*/
1224#if (BT_USE_TRACES == TRUE)
1225#define bdld(fmt, ...) \
1226 do{\
1227 if((MY_LOG_LEVEL) >= BT_TRACE_LEVEL_DEBUG) \
1228 LogMsg((MY_LOG_LAYER) | TRACE_TYPE_DEBUG, "%s(L%d): " fmt, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
1229 }while(0)
The Android Open Source Project5738f832012-12-12 16:00:35 -08001230
zzy7939ed02013-09-27 17:05:37 -07001231#define bdlw(fmt, ...) \
1232 do{\
1233 if((MY_LOG_LEVEL) >= BT_TRACE_LEVEL_DEBUG) \
1234 LogMsg((MY_LOG_LAYER) | TRACE_TYPE_WARNING, "%s(L%d): " fmt, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
1235 }while(0)
1236
1237#define bdle(fmt, ...) \
1238 do{\
1239 if((MY_LOG_LEVEL) >= BT_TRACE_LEVEL_DEBUG) \
1240 LogMsg((MY_LOG_LAYER) | TRACE_TYPE_ERROR, "%s(L%d): " fmt, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
1241 }while(0)
1242
1243#define bdla(assert_if) \
1244 do{\
1245 if(((MY_LOG_LEVEL) >= BT_TRACE_LEVEL_ERROR) && !(assert_if)) \
1246 LogMsg((MY_LOG_LAYER) | TRACE_TYPE_ERROR, "%s(L%d): assert failed: " #assert_if, __FUNCTION__, __LINE__); \
1247 }while(0)
1248#else
1249#define bdld(fmt, ...) ((void)0) /*Empty statement as placeholder*/
1250#define bdlw(fmt, ...) ((void)0)
1251#define bdle(fmt, ...) ((void)0)
1252#define bdla(assert_if) ((void)0)
1253#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08001254#endif /* BT_TRACE_H */