diff options
author | Mykola Lysenko <mykolal@fb.com> | 2022-03-08 23:04:47 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-03-09 04:39:28 +0300 |
commit | d4b540544499d90ac81695e21e354cd5c82fa67e (patch) | |
tree | f3342707679848d8525ab111ca9c4f3b7870cfdf /tools/testing/selftests/bpf/prog_tests/perf_link.c | |
parent | 7fd9fd46a459272e641be78c1cc36baab1921fa1 (diff) | |
download | linux-d4b540544499d90ac81695e21e354cd5c82fa67e.tar.xz |
Improve perf related BPF tests (sample_freq issue)
Linux kernel may automatically reduce kernel.perf_event_max_sample_rate
value when running tests in parallel on slow systems. Linux kernel checks
against this limit when opening perf event with freq=1 parameter set.
The lower bound is 1000. This patch reduces sample_freq value to 1000
in all BPF tests that use sample_freq to ensure they always can open
perf event.
Signed-off-by: Mykola Lysenko <mykolal@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220308200449.1757478-2-mykolal@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/perf_link.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/perf_link.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/perf_link.c b/tools/testing/selftests/bpf/prog_tests/perf_link.c index ede07344f264..224eba6fef2e 100644 --- a/tools/testing/selftests/bpf/prog_tests/perf_link.c +++ b/tools/testing/selftests/bpf/prog_tests/perf_link.c @@ -39,7 +39,7 @@ void serial_test_perf_link(void) attr.type = PERF_TYPE_SOFTWARE; attr.config = PERF_COUNT_SW_CPU_CLOCK; attr.freq = 1; - attr.sample_freq = 4000; + attr.sample_freq = 1000; pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); if (!ASSERT_GE(pfd, 0, "perf_fd")) goto cleanup; |