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.
This commit is contained in:
Amaury Denoyelle 2026-05-13 13:38:31 +02:00
parent 19a3c29d3c
commit 8e1b46f8d7
2 changed files with 2 additions and 1 deletions

View 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

View 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;
}