MINOR: cli/debug: show dev: add cmdline and version
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 29 May 2024 09:27:21 +0000 (11:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 17:57:42 +0000 (18:57 +0100)
commit5ca7eb5e8440f8501d6acecd5e2aa0c71d433010
tree6f55207b9b595db4889109e62dd05f157d209375
parent4655bd1e6430235d0d671d632fa2bca6a45b4628
MINOR: cli/debug: show dev: add cmdline and version

'show dev' command is very convenient to obtain haproxy debugging information,
while process is run in container. Let's extend its output with version and
cmdline. cmdline is useful in a way, as it shows absolute binary path and its
arguments, because sometimes the person, who is debugging failing container is
not the same, who has created and deployed it.

argc and argv are stored in the exported global structure, because
feed_post_mortem() is added as a post check function callback in the
post_check_list. So we can't simply change the signature of
feed_post_mortem(), without breaking other post check callbacks APIs.

Parsers are not supposed to modify argv, so we can safely bypass its pointer
to debug_parse_cli_show_dev(), without copying all argument stings somewhere
in the heap or on stack.

(cherry picked from commit 0d79c9bedfa564e3c032c1e910c29949f5133d91)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/global-t.h
src/debug.c
src/haproxy.c