]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: debug/trace: remote "debug dev trace" when USE_TRACE is not set
authorWilly Tarreau <w@1wt.eu>
Wed, 1 Jul 2026 09:26:17 +0000 (11:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Jul 2026 14:32:28 +0000 (16:32 +0200)
The functions associated with this command were already subject to
DEBUG_DEV, let's also add USE_TRACE for them to be defined. This saves
8kB.

src/debug.c

index ebc251a7f4e0459f2d350b61d7da2d6a826fccfe..e5c90580a8823d9f74755daa506cde99a2809fdc 100644 (file)
@@ -1861,7 +1861,7 @@ static int debug_parse_cli_sched(char **args, char *payload, struct appctx *appc
        return cli_err(appctx, "Not enough memory");
 }
 
-#if defined(DEBUG_DEV)
+#if defined(DEBUG_DEV) && defined(USE_TRACE)
 /* All of this is for "trace dbg" */
 
 static struct trace_source trace_dbg __read_mostly = {
@@ -3090,7 +3090,7 @@ static struct cli_kw_list cli_kws = {{ },{
        {{ "debug", "dev", "sym",   NULL },    "debug dev sym    <addr>                 : resolve symbol address",                  debug_parse_cli_sym,   NULL, NULL, NULL, ACCESS_EXPERT },
        {{ "debug", "dev", "task",  NULL },    "debug dev task <ptr> [wake|expire|kill] : show/wake/expire/kill task/tasklet",      debug_parse_cli_task,  NULL, NULL, NULL, ACCESS_EXPERT },
        {{ "debug", "dev", "tkill", NULL },    "debug dev tkill  [thr] [sig]            : send signal to thread",                   debug_parse_cli_tkill, NULL, NULL, NULL, ACCESS_EXPERT },
-#if defined(DEBUG_DEV)
+#if defined(DEBUG_DEV) && defined(USE_TRACE)
        {{ "debug", "dev", "trace", NULL },    "debug dev trace [nbthr]                 : flood traces from that many threads",     debug_parse_cli_trace,  NULL, NULL, NULL, ACCESS_EXPERT },
 #endif
        {{ "debug", "dev", "warn",  NULL },    "debug dev warn                          : call WARN_ON() and possibly crash",       debug_parse_cli_warn,  NULL, NULL, NULL, ACCESS_EXPERT },