diff options
author | Christian Hopps <chopps@labn.net> | 2023-04-24 03:56:38 +0200 |
---|---|---|
committer | Christian Hopps <chopps@labn.net> | 2023-04-24 03:56:38 +0200 |
commit | a3e8e1aacb2785b30132bccdf99e2fbf032ec6c1 (patch) | |
tree | 3684878233d664c02869d36b7009b582d58fed92 /doc/developer | |
parent | tests: add --perf and --perf-options for profiling daemons (diff) | |
download | frr-a3e8e1aacb2785b30132bccdf99e2fbf032ec6c1.tar.xz frr-a3e8e1aacb2785b30132bccdf99e2fbf032ec6c1.zip |
doc: document --perf and --perf-options, and a bit of cleanup
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'doc/developer')
-rw-r--r-- | doc/developer/topotests.rst | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index 6ccb00c77..13936e18e 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -296,14 +296,14 @@ Execute single test .. code:: shell cd test_to_be_run - ./test_to_be_run.py + sudo -E pytest ./test_to_be_run.py For example, and assuming you are inside the frr directory: .. code:: shell cd tests/topotests/bgp_l3vpn_to_bgp_vrf - ./test_bgp_l3vpn_to_bgp_vrf.py + sudo -E pytest ./test_bgp_l3vpn_to_bgp_vrf.py For further options, refer to pytest documentation. @@ -576,6 +576,27 @@ memleak detection is enabled. sudo -E pytest --valgrind-memleaks all-protocol-startup +Collecting Performance Data using perf(1) +""""""""""""""""""""""""""""""""""""""""" + +Topotest can automatically launch any daemon under ``perf(1)`` to collect +performance data. The daemon is run in non-daemon mode with ``perf record -g``. +The ``perf.data`` file will be saved in the router specific directory under the +tests run directoy. + +Here's an example of collecting performance data from ``mgmtd`` on router ``r1`` +during the config_timing test. + +.. code:: console + + $ sudo -E pytest --perf=mgmtd,r1 config_timing + ... + $ find /tmp/topotests/ -name '*perf.data*' + /tmp/topotests/config_timing.test_config_timing/r1/perf.data + +To specify different arguments for ``perf record``, one can use the +``--perf-options`` this will replace the ``-g`` used by default. + .. _topotests_docker: Running Tests with Docker |