mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-19 05:31:26 +02:00
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.
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.