Browse Source

Add DBGLVL_PROFILE

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
f781a98ac4
1 changed files with 28 additions and 14 deletions
  1. 28
    14
      src/include/compiler.h

+ 28
- 14
src/include/compiler.h View File

133
 			      const void *data, unsigned long len );
133
 			      const void *data, unsigned long len );
134
 
134
 
135
 /* Compatibility with existing Makefile */
135
 /* Compatibility with existing Makefile */
136
-#if DEBUG_SYMBOL >= 1
137
-#if DEBUG_SYMBOL >= 2
138
-#define DBGLVL 3
139
-#else
140
-#define DBGLVL 1
141
-#endif
136
+#if DEBUG_SYMBOL
137
+#define DBGLVL DEBUG_SYMBOL
142
 #else
138
 #else
143
 #define DBGLVL 0
139
 #define DBGLVL 0
144
 #endif
140
 #endif
147
 #define DBG_LOG		( DBGLVL & DBGLVL_LOG )
143
 #define DBG_LOG		( DBGLVL & DBGLVL_LOG )
148
 #define DBGLVL_EXTRA	2
144
 #define DBGLVL_EXTRA	2
149
 #define DBG_EXTRA	( DBGLVL & DBGLVL_EXTRA )
145
 #define DBG_EXTRA	( DBGLVL & DBGLVL_EXTRA )
146
+#define DBGLVL_PROFILE	4
147
+#define DBG_PROFILE	( DBGLVL & DBGLVL_PROFILE )
150
 
148
 
151
 /**
149
 /**
152
  * Print debugging message if we are at a certain debug level
150
  * Print debugging message if we are at a certain debug level
240
 
238
 
241
 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( LOG, ... )*/
239
 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( LOG, ... )*/
242
 
240
 
243
-#define DBG( ... )	DBG_IF ( LOG, __VA_ARGS__ )
244
-#define DBG_HDA( ... )	DBG_HDA_IF ( LOG, __VA_ARGS__ )
245
-#define DBG_HD( ... )	DBG_HD_IF ( LOG, __VA_ARGS__ )
246
-#define DBGC( ... )	DBGC_IF ( LOG, __VA_ARGS__ )
247
-#define DBGC_HDA( ... )	DBGC_HDA_IF ( LOG, __VA_ARGS__ )
248
-#define DBGC_HD( ... )	DBGC_HD_IF ( LOG, __VA_ARGS__ )
241
+#define DBG( ... )		DBG_IF		( LOG, __VA_ARGS__ )
242
+#define DBG_HDA( ... )		DBG_HDA_IF	( LOG, __VA_ARGS__ )
243
+#define DBG_HD( ... )		DBG_HD_IF	( LOG, __VA_ARGS__ )
244
+#define DBGC( ... )		DBGC_IF		( LOG, __VA_ARGS__ )
245
+#define DBGC_HDA( ... )		DBGC_HDA_IF	( LOG, __VA_ARGS__ )
246
+#define DBGC_HD( ... )		DBGC_HD_IF	( LOG, __VA_ARGS__ )
247
+
248
+/* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( EXTRA, ... )*/
249
+
250
+#define DBG2( ... )		DBG_IF		( EXTRA, __VA_ARGS__ )
251
+#define DBG2_HDA( ... )		DBG_HDA_IF	( EXTRA, __VA_ARGS__ )
252
+#define DBG2_HD( ... )		DBG_HD_IF	( EXTRA, __VA_ARGS__ )
253
+#define DBGC2( ... )		DBGC_IF		( EXTRA, __VA_ARGS__ )
254
+#define DBGC2_HDA( ... )	DBGC_HDA_IF	( EXTRA, __VA_ARGS__ )
255
+#define DBGC2_HD( ... )		DBGC_HD_IF	( EXTRA, __VA_ARGS__ )
256
+
257
+/* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( PROFILE, ... )*/
258
+
259
+#define DBGP( ... )		DBG_IF		( PROFILE, __VA_ARGS__ )
260
+#define DBGP_HDA( ... )		DBG_HDA_IF	( PROFILE, __VA_ARGS__ )
261
+#define DBGP_HD( ... )		DBG_HD_IF	( PROFILE, __VA_ARGS__ )
262
+#define DBGCP( ... )		DBGC_IF		( PROFILE, __VA_ARGS__ )
263
+#define DBGCP_HDA( ... )	DBGC_HDA_IF	( PROFILE, __VA_ARGS__ )
264
+#define DBGCP_HD( ... )		DBGC_HD_IF	( PROFILE, __VA_ARGS__ )
249
 
265
 
250
-/* Backwards compatibility */
251
-#define DBG2( ... )	DBG_IF ( EXTRA, __VA_ARGS__ )
252
 
266
 
253
 #if DEBUG_SYMBOL == 0
267
 #if DEBUG_SYMBOL == 0
254
 #define NDEBUG
268
 #define NDEBUG

Loading…
Cancel
Save