From: Amaury Denoyelle Date: Wed, 13 May 2026 11:38:31 +0000 (+0200) Subject: MINOR: trace: implement source alias X-Git-Tag: v3.4-dev12~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e1b46f8d7acc3eec52b18a37b23609a8cf5ebc1;p=thirdparty%2Fhaproxy.git MINOR: trace: implement source alias Add a new "alias" member in trace_source structure. Its purpose is to be an alternative to the member "name". This will be used in the next patch to allow renaming of QUIC mux traces while preserving compatibility. This new member is only used in trace_find_source() which is the helper used to retrieve a trace source from its name. --- diff --git a/include/haproxy/trace-t.h b/include/haproxy/trace-t.h index 2d32d99f2..85cdf41b3 100644 --- a/include/haproxy/trace-t.h +++ b/include/haproxy/trace-t.h @@ -166,6 +166,7 @@ struct trace_ctx { struct trace_source { /* source definition */ const struct ist name; + const struct ist alias; const char *desc; const struct trace_event *known_events; struct list source_link; // element in list of known trace sources diff --git a/src/trace.c b/src/trace.c index 68e98bbc4..6060d4df2 100644 --- a/src/trace.c +++ b/src/trace.c @@ -386,7 +386,7 @@ struct trace_source *trace_find_source(const char *name) const struct ist iname = ist(name); list_for_each_entry(src, &trace_sources, source_link) - if (isteq(src->name, iname)) + if (isteq(src->name, iname) || isteq(src->alias, iname)) return src; return NULL; }