diff --git a/include/haproxy/tinfo-t.h b/include/haproxy/tinfo-t.h index 6cd06d983..5dce74383 100644 --- a/include/haproxy/tinfo-t.h +++ b/include/haproxy/tinfo-t.h @@ -81,6 +81,8 @@ enum thread_exec_ctx_type { TH_EX_CTX_OTHER, /* context only known by a generic pointer */ TH_EX_CTX_INITCALL, /* the pointer is an initcall providing file:line */ TH_EX_CTX_CALLER, /* the pointer is an ha_caller of the caller providing file:line etc */ + TH_EX_CTX_SMPF, /* directly registered sample fetch function, using .smpf_kwl */ + TH_EX_CTX_CONV, /* directly registered converter function, using .conv_kwl */ }; struct thread_exec_ctx { @@ -90,6 +92,8 @@ struct thread_exec_ctx { const void *pointer; /* generic pointer (for other) */ const struct initcall *initcall; /* used with TH_EX_CTX_INITCALL */ 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 */ }; }; diff --git a/src/sample.c b/src/sample.c index 4a7928595..42f211ad4 100644 --- a/src/sample.c +++ b/src/sample.c @@ -458,6 +458,9 @@ void sample_register_fetches(struct sample_fetch_kw_list *kwl) if (caller_initcall) { sf->exec_ctx.type = TH_EX_CTX_INITCALL; sf->exec_ctx.initcall = caller_initcall; + } else { + sf->exec_ctx.type = TH_EX_CTX_SMPF; + sf->exec_ctx.smpf_kwl = kwl; } } LIST_APPEND(&sample_fetches.list, &kwl->list); @@ -479,6 +482,9 @@ void sample_register_convs(struct sample_conv_kw_list *pckl) if (caller_initcall) { sc->exec_ctx.type = TH_EX_CTX_INITCALL; sc->exec_ctx.initcall = caller_initcall; + } else { + sc->exec_ctx.type = TH_EX_CTX_CONV; + sc->exec_ctx.conv_kwl = pckl; } } LIST_APPEND(&sample_convs.list, &pckl->list); diff --git a/src/tools.c b/src/tools.c index 39b43ba2c..10a9badca 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7529,6 +7529,12 @@ void chunk_append_thread_ctx(struct buffer *output, const struct thread_exec_ctx chunk_appendf(output,"ctx registered at %s@%s:%d", ctx->ha_caller->func, slash, ctx->ha_caller->line); break; } + case TH_EX_CTX_SMPF: + chunk_appendf(output,"smpf kwl starting with '%s'", ctx->smpf_kwl->kw[0].kw); + break; + case TH_EX_CTX_CONV: + chunk_appendf(output,"conv kwl starting with '%s'", ctx->conv_kwl->kw[0].kw); + break; default: chunk_appendf(output,"other ctx %p", ctx->pointer); break;