]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Use read_perf_max_sample_freq() in perf_event_stackmap
authorSong Liu <song@kernel.org>
Wed, 12 Apr 2023 21:04:21 +0000 (14:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:22 +0000 (23:03 +0900)
commit9b9a288fc512657c4acf7b7f0c97023662cc7ee8
tree38df6e2622c61dbff3424967e0715d7e3ec3c0db
parent4934f165214df935be3a1e9b3df648e868749cda
selftests/bpf: Use read_perf_max_sample_freq() in perf_event_stackmap

[ Upstream commit de6d014a09bf12a9a8959d60c0a1d4a41d394a89 ]

Currently, perf_event sample period in perf_event_stackmap is set too low
that the test fails randomly. Fix this by using the max sample frequency,
from read_perf_max_sample_freq().

Move read_perf_max_sample_freq() to testing_helpers.c. Replace the CHECK()
with if-printf, as CHECK is not available in testing_helpers.c.

Fixes: ef3c6a7edbfd ("selftests/bpf: Add callchain_stackid")
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230412210423.900851-2-song@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/perf_event_stackmap.c
tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
tools/testing/selftests/bpf/testing_helpers.c
tools/testing/selftests/bpf/testing_helpers.h