aboutsummaryrefslogtreecommitdiff
path: root/doc/tracing.md
diff options
context:
space:
mode:
author0xb10c <0xb10c@gmail.com>2021-05-20 17:53:24 +0200
committer0xb10c <0xb10c@gmail.com>2021-07-27 17:12:38 +0200
commit8f37f5c2a562c38c83fc40234ade9c301fc4e685 (patch)
tree61c2e9023432218dcb0031e2e607469db154ee02 /doc/tracing.md
parent4224dec22baa66547303840707cf1d4f15a49b20 (diff)
downloadbitcoin-8f37f5c2a562c38c83fc40234ade9c301fc4e685.tar.xz
tracing: Tracepoint for connected blocks
Can, for example, be used to benchmark block connections.
Diffstat (limited to 'doc/tracing.md')
-rw-r--r--doc/tracing.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/tracing.md b/doc/tracing.md
index 026946b018..1242a0d250 100644
--- a/doc/tracing.md
+++ b/doc/tracing.md
@@ -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