Skip to content

Commit 0c74e2e

Browse files
committed
Log debug build status and warn when running benchmarks
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.
1 parent 66e3af7 commit 0c74e2e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/bench/bench.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
100100
if (!std::ratio_less_equal<benchmark::clock::period, std::micro>::value) {
101101
std::cerr << "WARNING: Clock precision is worse than microsecond - benchmarks may be less accurate!\n";
102102
}
103+
#ifdef DEBUG
104+
std::cerr << "WARNING: This is a debug build - may result in slower benchmarks.\n";
105+
#endif
103106

104107
std::regex reFilter(filter);
105108
std::smatch baseMatch;

src/init.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,13 @@ void InitLogging()
808808
fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS);
809809

810810
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
811-
LogPrintf("Bitcoin version %s\n", FormatFullVersion());
811+
std::string version_string = FormatFullVersion();
812+
#ifdef DEBUG
813+
version_string += " (debug build)";
814+
#else
815+
version_string += " (release build)";
816+
#endif
817+
LogPrintf("Bitcoin version %s\n", version_string);
812818
}
813819

814820
namespace { // Variables internal to initialization process only

0 commit comments

Comments
 (0)