Page MenuHomePhabricator

Add build support for 'gprof' profiling.
ClosedPublic

Authored by Fabien on Feb 6 2020, 14:56.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR12373
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9303
Build 16543: Default Diff Build & Tests
Build 16542: arc lint + arc unit

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those Bitcoin Core PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.Feb 6 2020, 15:31
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/CMakeLists.txt
171

The famous if/leave/else pattern in action. Just get rid of that else.

This revision now requires changes to proceed.Feb 6 2020, 15:31
src/CMakeLists.txt
171

Oh right, I used SEND_ERROR then changed my mind and forgot to update.

This revision is now accepted and ready to land.Feb 7 2020, 02:36
This revision was automatically updated to reflect the committed changes.