mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
tracing: Tracepoint for connected blocks
Can, for example, be used to benchmark block connections.
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include <util/rbf.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/trace.h>
|
||||
#include <util/translation.h>
|
||||
#include <validationinterface.h>
|
||||
#include <warnings.h>
|
||||
@@ -1997,6 +1998,16 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
int64_t nTime6 = GetTimeMicros(); nTimeCallbacks += nTime6 - nTime5;
|
||||
LogPrint(BCLog::BENCH, " - Callbacks: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime6 - nTime5), nTimeCallbacks * MICRO, nTimeCallbacks * MILLI / nBlocksTotal);
|
||||
|
||||
TRACE7(validation, block_connected,
|
||||
block.GetHash().ToString().c_str(),
|
||||
pindex->nHeight,
|
||||
block.vtx.size(),
|
||||
nInputs,
|
||||
nSigOpsCost,
|
||||
GetTimeMicros() - nTimeStart, // in microseconds (µs)
|
||||
block.GetHash().data()
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user