diff --git a/include/haproxy/tinfo-t.h b/include/haproxy/tinfo-t.h index a17527e79..031b491d8 100644 --- a/include/haproxy/tinfo-t.h +++ b/include/haproxy/tinfo-t.h @@ -89,6 +89,7 @@ enum thread_exec_ctx_type { TH_EX_CTX_MUX, /* mux whose mux_ops is in .mux_ops */ TH_EX_CTX_TASK, /* task or tasklet whose function is in .task */ TH_EX_CTX_APPLET, /* applet whose applet is in .applet */ + TH_EX_CTX_CLI_KWL, /* CLI keyword list, using .cli_kwl */ }; struct thread_exec_ctx { @@ -105,6 +106,7 @@ struct thread_exec_ctx { const struct mux_ops *mux_ops; /* used with TH_EX_CTX_MUX */ const struct task *(*task)(struct task *, void *, unsigned int); /* used with TH_EX_CTX_TASK */ const struct applet *applet; /* used with TH_EX_CTX_APPLET */ + const struct cli_kw_list *cli_kwl; /* used with TH_EX_CTX_CLI_KWL */ }; }; diff --git a/src/cli.c b/src/cli.c index a289f1d42..88883b916 100644 --- a/src/cli.c +++ b/src/cli.c @@ -410,6 +410,9 @@ void cli_register_kw(struct cli_kw_list *kw_list) if (caller_initcall) { kw->exec_ctx.type = TH_EX_CTX_INITCALL; kw->exec_ctx.initcall = caller_initcall; + } else { + kw->exec_ctx.type = TH_EX_CTX_CLI_KWL; + kw->exec_ctx.cli_kwl = kw_list; } } LIST_APPEND(&cli_keywords.list, &kw_list->list); diff --git a/src/tools.c b/src/tools.c index 08dd48074..112b57e82 100644 --- a/src/tools.c +++ b/src/tools.c @@ -66,6 +66,7 @@ extern void *__elf_aux_vector; #include #include #include +#include #include #include #include @@ -7555,6 +7556,14 @@ void chunk_append_thread_ctx(struct buffer *output, const struct thread_exec_ctx case TH_EX_CTX_APPLET: chunk_appendf(output,"applet '%s'", ctx->applet->name); break; + case TH_EX_CTX_CLI_KWL: + chunk_appendf(output,"cli kwl starting with '%s %s %s %s %s'", + ctx->cli_kwl->kw[0].str_kw[0], + ctx->cli_kwl->kw[0].str_kw[1] ? ctx->cli_kwl->kw[0].str_kw[1] : "", + ctx->cli_kwl->kw[0].str_kw[2] ? ctx->cli_kwl->kw[0].str_kw[2] : "", + ctx->cli_kwl->kw[0].str_kw[3] ? ctx->cli_kwl->kw[0].str_kw[3] : "", + ctx->cli_kwl->kw[0].str_kw[4] ? ctx->cli_kwl->kw[0].str_kw[4] : ""); + break; default: chunk_appendf(output,"other ctx %p", ctx->pointer); break;