mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-19 20:25:18 +01:00
tracing: Tracepoint for connected blocks
Can, for example, be used to benchmark block connections.
This commit is contained in:
@@ -93,6 +93,28 @@ to user-space in full. Messages longer than a 32kb might be cut off. This can
|
||||
be detected in tracing scripts by comparing the message size to the length of
|
||||
the passed message.
|
||||
|
||||
### Context `validation`
|
||||
|
||||
#### Tracepoint `validation:block_connected`
|
||||
|
||||
Is called *after* a block is connected to the chain. Can, for example, be used
|
||||
to benchmark block connections together with `-reindex`.
|
||||
|
||||
Arguments passed:
|
||||
1. Block Header Hash as `pointer to C-style String` (64 characters)
|
||||
2. Block Height as `int32`
|
||||
3. Transactions in the Block as `uint64`
|
||||
4. Inputs spend in the Block as `int32`
|
||||
5. SigOps in the Block (excluding coinbase SigOps) `uint64`
|
||||
6. Time it took to connect the Block in microseconds (µs) as `uint64`
|
||||
7. Block Header Hash as `pointer to unsigned chars` (i.e. 32 bytes in little-endian)
|
||||
|
||||
Note: The 7th argument can't be accessed by bpftrace and is purposefully chosen
|
||||
to be the block header hash as bytes. See [bpftrace argument limit] for more
|
||||
details.
|
||||
|
||||
[bpftrace argument limit]: #bpftrace-argument-limit
|
||||
|
||||
## Adding tracepoints to Bitcoin Core
|
||||
|
||||
To add a new tracepoint, `#include <util/trace.h>` in the compilation unit where
|
||||
|
||||
Reference in New Issue
Block a user