diff options
author | Pu Lehui <pulehui@huawei.com> | 2024-04-02 07:30:29 +0000 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2024-04-02 16:29:28 +0200 |
commit | c186ed12a8ec498532d13de43094bdec9ac6f121 (patch) | |
tree | cd4e4d266cd85e9425e0b06d47598187f30bbc1c /tools/testing/selftests/bpf/prog_tests/token.c | |
parent | 2a24e2485722b0e12e17a2bd473bd15c9e420bdb (diff) | |
download | linux-c186ed12a8ec498532d13de43094bdec9ac6f121.tar.gz linux-c186ed12a8ec498532d13de43094bdec9ac6f121.tar.bz2 linux-c186ed12a8ec498532d13de43094bdec9ac6f121.zip |
selftests/bpf: Skip test when perf_event_open returns EOPNOTSUPP
When testing send_signal and stacktrace_build_id_nmi using the riscv sbi
pmu driver without the sscofpmf extension or the riscv legacy pmu driver,
then failures as follows are encountered:
test_send_signal_common:FAIL:perf_event_open unexpected perf_event_open: actual -1 < expected 0
#272/3 send_signal/send_signal_nmi:FAIL
test_stacktrace_build_id_nmi:FAIL:perf_event_open err -1 errno 95
#304 stacktrace_build_id_nmi:FAIL
The reason is that the above pmu driver or hardware does not support
sampling events, that is, PERF_PMU_CAP_NO_INTERRUPT is set to pmu
capabilities, and then perf_event_open returns EOPNOTSUPP. Since
PERF_PMU_CAP_NO_INTERRUPT is not only set in the riscv-related pmu driver,
it is better to skip testing when this capability is set.
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240402073029.1299085-1-pulehui@huaweicloud.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/token.c')
0 files changed, 0 insertions, 0 deletions