]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: actions: also report execution contexts registered directly
authorWilly Tarreau <w@1wt.eu>
Fri, 6 Mar 2026 16:02:16 +0000 (17:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2026 17:06:38 +0000 (18:06 +0100)
This now reports directly registered actions using new type
TH_EX_CTX_ACTION which will report the first keyword of the
list.

include/haproxy/tinfo-t.h
src/action.c
src/tools.c

index f061a6e79d551acd434fd31e030701719b69cdf9..aacf3f10e27b3089a9078354e18e5bd01f65cb5e 100644 (file)
@@ -84,6 +84,7 @@ enum thread_exec_ctx_type {
        TH_EX_CTX_SMPF,                     /* directly registered sample fetch function, using .smpf_kwl */
        TH_EX_CTX_CONV,                     /* directly registered converter function, using .conv_kwl */
        TH_EX_CTX_FUNC,                     /* hopefully recognizable function/callback, using .pointer */
+       TH_EX_CTX_ACTION,                   /* directly registered action function, using .action_kwl */
 };
 
 struct thread_exec_ctx {
@@ -95,6 +96,7 @@ struct thread_exec_ctx {
                const struct ha_caller *ha_caller;  /* used with TH_EX_CTX_CALLER */
                const struct sample_fetch_kw_list *smpf_kwl; /* used with TH_EX_CTX_SMPF */
                const struct sample_conv_kw_list *conv_kwl;  /* used with TH_EX_CTX_CONV */
+               const struct action_kw_list *action_kwl;  /* used with TH_EX_CTX_ACTION */
        };
 };
 
index 9c5153b1c96906ee66e7f850b2c0bc5f6287bc41..a695202b7183cecb5776d67dd6052e3e3f6499a2 100644 (file)
@@ -400,6 +400,9 @@ void act_add_list(struct list *head, struct action_kw_list *kw_list)
                if (caller_initcall) {
                        kw_list->kw[i].exec_ctx.type = TH_EX_CTX_INITCALL;
                        kw_list->kw[i].exec_ctx.initcall = caller_initcall;
+               } else {
+                       kw_list->kw[i].exec_ctx.type = TH_EX_CTX_ACTION;
+                       kw_list->kw[i].exec_ctx.action_kwl = kw_list;
                }
        }
        LIST_APPEND(head, &kw_list->list);
index 58fa78013f0d25f68ed636495dea5ef403c01c65..eaf655722df8f86ef13ca9e5cbf49558fe288f1f 100644 (file)
@@ -7539,6 +7539,9 @@ void chunk_append_thread_ctx(struct buffer *output, const struct thread_exec_ctx
                resolve_sym_name(output, "func '", ctx->pointer);
                chunk_appendf(output,"'");
                break;
+       case TH_EX_CTX_ACTION:
+               chunk_appendf(output,"act kwl starting with '%s'", ctx->action_kwl->kw[0].kw);
+               break;
        default:
                chunk_appendf(output,"other ctx %p", ctx->pointer);
                break;