]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: support dumping the libs addresses when running in verbose mode
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Mar 2023 10:37:54 +0000 (11:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Mar 2023 10:43:15 +0000 (11:43 +0100)
Starting haproxy with -dL helps enumerate the list of libraries in use.
But sometimes in order to go further we'd like to see their address
ranges. This is already supported on the CLI's "show libs" but not on
the command line where it can sometimes help troubleshoot startup issues.
Let's dump them when in verbose mode. This way it doesn't change the
existing behavior for those trying to enumerate libs to produce an archive.

doc/management.txt
src/haproxy.c

index 96bd30c3d98afa4b7112eaaa224143c574d5b742..36b196ff95c22215f831c5ae6cea78ccf595c831 100644 (file)
@@ -271,6 +271,9 @@ list of options is :
 
        ./haproxy -W -q -c -dL -f foo.cfg | tar -T - -hzcf archive.tgz
 
+   When started in verbose mode (-V) the shared libraries' address ranges are
+   also enumerated, unless the quiet mode is in use (-q).
+
   -dM[<byte>[,]][help|options,...] : forces memory poisoning, and/or changes
     memory other debugging options. Memory poisonning means that each and every
     memory region allocated with malloc() or pool_alloc() will be filled with
index 3def1ed98374c183e63074f047d57414fe4fbd7a..852e514025f9f9b6643d40f262e89f49292cbb98 100644 (file)
@@ -2310,7 +2310,7 @@ static void init(int argc, char **argv)
        if (global.mode & MODE_DUMP_LIBS) {
                qfprintf(stdout, "List of loaded object files:\n");
                chunk_reset(&trash);
-               if (dump_libs(&trash, 0))
+               if (dump_libs(&trash, ((arg_mode & (MODE_QUIET|MODE_VERBOSE)) == MODE_VERBOSE)))
                        printf("%s", trash.area);
        }
 #endif