diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-02-05 14:54:15 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-02-11 07:14:50 +0000 |
commit | 9e3d3e0532444c46a907128560cdad31888dcdea (patch) | |
tree | cc3a3e9e6e07a4d6a8451035013245dae765c30c | |
parent | c07cc967debeaa0bf3dfc46cbcd98a416e2f5370 (diff) | |
download | buildstream-9e3d3e0532444c46a907128560cdad31888dcdea.tar.gz |
contributing: snakeviz replaces pyflame+flamegraphsnakeviz
Replace the instructions for pyflame+flamegraph with simpler ones for
snakeviz. For our general use-case this seems to be easier and better.
Usage of this tool was demonstrated at the 2019 BuildStream Gathering in
January by Daniel Silverstone, when presenting the aggregate results of
profiling on many target environments.
Here is the relevant mailing list thread:
"Profiling before the gathering"
https://mail.gnome.org/archives/buildstream-list/2019-January/msg00057.html
-rw-r--r-- | CONTRIBUTING.rst | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 815acfca6..b993b08b6 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1707,26 +1707,13 @@ You can then analyze the results interactively using the 'pstats' module: For more detailed documentation of cProfile and 'pstats', see: 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: +For a richer and interactive visualisation of the `.cprofile` files, you can +try `snakeviz <http://jiffyclub.github.io/snakeviz/#interpreting-results>`_. +You can install it with `pip install snakeviz`. Here is an example invocation: - pyflame --output bst.flame --trace bst --help - -You may see an `Unexpected ptrace(2) exception:` error. Note that the `bst` -operation will continue running in the background in this case, you will need -to wait for it to complete or kill it. Once this is done, rerun the above -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: - - ./flamegraph.pl bst.flame > bst-flamegraph.svg - -The generated SVG file can then be viewed in your preferred web browser. + snakeviz bst.cprofile +It will then start a webserver and launch a browser to the relevant page. Profiling specific parts of BuildStream with BST_PROFILE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |