]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: trace: implement source alias
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 13 May 2026 11:38:31 +0000 (13:38 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 13 May 2026 14:23:58 +0000 (16:23 +0200)
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.

include/haproxy/trace-t.h
src/trace.c

index 2d32d99f2f754248b234e96edd60faf861374dae..85cdf41b355e92fb17c23b7350c9abf15491c50d 100644 (file)
@@ -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
index 68e98bbc4ef280b3289972e480d45b2617119b67..6060d4df2540c36b26d83b96709ddc76e4293d22 100644 (file)
@@ -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;
 }