Page MenuHomePhabricator

Add build support for 'gprof' profiling.
ClosedPublic

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

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCb31840b04324: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Thu, Feb 6, 14:56
Herald added a reviewer: Restricted Project. · View Herald TranscriptThu, Feb 6, 14:56
teamcity edited the summary of this revision. (Show Details)Thu, Feb 6, 14:56

[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.Thu, Feb 6, 15:31
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/CMakeLists.txt
171 ↗(On Diff #16077)

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

This revision now requires changes to proceed.Thu, Feb 6, 15:31
Fabien added inline comments.Thu, Feb 6, 15:55
src/CMakeLists.txt
171 ↗(On Diff #16077)

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

Fabien updated this revision to Diff 16079.Thu, Feb 6, 15:56

Address feedback.

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