mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 07:18:58 +01:00
test: fix usdt undeclared function errors on mantis
Recently usage of undeclared functions became an error rather than a warning, in C2x. https://reviews.llvm.org/D122983?id=420290 This change has migrated into the build tools of Ubuntu 23.10 which now causes the USDT tests to fail to compile, see https://github.com/bitcoin/bitcoin/issues/28600 Fix this by setting `-Wno-error=implicit-function-declaration` for the tracing programs.
This commit is contained in:
@@ -119,6 +119,7 @@ int trace_replaced(struct pt_regs *ctx) {
|
||||
replaced_events.perf_submit(ctx, &replaced, sizeof(replaced));
|
||||
return 0;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -143,7 +144,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:added", fn_name="trace_added")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0)
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
|
||||
def handle_added_event(_, data, __):
|
||||
events.append(bpf["added_events"].event(data))
|
||||
@@ -180,7 +181,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0)
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
|
||||
def handle_removed_event(_, data, __):
|
||||
events.append(bpf["removed_events"].event(data))
|
||||
@@ -226,7 +227,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0)
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
|
||||
def handle_replaced_event(_, data, __):
|
||||
events.append(bpf["replaced_events"].event(data))
|
||||
@@ -277,7 +278,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
self.log.info("Hooking into mempool:rejected tracepoint...")
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0)
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
|
||||
def handle_rejected_event(_, data, __):
|
||||
events.append(bpf["rejected_events"].event(data))
|
||||
|
||||
Reference in New Issue
Block a user