aboutsummaryrefslogtreecommitdiff
path: root/test/README.md
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2018-10-19 12:28:47 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-01-22 08:55:55 -0500
commit58180b5fd467ff15e7170145d77c84f13ccafe6e (patch)
tree5a7be4313cd7dd4e15f9666cf702235c2962ce5b /test/README.md
parentdf894fa69a09ff2b7f00af0cf220e5132a69c70a (diff)
tests: add utility to easily profile node performance with perf
Introduces `TestNode.profile_with_perf()` context manager which samples node execution to produce profiling data. Also introduces a test framework flag, `--perf`, which will run perf on all nodes for the duration of a given test.
Diffstat (limited to 'test/README.md')
-rw-r--r--test/README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/README.md b/test/README.md
index 680f9bf9a6..1cf22cb64b 100644
--- a/test/README.md
+++ b/test/README.md
@@ -176,6 +176,26 @@ gdb /home/example/bitcoind <pid>
Note: gdb attach step may require `sudo`
+##### Profiling
+
+An easy way to profile node performance during functional tests is provided
+for Linux platforms using `perf`.
+
+Perf will sample the running node and will generate profile data in the node's
+datadir. The profile data can then be presented using `perf report` or a graphical
+tool like [hotspot](https://github.com/KDAB/hotspot).
+
+To generate a profile during test suite runs, use the `--perf` flag.
+
+To see render the output to text, run
+
+```sh
+perf report -i /path/to/datadir/send-big-msgs.perf.data.xxxx --stdio | c++filt | less
+```
+
+For ways to generate more granular profiles, see the README in
+[test/functional](/test/functional).
+
### Util tests
Util tests can be run locally by running `test/util/bitcoin-util-test.py`.