@@ -173,7 +173,7 @@ def test_uncache(self):
173
173
invalid_tx .vin [0 ].prevout .hash = int (block_1_coinbase_txid , 16 )
174
174
175
175
self .log .info ("hooking into the utxocache:uncache tracepoint" )
176
- ctx = USDT (path = str ( self .options . bitcoind ) )
176
+ ctx = USDT (pid = self .nodes [ 0 ]. process . pid )
177
177
ctx .enable_probe (probe = "utxocache:uncache" ,
178
178
fn_name = "trace_utxocache_uncache" )
179
179
bpf = BPF (text = utxocache_changes_program , usdt_contexts = [ctx ], debug = 0 )
@@ -238,7 +238,7 @@ def test_add_spent(self):
238
238
239
239
self .log .info (
240
240
"hook into the utxocache:add and utxocache:spent tracepoints" )
241
- ctx = USDT (path = str ( self .options . bitcoind ) )
241
+ ctx = USDT (pid = self .nodes [ 0 ]. process . pid )
242
242
ctx .enable_probe (probe = "utxocache:add" , fn_name = "trace_utxocache_add" )
243
243
ctx .enable_probe (probe = "utxocache:spent" ,
244
244
fn_name = "trace_utxocache_spent" )
@@ -334,7 +334,7 @@ def test_flush(self):
334
334
335
335
self .log .info ("test the utxocache:flush tracepoint API" )
336
336
self .log .info ("hook into the utxocache:flush tracepoint" )
337
- ctx = USDT (path = str ( self .options . bitcoind ) )
337
+ ctx = USDT (pid = self .nodes [ 0 ]. process . pid )
338
338
ctx .enable_probe (probe = "utxocache:flush" ,
339
339
fn_name = "trace_utxocache_flush" )
340
340
bpf = BPF (text = utxocache_flushes_program , usdt_contexts = [ctx ], debug = 0 )
@@ -373,6 +373,7 @@ def handle_utxocache_flush(_, data, __):
373
373
self .stop_node (0 )
374
374
375
375
bpf .perf_buffer_poll (timeout = 200 )
376
+ bpf .cleanup ()
376
377
377
378
self .log .info ("check that we don't expect additional flushes" )
378
379
assert_equal (0 , len (expected_flushes ))
@@ -381,6 +382,14 @@ def handle_utxocache_flush(_, data, __):
381
382
self .log .info ("restart the node with -prune" )
382
383
self .start_node (0 , ["-fastprune=1" , "-prune=1" ])
383
384
385
+ self .log .info ("test the utxocache:flush tracepoint API with pruning" )
386
+ self .log .info ("hook into the utxocache:flush tracepoint" )
387
+ ctx = USDT (pid = self .nodes [0 ].process .pid )
388
+ ctx .enable_probe (probe = "utxocache:flush" ,
389
+ fn_name = "trace_utxocache_flush" )
390
+ bpf = BPF (text = utxocache_flushes_program , usdt_contexts = [ctx ], debug = 0 )
391
+ bpf ["utxocache_flush" ].open_perf_buffer (handle_utxocache_flush )
392
+
384
393
BLOCKS_TO_MINE = 350
385
394
self .log .info (f"mine { BLOCKS_TO_MINE } blocks to be able to prune" )
386
395
self .generate (self .wallet , BLOCKS_TO_MINE )
0 commit comments