-
Notifications
You must be signed in to change notification settings - Fork 561
/
debug.h
2029 lines (1759 loc) · 48.6 KB
/
debug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/****************************************************************************
*
* Copyright 2016 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/
/****************************************************************************
* include/debug.h
*
* Copyright (C) 2007-2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* @defgroup DEBUG_KERNEL DEBUG
* @brief Provides APIs for Debug
* @ingroup KERNEL
*
* @{
*/
/// @file debug.h
/// @brief Debug APIs
#ifndef __INCLUDE_DEBUG_H
#define __INCLUDE_DEBUG_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <tinyara/config.h>
#ifndef NXFUSE_HOST_BUILD
#include <tinyara/compiler.h>
#include <tinyara/logm.h>
#include <tinyara/security_level.h>
#endif
#include <syslog.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifdef NXFUSE_HOST_BUILD
#define FAR
#define DEBUGASSERT(x)
#define ASSERT(x) DEBUGASSERT(x)
#define OK 0
#define ERROR 1
int get_errno(void);
#endif
/* Debug macros to runtime filter the debug messages sent to the console. In
* general, there are four forms of the debug macros:
*
* [a-z]dbg() -- Outputs messages to the console similar to printf() except
* that the output is not buffered. The first character indicates the
* system system (e.g., n=network, f=filesystem, etc.). If the first
* character is missing (i.e., dbg()), then it is common. The common
* dbg() macro is enabled by CONFIG_DEBUG. Subsystem debug requires an
* additional configuration setting to enable it (e.g., CONFIG_DEBUG_NET
* for the network, CONFIG_DEBUG_FS for the file system, etc).
*
* In general, error messages and output of importance use [a-z]dbg().
* [a-z]dbg() is implementation dependent but usually uses file descriptors.
* (that is a problem only because the interrupt task may have re-
* directed stdout). Therefore [a-z]dbg() should not be used in interrupt
* handlers.
*
* [a-z]vdbg() -- Identical to [a-z]dbg() except that it also requires that
* CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug
* output that you would normally want to suppress.
*
* [a-z]lldbg() -- Identical to [a-z]dbg() except this is uses special
* interfaces provided by architecture-specific logic to talk directly
* to the underlying console hardware. If the architecture provides such
* logic, it should define CONFIG_ARCH_LOWPUTC.
*
* [a-z]lldbg() should not be used in normal code because the implementation
* probably disables interrupts and does things that are not consistent with
* good real-time performance. However, [a-z]lldbg() is particularly useful
* in low-level code where it is inappropriate to use file descriptors. For
* example, only [a-z]lldbg() should be used in interrupt handlers.
*
* [a-z]llvdbg() -- Identical to [a-z]lldbg() except that it also requires that
* CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug
* output that you would normally want to suppress.
*/
#ifdef CONFIG_HAVE_FUNCTIONNAME
#define EXTRA_FMT "%s: "
#define EXTRA_ARG , __FUNCTION__
#else
#define EXTRA_FMT
#define EXTRA_ARG
#endif
/* Debug macros will differ depending upon if the toolchain supports
* macros with a variable number of arguments or not.
*/
#ifdef CONFIG_CPP_HAVE_VARARGS
/* C-99 style variadic macros are supported */
#ifdef CONFIG_DEBUG
/* Temporary LOGM macros to route all dbg messages.
* Once LOGM is approved, each module should have its own index
*/
#define LOGM_IDX (0)
#ifdef CONFIG_DEBUG_ERROR
#ifdef CONFIG_LOGM
#define dbg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define dbg_noarg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_ERR, format, ##__VA_ARGS__)
#define lldbg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define lldbg_noarg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_ERR, format, ##__VA_ARGS__)
#else
/**
* @brief Error debug
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define dbg(format, ...) \
syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define dbg_noarg(format, ...) \
syslog(LOG_ERR, format, ##__VA_ARGS__)
#ifdef CONFIG_ARCH_LOWPUTC
/**
* @brief Error debug for low-level
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define lldbg(format, ...) \
lowsyslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define lldbg_noarg(format, ...) \
lowsyslog(LOG_ERR, format, ##__VA_ARGS__)
#else
#define lldbg(...)
#define lldbg_noarg(...)
#endif
#endif
#else
#define dbg(...)
#define dbg_noarg(...)
#define lldbg(...)
#define lldbg_noarg(...)
#endif
#ifdef CONFIG_DEBUG_WARN
#ifdef CONFIG_LOGM
#define wdbg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_WRN, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define wdbg_noarg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_WRN, format, ##__VA_ARGS__)
#define llwdbg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_WRN, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define llwdbg_noarg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_WRN, format, ##__VA_ARGS__)
#else
/**
* @brief Warning debug
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define wdbg(format, ...) \
syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define wdbg_noarg(format, ...) \
syslog(LOG_WARNING, format, ##__VA_ARGS__)
#ifdef CONFIG_ARCH_LOWPUTC
/**
* @brief Warning debug for low-level
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define llwdbg(format, ...) \
lowsyslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define llwdbg_noarg(format, ...) \
lowsyslog(LOG_WARNING, format, ##__VA_ARGS__)
#else
#define llwdbg(...)
#define llwdbg_noarg(...)
#endif
#endif
#else
#define wdbg(...)
#define wdbg_noarg(...)
#define llwdbg(...)
#define llwdbg_noarg(...)
#endif
#ifdef CONFIG_DEBUG_VERBOSE
#ifdef CONFIG_LOGM
#define vdbg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_INF, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define vdbg_noarg(format, ...) \
logm(LOGM_NORMAL, LOGM_IDX, LOGM_INF, format, ##__VA_ARGS__)
#define llvdbg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_INF, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define llvdbg_noarg(format, ...) \
logm(LOGM_LOWPUT, LOGM_IDX, LOGM_INF, format, ##__VA_ARGS__)
#else
/**
* @brief Informational(Verbose) debug
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define vdbg(format, ...) \
syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define vdbg_noarg(format, ...) \
syslog(LOG_INFO, format, ##__VA_ARGS__)
#ifdef CONFIG_ARCH_LOWPUTC
/**
* @brief Informational(Verbose) debug for low-level
* @details @b #include <debug.h>
* @since TizenRT v1.0
*/
#define llvdbg(format, ...) \
lowsyslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#define llvdbg_noarg(format, ...) \
lowsyslog(LOG_INFO, format, ##__VA_ARGS__)
#else
#define llvdbg(...)
#define llvdbg_noarg(...)
#endif
#endif
#else
#define vdbg(...)
#define vdbg_noarg(...)
#define llvdbg(...)
#define llvdbg_noarg(...)
#endif
#else /* CONFIG_DEBUG */
#define dbg(...)
#define dbg_noarg(...)
#define lldbg(...)
#define lldbg_noarg(...)
#define wdbg(...)
#define wdbg_noarg(...)
#define llwdbg(...)
#define llwdbg_noarg(...)
#define vdbg(...)
#define vdbg_noarg(...)
#define llvdbg(...)
#define llvdbg_noarg(...)
#endif /* CONFIG_DEBUG */
/****************************************/
/* Subsystem specific debug */
/****************************************/
#ifdef CONFIG_DEBUG_AUDIO_ERROR
#define auddbg(format, ...) dbg(format, ##__VA_ARGS__)
#define audlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define auddbg(...)
#define audlldbg(...)
#endif
#ifdef CONFIG_DEBUG_AUDIO_WARN
#define audwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define audllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define audwdbg(...)
#define audllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_AUDIO_INFO
#define audvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define audllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define audvdbg(...)
#define audllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_BINFMT_ERROR
# define berr(format, ...) dbg(format, ##__VA_ARGS__)
#else
# define berr(...)
#endif
#ifdef CONFIG_DEBUG_BINFMT_WARN
# define bwarn(format, ...) wdbg(format, ##__VA_ARGS__)
#else
# define bwarn(...)
#endif
#ifdef CONFIG_DEBUG_BINFMT_INFO
# define binfo(format, ...) vdbg(format, ##__VA_ARGS__)
#else
# define binfo(...)
#endif
#ifdef CONFIG_DEBUG_BINARY_COMPRESSION_ERROR
#define bcmpdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define bcmplldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define bcmpdbg(...)
#define bcmplldbg(...)
#endif
#ifdef CONFIG_DEBUG_BINARY_COMPRESSION_INFO
#define bcmpvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define bcmpllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define bcmpvdbg(...)
#define bcmpllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_BINMGR_ERROR
#define bmdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define bmlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define bmdbg(...)
#define bmlldbg(...)
#endif
#ifdef CONFIG_DEBUG_BINMGR_INFO
#define bmvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define bmllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define bmvdbg(...)
#define bmllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_ERR_REPORT_ERROR
#define nwerrdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define nwerrlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define nwerrdbg(...)
#define nwerrlldbg(...)
#endif
#ifdef CONFIG_DEBUG_ERR_REPORT_WARN
#define nwerr_wdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define nwerr_llwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define nwerr_wdbg(...)
#define nwerr_llwdbg(...)
#endif
#ifdef CONFIG_DEBUG_ERR_REPORT_INFO
#define nwerr_vdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define nwerr_llvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define nwerr_vdbg(...)
#define nwerr_llvdbg(...)
#endif
#ifdef CONFIG_DEBUG_FS
#define fsdbg(format, ...) dbg_noarg(format, ##__VA_ARGS__)
#else
#define fsdbg(format, ...)
#endif
#ifdef CONFIG_DEBUG_FS_ERROR
#define fdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define flldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define fdbg(...)
#define flldbg(...)
#endif
#ifdef CONFIG_DEBUG_FS_WARN
#define fwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define fllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define fwdbg(...)
#define fllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_FS_INFO
#define fvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define fllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define fvdbg(...)
#define fllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_LIB_ERROR
#define ldbg(format, ...) dbg(format, ##__VA_ARGS__)
#define llldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define ldbg(...)
#define llldbg(...)
#endif
#ifdef CONFIG_DEBUG_LIB_WARN
#define lwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define lllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define lwdbg(...)
#define lllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_LIB_INFO
#define lvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define lllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define lvdbg(...)
#define lllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_MM_ERROR
#define mdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define mlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define mdbg(...)
#define mlldbg(...)
#endif
#ifdef CONFIG_DEBUG_MM_WARN
#define mwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define mllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define mwdbg(...)
#define mllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_MM_INFO
#define mvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define mllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define mvdbg(...)
#define mllvdbg(...)
#endif
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
#define mfdbg(format, ...) \
do { \
if (!IS_SECURE_STATE()) { \
if (abort_mode || up_interrupt_context()) { \
lldbg(format, ##__VA_ARGS__); \
} else { \
dbg(format, ##__VA_ARGS__); \
} \
} \
} while (0)
#else
#define mfdbg(format, ...) dbg(format, ##__VA_ARGS__)
#endif
#ifdef CONFIG_DEBUG_NET_ERROR
#define ndbg(format, ...) dbg_noarg(format, ##__VA_ARGS__)
#define nlldbg(format, ...) lldbg_noarg(format, ##__VA_ARGS__)
#else
#define ndbg(...)
#define nlldbg(...)
#endif
#ifdef CONFIG_DEBUG_NET_WARN
#define nwdbg(format, ...) wdbg_noarg(format, ##__VA_ARGS__)
#define nllwdbg(format, ...) llwdbg_noarg(format, ##__VA_ARGS__)
#else
#define nwdbg(...)
#define nllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_NET_INFO
#define nvdbg(format, ...) vdbg_noarg(format, ##__VA_ARGS__)
#define nllvdbg(format, ...) llvdbg_noarg(format, ##__VA_ARGS__)
#else
#define nvdbg(...)
#define nllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_BLE_ERROR
#define bledbg(format, ...) dbg(format, ##__VA_ARGS__)
#define blelldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define bledbg(...)
#define blelldbg(...)
#endif
#ifdef CONFIG_DEBUG_BLE_WARN
#define blewdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define blellwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define blewdbg(...)
#define blellwdbg(...)
#endif
#ifdef CONFIG_DEBUG_BLE_INFO
#define blevdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define blellvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define blevdbg(...)
#define blellvdbg(...)
#endif
#ifdef CONFIG_DEBUG_SCHED_ERROR
#define sdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define slldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define sdbg(...)
#define slldbg(...)
#endif
#ifdef CONFIG_DEBUG_SCHED_WARN
#define swdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define sllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define swdbg(...)
#define sllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_SCHED_INFO
#define svdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define sllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define svdbg(...)
#define sllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_PM_ERROR
#define pmdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define pmlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define pmdbg(...)
#define pmlldbg(...)
#endif
#ifdef CONFIG_DEBUG_PM_WARN
#define pmwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define pmllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define pmwdbg(...)
#define pmllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_PM_INFO
#define pmvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define pmllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define pmvdbg(...)
#define pmllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_SECURE_ELEMENT_ERROR
#define sedbg(format, ...) dbg(format, ##__VA_ARGS__)
#define selldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define sedbg(...)
#define selldbg(...)
#endif
#ifdef CONFIG_DEBUG_SECURE_ELEMENT_INFO
#define sevdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define sellvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define sevdbg(...)
#define sellvdbg(...)
#endif
/****************************************/
/* Framework specific debug */
/****************************************/
#ifdef CONFIG_DEBUG_DM_ERROR
#define dmdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define dmlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define dmdbg(...)
#define dmlldbg(...)
#endif
#ifdef CONFIG_DEBUG_DM_WARN
#define dmwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define dmllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define dmwdbg(...)
#define dmllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_DM_INFO
#define dmvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define dmllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define dmvdbg(...)
#define dmllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_EVENTLOOP_ERROR
#define eldbg(format, ...) dbg(format, ##__VA_ARGS__)
#define ellldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define eldbg(...)
#define ellldbg(...)
#endif
#ifdef CONFIG_DEBUG_EVENTLOOP_INFO
#define elvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define elllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define elvdbg(...)
#define elllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_MEDIA_ERROR
#define meddbg(format, ...) dbg(format, ##__VA_ARGS__)
#define medlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define meddbg(...)
#define medlldbg(...)
#endif
#ifdef CONFIG_DEBUG_MEDIA_WARN
#define medwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define medllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define medwdbg(...)
#define medllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_MEDIA_INFO
#define medvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define medllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define medvdbg(...)
#define medllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_MESSAGE_IPC
#define msgdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define msglldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define msgdbg(...)
#define msglldbg(...)
#endif
#ifdef CONFIG_DEBUG_PREFERENCE_ERROR
#define prefdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define preflldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define prefdbg(...)
#define preflldbg(...)
#endif
#ifdef CONFIG_DEBUG_PREFERENCE_INFO
#define prefvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define prefllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define prefvdbg(...)
#define prefllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_SECURITY_FRAMEWORK_ERROR
#define sfdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define sflldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define sfdbg(...)
#define sflldbg(...)
#endif
#ifdef CONFIG_DEBUG_SECURITY_FRAMEWORK_INFO
#define sfvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define sfllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define sfvdbg(...)
#define sfllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_TASK_MANAGER_ERROR
#define tmdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define tmlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define tmdbg(...)
#define tmlldbg(...)
#endif
#ifdef CONFIG_DEBUG_TASK_MANAGER_INFO
#define tmvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define tmllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define tmvdbg(...)
#define tmllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_REBOOT_REASON_ERROR
#define rrdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define rrlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define rrdbg(...)
#define rrlldbg(...)
#endif
#ifdef CONFIG_DEBUG_REBOOT_REASON_INFO
#define rrvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define rrllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define rrvdbg(...)
#define rrllvdbg(...)
#endif
/******************************************/
/* OS Function specific debug */
/******************************************/
#ifdef CONFIG_DEBUG_DMA_ERROR
#define dmadbg(format, ...) dbg(format, ##__VA_ARGS__)
#define dmalldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define dmadbg(...)
#define dmalldbg(...)
#endif
#ifdef CONFIG_DEBUG_DMA_WARN
#define dmawdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define dmallwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define dmawdbg(...)
#define dmallwdbg(...)
#endif
#ifdef CONFIG_DEBUG_DMA_INFO
#define dmavdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define dmallvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define dmavdbg(...)
#define dmallvdbg(...)
#endif
#ifdef CONFIG_DEBUG_PAGING_ERROR
#define pgdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define pglldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define pgdbg(...)
#define pglldbg(...)
#endif
#ifdef CONFIG_DEBUG_PAGING_WARN
#define pgwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define pgllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define pgwdbg(...)
#define pgllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_PAGING_INFO
#define pgvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define pgllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define pgvdbg(...)
#define pgllvdbg(...)
#endif
/*************************************/
/* Driver specific debug */
/*************************************/
#ifdef CONFIG_DEBUG_ANALOG_ERROR
#define adbg(format, ...) dbg(format, ##__VA_ARGS__)
#define alldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define adbg(...)
#define alldbg(...)
#endif
#ifdef CONFIG_DEBUG_ANALOG_WARN
#define awdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define allwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define awdbg(...)
#define allwdbg(...)
#endif
#ifdef CONFIG_DEBUG_ANALOG_INFO
#define avdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define allvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define avdbg(...)
#define allvdbg(...)
#endif
#ifdef CONFIG_DEBUG_GRAPHICS_ERROR
#define gdbg(format, ...) dbg(format, ##__VA_ARGS__)
#define glldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define gdbg(...)
#define glldbg(...)
#endif
#ifdef CONFIG_DEBUG_GRAPHICS_WARN
#define gwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define gllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define gwdbg(...)
#define gllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_GRAPHICS_INFO
#define gvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define gllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define gvdbg(...)
#define gllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_I2C_ERROR
#define i2cerr(format, ...) dbg(format, ##__VA_ARGS__)
#define i2clldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define i2cerr(...)
#define i2clldbg(...)
#endif
#ifdef CONFIG_DEBUG_I2C_WARN
#define i2cwarn(format, ...) wdbg(format, ##__VA_ARGS__)
#define i2cllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define i2cwarn(...)
#define i2cllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_I2C_INFO
#define i2cinfo(format, ...) vdbg(format, ##__VA_ARGS__)
#define i2cllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define i2cinfo(...)
#define i2cllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_I2S_ERROR
#define i2serr(format, ...) dbg(format, ##__VA_ARGS__)
#define i2slldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define i2serr(...)
#define i2slldbg(...)
#endif
#ifdef CONFIG_DEBUG_I2S_WARN
#define i2swarn(format, ...) wdbg(format, ##__VA_ARGS__)
#define i2sllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define i2swarn(...)
#define i2sllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_I2S_INFO
#define i2sinfo(format, ...) vdbg(format, ##__VA_ARGS__)
#define i2sllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define i2sinfo(...)
#define i2sllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_INPUT_ERROR
#define idbg(format, ...) dbg(format, ##__VA_ARGS__)
#define illdbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define idbg(...)
#define illdbg(...)
#endif
#ifdef CONFIG_DEBUG_INPUT_WARN
#define iwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define illwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define iwdbg(...)
#define illwdbg(...)
#endif
#ifdef CONFIG_DEBUG_INPUT_INFO
#define ivdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define illvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define ivdbg(...)
#define illvdbg(...)
#endif
#ifdef CONFIG_DEBUG_LCD_ERROR
#define lcddbg(format, ...) dbg(format, ##__VA_ARGS__)
#define lcdlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define lcddbg(...)
#define lcdlldbg(...)
#endif
#ifdef CONFIG_DEBUG_LCD_WARN
#define lcdwdbg(format, ...) wdbg(format, ##__VA_ARGS__)
#define lcdllwdbg(format, ...) llwdbg(format, ##__VA_ARGS__)
#else
#define lcdwdbg(...)
#define lcdllwdbg(...)
#endif
#ifdef CONFIG_DEBUG_LCD_INFO
#define lcdvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define lcdllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define lcdvdbg(...)
#define lcdllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_LWNL80211_ERROR
#define nldbg(format, ...) dbg(format, ##__VA_ARGS__)
#define nllldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define nldbg(...)
#define nllldbg(...)
#endif
#ifdef CONFIG_DEBUG_LWNL80211_INFO
#define nlvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define nlllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define nlvdbg(...)
#define nlllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_LWNL80211_VENDOR_DRV_ERROR
#define vddbg(format, ...) dbg(format, ##__VA_ARGS__)
#define vdlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
#else
#define vddbg(...)
#define vdlldbg(...)
#endif
#ifdef CONFIG_DEBUG_LWNL80211_VENDOR_DRV_INFO
#define vdvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
#define vdllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
#else
#define vdvdbg(...)
#define vdllvdbg(...)
#endif
#ifdef CONFIG_DEBUG_SENSORS_ERROR
#define sndbg(format, ...) dbg(format, ##__VA_ARGS__)