summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2023-02-03 13:44:13 +0900
committerAustin Seipp <aseipp@pobox.com>2023-02-03 16:53:17 -0600
commitfd5d7b258694c1ef5d499cba37693ebd21fbc13f (patch)
tree1f63924d2f3d7d2f83e6b4fa1fe8c5fe93be3b28 /nixos
parentc1fd7598cf66cd5c653d081bd92f787e1ffa9a9f (diff)
tests/bpf: add module BTF test
bpftrace 0.17 added module BTF support, check this works. On bpftrace 0.16, this failed with the following error: > ERROR: kfunc:nft_trans_alloc_gfp: no BTF data for the function
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/bpf.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/tests/bpf.nix b/nixos/tests/bpf.nix
index 5868e3bfcb4c..5dc97404772b 100644
--- a/nixos/tests/bpf.nix
+++ b/nixos/tests/bpf.nix
@@ -25,5 +25,9 @@ import ./make-test-python.nix ({ pkgs, ... }: {
print(machine.succeed("bpftrace -e 'kprobe:schedule { "
" printf(\"tgid: %d\", ((struct task_struct*) curtask)->tgid); exit() "
"}'"))
+ # module BTF (bpftrace >= 0.17)
+ print(machine.succeed("bpftrace -e 'kfunc:nft_trans_alloc_gfp { "
+ " printf(\"portid: %d\\n\",args->ctx->portid); "
+ "} BEGIN { exit() }'"))
'';
})