mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: trace: add a per-source helper to pre-fill the context
Now sources which want to do it can provide a helper that can pre-fill some fields in the context based on their knowledge (e.g. mux streams).
This commit is contained in:
parent
7d55a70f5a
commit
10c8baca44
@ -166,6 +166,8 @@ struct trace_source {
|
||||
const struct trace_source *src,
|
||||
const struct ist where, const struct ist func,
|
||||
const void *a1, const void *a2, const void *a3, const void *a4);
|
||||
void (*fill_ctx)(struct trace_ctx *ctx, const struct trace_source *src,
|
||||
const void *a1, const void *a2, const void *a3, const void *a4);
|
||||
uint32_t arg_def; // argument definitions (sum of TRC_ARG{1..4}_*)
|
||||
const struct name_desc *lockon_args; // must be 4 entries if not NULL
|
||||
const struct name_desc *decoding; // null-terminated if not NULL
|
||||
|
@ -123,6 +123,9 @@ int __trace_enabled(enum trace_level level, uint64_t mask, struct trace_source *
|
||||
if (src->arg_def & TRC_ARGS_APPCTX)
|
||||
ctx.appctx = trace_pick_arg(src->arg_def & TRC_ARGS_APPCTX, a1, a2, a3, a4);
|
||||
|
||||
if (src->fill_ctx)
|
||||
src->fill_ctx(&ctx, src, a1, a2, a3, a4);
|
||||
|
||||
#ifdef USE_QUIC
|
||||
if (ctx.qc && !ctx.conn)
|
||||
ctx.conn = ctx.qc->conn;
|
||||
|
Loading…
Reference in New Issue
Block a user