]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Add test for checking correct nop of optimized usdt
authorJiri Olsa <jolsa@kernel.org>
Tue, 24 Feb 2026 10:39:14 +0000 (11:39 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 3 Mar 2026 16:39:22 +0000 (08:39 -0800)
commit304841967c5574fec9307a2c1cdfa8abf30a29fc
tree1aaf6a54585fd0198c52fa8b7ee2b6e103515f8a
parent0c178e9debc8f0a305149f5ccace6796f6931a1d
selftests/bpf: Add test for checking correct nop of optimized usdt

Adding test that attaches bpf program on usdt probe in 2 scenarios;

- attach program on top of usdt_1, which is single nop instruction,
  so the probe stays on nop instruction and is not optimized.

- attach program on top of usdt_2 which is probe defined on top
  of nop,nop5 combo, so the probe is placed on top of nop5 and
  is optimized.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20260224103915.1369690-5-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/usdt.c
tools/testing/selftests/bpf/progs/test_usdt.c
tools/testing/selftests/bpf/usdt_1.c [new file with mode: 0644]
tools/testing/selftests/bpf/usdt_2.c [new file with mode: 0644]