tracing: correctly scope utxocache:flush tracepoint
Summary:
Previously, the utxocache:flush tracepoint was in the wrong scope and
reached every time CChainState::FlushStateToDisk was called, even when
there was no flushing of the cache. The tracepoint is now properly scoped
and will be reached during a full flush.
This concludes backport of core#23907
https://github.com/bitcoin/bitcoin/pull/23907/commits/36a65847033540cf2203252c7baf42bc5ec97579
The rest of the backport was already done in D12715.
Test Plan:
Run a reindex with tracing enabled and with a small dbcache (to trigger frequent flushes):
cmake -GNinja .. -DENABLE_TRACING=ON ninja ./src/bitcoind -daemon -dbcache=100 -reindex-chainstate -datadir=/data0/ecashd_test sudo ../contrib/tracing/log_utxocache_flush.py ./src/bitcoind sudo bpftrace ../contrib/tracing/log_utxos.bt
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18636