]> git.puffer.fish Git - mirror/frr.git/commitdiff
doc: document --perf and --perf-options, and a bit of cleanup 13365/head
authorChristian Hopps <chopps@labn.net>
Mon, 24 Apr 2023 01:56:38 +0000 (21:56 -0400)
committerChristian Hopps <chopps@labn.net>
Mon, 24 Apr 2023 01:56:38 +0000 (21:56 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
doc/developer/topotests.rst

index 6ccb00c7723ef140e7ed3f41c8304c1484daf080..13936e18ed846c0fc2b6f6e6984fe8948c098f75 100644 (file)
@@ -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