#!/usr/bin/env bpftrace BEGIN { printf("IBD to 200,000 bench\n"); } usdt:./src/bitcoind:chainstate:connect_block { $height = (uint32)arg0; if ($height == 1) { printf("block 1 found, starting benchmark\n"); @start = nsecs; } if ($height >= 200000) { @end = nsecs; @duration = @end - @start; exit(); } } END { printf("duration %d ms\n", @duration / 1000000) }