mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-15 18:26:11 +02:00
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:
parent
19a3c29d3c
commit
8e1b46f8d7
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user