]> git.ipfire.org Git - thirdparty/haproxy.git/commit
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, 26 Jun 2024 05:38:21 +0000 (07:38 +0200)
commit0d79c9bedfa564e3c032c1e910c29949f5133d91
tree0b7c64ef67c1c5238b2dedb40ae54b89e90b1a91
parentfba9ade8910510151b5d6141c6594da789d6a71b
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.
include/haproxy/global-t.h
src/debug.c
src/haproxy.c