Skip to content

Commit

Permalink
doc: add debugging notes
Browse files Browse the repository at this point in the history
Problem: debugging flux is not always easy and we accumulated some
tricks along the way that ought to be shared with new developers.

Start a page for this in the flux-core docs.
  • Loading branch information
garlick committed Oct 15, 2024
1 parent 390ebe6 commit 73ba86b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ EXTRA_DIST = \
guide/admin.rst \
guide/glossary.rst \
guide/internals.rst \
guide/debug.rst \
guide/kvs.rst \
guide/broker.rst \
$(RST_FILES) \
Expand Down
62 changes: 62 additions & 0 deletions doc/guide/debug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.. _debug:

###############
Debugging Notes
###############

***********************
source tree executables
***********************

`libtool <https://www.gnu.org/software/libtool/manual/libtool.html>`_ is
in use, so :option:`libtool e` trickery is needed to launch a tool against
an actual compiled executable. Command front ends further complicate this.

.. note::
:option:`libtool e` is shorthand for :option:`libtool --mode=execute`.

Example: run a built-in sub-command under GDB

.. code-block::
$ libtool e gdb --ex run --args src/cmd/flux version
Example: run an external sub-command under GDB

.. code-block::
$ src/cmd/flux /usr/bin/libtool e gdb --ex run --args src/cmd/flux-keygen
Example: run the broker under GDB

.. code-block::
$ src/cmd/flux start --wrap=libtool,e,gdb,--ex,run
Example: run the broker under valgrind

.. code-block::
$ src/cmd/flux start --wrap=libtool,e,valgrind
***************
message tracing
***************

Example: trace messages sent/received by a command

.. code-block::
$ FLUX_HANDLE_TRACE=t flux kvs get foo
Example: trace messages sent/received by two broker modules

.. code-block::
$ flux module trace --full content kvs
Example: trace messages sent/received by this broker on the overlay network

.. code-block::
$ flux overlay trace --full
1 change: 1 addition & 0 deletions doc/guide/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Resources for Flux Developers
:maxdepth: 1
:caption: Contents:

debug
kvs
broker

0 comments on commit 73ba86b

Please sign in to comment.