# DEBUG_NO_POOLS, DEBUG_FAIL_ALLOC, DEBUG_STRICT_ACTION=[0-3], DEBUG_HPACK,
# DEBUG_AUTH, DEBUG_SPOE, DEBUG_UAF, DEBUG_THREAD, DEBUG_STRICT, DEBUG_DEV,
# DEBUG_TASK, DEBUG_MEMORY_POOLS, DEBUG_POOL_TRACING, DEBUG_QPACK, DEBUG_LIST,
-# DEBUG_GLITCHES, DEBUG_STRESS, DEBUG_UNIT.
+# DEBUG_COUNTERS, DEBUG_STRESS, DEBUG_UNIT.
DEBUG =
#### Trace options
debug counters [reset|show|all|bug|chk|cnt|glt|?]*
List internal counters placed in the code, which may vary depending on some
- build options. Some of them depend on DEBUG_STRICT, others on DEBUG_GLITCHES.
+ build options. Some of them depend on DEBUG_STRICT, others on DEBUG_COUNTERS.
The command takes a combination of multiple arguments, some defining actions
and others defining filters:
- bug enables listing the counters for BUG_ON() statements
1; /* let's return the true condition */ \
}) : 0)
-/* DEBUG_GLITCHES enables counting the number of glitches per line of code. The
+/* DEBUG_COUNTERS enables counting the number of glitches per line of code. The
* condition is empty (nothing to write there), except maybe __VA_ARGS at the
* end.
*/
-# if !defined(DEBUG_GLITCHES)
+# if !defined(DEBUG_COUNTERS) || (DEBUG_COUNTERS == 0)
# define _COUNT_GLITCH(file, line, ...) do { } while (0)
# else
# define _COUNT_GLITCH(file, line, ...) do { \
__DBG_COUNT(, file, line, DBG_GLITCH, __VA_ARGS__); \
} while (0)
-# endif
+# endif
#else /* USE_OBSOLETE_LINKER not defined below */
# define __DBG_COUNT(cond, file, line, type, ...) do { } while (0)
# define DEBUG_STRICT 1
#endif
+/* Let's make DEBUG_COUNTERS default to 1 to have glitches counters by default */
+#ifndef DEBUG_COUNTERS
+# define DEBUG_COUNTERS 1
+#endif
+
#if !defined(DEBUG_MEMORY_POOLS)
# define DEBUG_MEMORY_POOLS 1
#endif
return cli_err(appctx, "Expects an optional action ('reset','show'), optional types ('bug','chk','cnt','glt') and optionally 'all' to even dump null counters.\n");
}
-#if DEBUG_STRICT > 0 || defined(DEBUG_GLITCHES)
+#if (DEBUG_STRICT > 0) || (DEBUG_COUNTERS > 0)
ctx->start = &__start_dbg_cnt;
ctx->stop = &__stop_dbg_cnt;
#endif