haproxy/dev/flags
Willy Tarreau 946d370d22 BUILD: flags: really restrict the cases where flags are exposed
A number of internal flags started to be exposed to external programs
at the location of their definition since commit 77acaf5af ("MINOR:
flags: add a new file to host flag dumping macros"). This allowed the
"flags" utility to decode many more of them and always correctly. The
condition to expose them was to rely on the preliminary definition of
EOF that indicates that stdio is already included. But this was a
wrong approach. It only guarantees that snprintf() can safely be used
but still causes large functions to be built. But stdio is often
included before some of these includes, so these heavy inline functions
actually have to be compiled in many cases. The result is that the
build time significantly increased, especially with fast compilers
like gcc -O0 which took +50% or TCC which took +100%!

This patch addresses the problem by instead relying on an explicit
macro HA_EXPOSE_FLAGS that the calling program must explicitly define
before including these files. flags.c does this and that's all. The
previous build time is now restored with a speed up of 20 to 50%
depending on the build options.
2022-11-24 08:32:27 +01:00
..
README DEV: flags: use "sc" for stream conns instead of "cs" 2022-05-27 19:33:35 +02:00
flags.c BUILD: flags: really restrict the cases where flags are exposed 2022-11-24 08:32:27 +01:00
show-fd-to-flags.sh

README

This needs to be built from the top makefile, for example :

    make dev/flags/flags

Then the executable is usable either one value at a time from the
command line, either with values coming from stdin with "-" passed
alone instead of the value.

It is possible to restrict the decoding to certain fields only by
specifying one of "ana", "chn", "conn", "sc", "si", "sierr", "strm",
"task", or "txn" before the value.