Add build support for 'gprof' profiling.
Summary:
Backport of core PR12373.
I made the cmake option a string value (not boolean) so that other tools
can be added later.
Test Plan:
For autotools:
./autogen.sh mkdir build && cd build ../configure --enable-gprof make
For cmake:
cmake -DENABLE_PROFILING=gprof -DENABLE_HARDENING=OFF ninja
For both:
./src/bitcoind -help gprof src/bitcoind gmon.out > profiling.txt
The profiling.txt file contains the profiling information.
cmake -GNinja .. -DENABLE_PROFILING=gprof
Should return an error and ask to disable hardening.
cmake -GNinja .. ninja check-security
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5181