selftest/bpf: Test a perf BPF program that suppresses side effects
authorKyle Huey <me@kylehuey.com>
Fri, 12 Apr 2024 01:50:19 +0000 (18:50 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 12 Apr 2024 09:49:51 +0000 (11:49 +0200)
commita265c9f6d52ac760e6e572bac73a11b60b998779
treeca0cdf253184f1af3a265b9e5a5e9aee67855988
parentc4fcc7d1f41532e878087c7c43f4cf247604d68b
selftest/bpf: Test a perf BPF program that suppresses side effects

The test sets a hardware breakpoint and uses a BPF program to suppress the
side effects of a perf event sample, including I/O availability signals,
SIGTRAPs, and decrementing the event counter limit, if the IP matches the
expected value. Then the function with the breakpoint is executed multiple
times to test that all effects behave as expected.

Signed-off-by: Kyle Huey <khuey@kylehuey.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240412015019.7060-8-khuey@kylehuey.com
tools/testing/selftests/bpf/prog_tests/perf_skip.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_perf_skip.c [new file with mode: 0644]