New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log debug build status and warn when running benchmarks #12197
Conversation
Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results.
@@ -808,7 +808,13 @@ void InitLogging() | |||
fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS); | |||
|
|||
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | |||
LogPrintf("Bitcoin version %s\n", FormatFullVersion()); | |||
std::string version_string = FormatFullVersion(); | |||
#ifdef DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move this into FormatFullVersion if we want it in all places where the version is printed, but I wasn't entirely sure about that being useful, the point is just to have this in the log for post-mortem analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
LogPrintf("Bitcoin version %s\n", FormatFullVersion()); | ||
std::string version_string = FormatFullVersion(); | ||
#ifdef DEBUG | ||
version_string += " (debug build)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
µNit:
#ifdef DEBUG
const std::string version_string = FormatFullVersion() + " (debug build)";
#else
const std::string version_string = FormatFullVersion() + " (release build)";
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, I prefer it this way.
src/init.cpp
Outdated
#else | ||
version_string += " (release build)"; | ||
#endif | ||
LogPrintf("Bitcoin version %s\n", version_string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should say "Bitcoin Core" according to the rebranding 4 years ago: #3408
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't introduce this message here, but sure, can update this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to use PACKAGE_NAME (which is Bitcoin Core), same as for the --help
messages.
Will test after squash |
38b8988
to
baa2919
Compare
baa2919
to
34328b4
Compare
Works for me:
|
Note that gcc yells at me for compiling with |
34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
Summary: "34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results." This is a backport from Core PR12197: bitcoin/bitcoin#12197 Test Plan: cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja ninja check ninja bench-bitcoin Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix, nakihito, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, nakihito, Fabien Subscribers: Fabien, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4687
…chmarks 34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
…chmarks 34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
…chmarks 34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
…chmarks 34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
…chmarks 34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan) 0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan) Pull request description: Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug). Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results. Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug).
Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results.