]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: pools: introduce a new pool_debugging global variable
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Feb 2022 17:35:59 +0000 (18:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
This read-mostly variable will be used at runtime to enable/disable
certain pool-debugging features and will be set by the command-line
parser. A future option -dP will take a number of debugging features
as arguments to configure this variable's contents.

include/haproxy/pool.h
src/pool.c

index 9f8658d54fb4c6315cf850405dc13092365d69cf..2c3c7db55022a88b0220dd3d718cc80a25f3592a 100644 (file)
 /* poison each newly allocated area with this byte if >= 0 */
 extern int mem_poison_byte;
 
+/* set of POOL_DBG_* flags */
+extern uint pool_debugging;
+
 void *pool_get_from_os(struct pool_head *pool);
 void pool_put_to_os(struct pool_head *pool, void *ptr);
 void *pool_alloc_nocache(struct pool_head *pool);
index aca28efdc8cfe40ebaa13eb35c17423d6e5659bb..8462accd03308e29d7a373efd1b4e74b8f470657 100644 (file)
@@ -37,6 +37,7 @@ THREAD_LOCAL size_t pool_cache_count = 0;                /* #cache objects   */
 
 static struct list pools __read_mostly = LIST_HEAD_INIT(pools);
 int mem_poison_byte __read_mostly = -1;
+uint pool_debugging __read_mostly = 0;                   /* set of POOL_DBG_* flags */
 
 #ifdef DEBUG_FAIL_ALLOC
 static int mem_fail_rate __read_mostly = 0;