Skip to content

Commit facb9b3

Browse files
author
MarcoFalke
committed
scripted-diff: Use bpf_cflags
-BEGIN VERIFY SCRIPT- ren() { sed --regexp-extended -i "s/$1/$2/g" $( git grep --extended-regexp -l "$1" ) ; } ren 'cflags=\["-Wno-error=implicit-function-declaration"\]' 'cflags=bpf_cflags()' -END VERIFY SCRIPT-
1 parent fa0c1ba commit facb9b3

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

test/functional/interface_usdt_coinselection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def run_test(self):
176176
ctx.enable_probe(probe="coin_selection:normal_create_tx_internal", fn_name="trace_normal_create_tx")
177177
ctx.enable_probe(probe="coin_selection:attempting_aps_create_tx", fn_name="trace_attempt_aps")
178178
ctx.enable_probe(probe="coin_selection:aps_create_tx_internal", fn_name="trace_aps_create_tx")
179-
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
179+
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
180180

181181
self.log.info("Prepare wallets")
182182
self.generate(self.nodes[0], 101)

test/functional/interface_usdt_mempool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def added_test(self):
169169
node = self.nodes[0]
170170
ctx = USDT(pid=node.process.pid)
171171
ctx.enable_probe(probe="mempool:added", fn_name="trace_added")
172-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
172+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
173173

174174
def handle_added_event(_, data, __):
175175
events.append(bpf["added_events"].event(data))
@@ -206,7 +206,7 @@ def removed_test(self):
206206
node = self.nodes[0]
207207
ctx = USDT(pid=node.process.pid)
208208
ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed")
209-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
209+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
210210

211211
def handle_removed_event(_, data, __):
212212
events.append(bpf["removed_events"].event(data))
@@ -252,7 +252,7 @@ def replaced_test(self):
252252
node = self.nodes[0]
253253
ctx = USDT(pid=node.process.pid)
254254
ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced")
255-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
255+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
256256

257257
def handle_replaced_event(_, data, __):
258258
event = ctypes.cast(data, ctypes.POINTER(MempoolReplaced)).contents
@@ -305,7 +305,7 @@ def rejected_test(self):
305305
self.log.info("Hooking into mempool:rejected tracepoint...")
306306
ctx = USDT(pid=node.process.pid)
307307
ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected")
308-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
308+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
309309

310310
def handle_rejected_event(_, data, __):
311311
events.append(bpf["rejected_events"].event(data))

test/functional/interface_usdt_net.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def __repr__(self):
287287
fn_name="trace_inbound_message")
288288
ctx.enable_probe(probe="net:outbound_message",
289289
fn_name="trace_outbound_message")
290-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
290+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
291291

292292
EXPECTED_INOUTBOUND_VERSION_MSG = 1
293293
checked_inbound_version_msg = 0
@@ -345,7 +345,7 @@ def inbound_conn_tracepoint_test(self):
345345
ctx = USDT(pid=self.nodes[0].process.pid)
346346
ctx.enable_probe(probe="net:inbound_connection",
347347
fn_name="trace_inbound_connection")
348-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
348+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
349349

350350
inbound_connections = []
351351
EXPECTED_INBOUND_CONNECTIONS = 2
@@ -382,7 +382,7 @@ def outbound_conn_tracepoint_test(self):
382382
ctx = USDT(pid=self.nodes[0].process.pid)
383383
ctx.enable_probe(probe="net:outbound_connection",
384384
fn_name="trace_outbound_connection")
385-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
385+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
386386

387387
# that the handle_* function succeeds.
388388
EXPECTED_OUTBOUND_CONNECTIONS = 2
@@ -423,7 +423,7 @@ def evicted_inbound_conn_tracepoint_test(self):
423423
ctx = USDT(pid=self.nodes[0].process.pid)
424424
ctx.enable_probe(probe="net:evicted_inbound_connection",
425425
fn_name="trace_evicted_inbound_connection")
426-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
426+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
427427

428428
EXPECTED_EVICTED_CONNECTIONS = 2
429429
evicted_connections = []
@@ -460,7 +460,7 @@ def misbehaving_conn_tracepoint_test(self):
460460
ctx = USDT(pid=self.nodes[0].process.pid)
461461
ctx.enable_probe(probe="net:misbehaving_connection",
462462
fn_name="trace_misbehaving_connection")
463-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
463+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
464464

465465
EXPECTED_MISBEHAVING_CONNECTIONS = 2
466466
misbehaving_connections = []
@@ -494,7 +494,7 @@ def closed_conn_tracepoint_test(self):
494494
ctx = USDT(pid=self.nodes[0].process.pid)
495495
ctx.enable_probe(probe="net:closed_connection",
496496
fn_name="trace_closed_connection")
497-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
497+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
498498

499499
EXPECTED_CLOSED_CONNECTIONS = 2
500500
closed_connections = []

test/functional/interface_usdt_utxocache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_uncache(self):
184184
ctx = USDT(pid=self.nodes[0].process.pid)
185185
ctx.enable_probe(probe="utxocache:uncache",
186186
fn_name="trace_utxocache_uncache")
187-
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
187+
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
188188

189189
# The handle_* function is a ctypes callback function called from C. When
190190
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -253,7 +253,7 @@ def test_add_spent(self):
253253
ctx.enable_probe(probe="utxocache:add", fn_name="trace_utxocache_add")
254254
ctx.enable_probe(probe="utxocache:spent",
255255
fn_name="trace_utxocache_spent")
256-
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
256+
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
257257

258258
# The handle_* function is a ctypes callback function called from C. When
259259
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -353,7 +353,7 @@ def test_flush(self):
353353
ctx = USDT(pid=self.nodes[0].process.pid)
354354
ctx.enable_probe(probe="utxocache:flush",
355355
fn_name="trace_utxocache_flush")
356-
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
356+
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
357357

358358
# The handle_* function is a ctypes callback function called from C. When
359359
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -410,7 +410,7 @@ def handle_utxocache_flush(_, data, __):
410410
ctx = USDT(pid=self.nodes[0].process.pid)
411411
ctx.enable_probe(probe="utxocache:flush",
412412
fn_name="trace_utxocache_flush")
413-
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
413+
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
414414
bpf["utxocache_flush"].open_perf_buffer(handle_utxocache_flush)
415415

416416
self.log.info("prune blockchain to trigger a flush for pruning")

test/functional/interface_usdt_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def __repr__(self):
9999
ctx.enable_probe(probe="validation:block_connected",
100100
fn_name="trace_block_connected")
101101
bpf = BPF(text=validation_blockconnected_program,
102-
usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
102+
usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
103103

104104
def handle_blockconnected(_, data, __):
105105
event = ctypes.cast(data, ctypes.POINTER(Block)).contents

0 commit comments

Comments
 (0)