diff options
-rw-r--r-- | HACKING.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/HACKING.rst b/HACKING.rst index dd791bd24..e201f47d7 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -509,11 +509,11 @@ tool. Python provides `cProfile <https://docs.python.org/3/library/profile.html>`_ which gives you a list of all functions called during execution and how much time was spent in each function. Here is an example of running `bst --help` -under cProfile: +under cProfile:: python3 -m cProfile -o bst.cprofile -- $(which bst) --help -You can then analyze the results interactively using the 'pstats' module: +You can then analyze the results interactively using the 'pstats' module:: python3 -m pstats ./bst.cprofile @@ -523,7 +523,7 @@ https://docs.python.org/3/library/profile.html. For a richer visualisation of the callstack you can try `Pyflame <https://github.com/uber/pyflame>`_. Once you have followed the instructions in Pyflame's README to install the tool, you can profile `bst` commands as in the -following example: +following example:: pyflame --output bst.flame --trace bst --help @@ -534,7 +534,7 @@ command which appears to fix the issue. Once you have output from pyflame, you can use the ``flamegraph.pl`` script from the `Flamegraph project <https://github.com/brendangregg/FlameGraph>`_ -to generate an .svg image: +to generate an .svg image:: ./flamegraph.pl bst.flame > bst-flamegraph.svg |