aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
diff options
context:
space:
mode:
authorSong Liu <[email protected]>2024-06-04 07:07:00 +0000
committerAndrii Nakryiko <[email protected]>2024-06-04 18:17:54 +0000
commit61ce0ea7591fef2eb6e89ce40ffcc24fda4dbbc5 (patch)
tree09649074f6ebde1305acef37c57614fa3b0e9d0d /tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
parentMerge branch 'enable-bpf-programs-to-declare-arrays-of-kptr-bpf_rb_root-and-b... (diff)
downloadkernel-61ce0ea7591fef2eb6e89ce40ffcc24fda4dbbc5.tar.gz
kernel-61ce0ea7591fef2eb6e89ce40ffcc24fda4dbbc5.zip
selftests/bpf: Fix bpf_cookie and find_vma in nested VM
bpf_cookie and find_vma are flaky in nested VMs, which is used by some CI systems. It turns out these failures are caused by unreliable perf event in nested VM. Fix these by: 1. Use PERF_COUNT_SW_CPU_CLOCK in find_vma; 2. Increase sample_freq in bpf_cookie. Signed-off-by: Song Liu <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_cookie.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/bpf_cookie.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c b/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
index 4407ea428e77..070c52c312e5 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
@@ -451,7 +451,7 @@ static void pe_subtest(struct test_bpf_cookie *skel)
attr.type = PERF_TYPE_SOFTWARE;
attr.config = PERF_COUNT_SW_CPU_CLOCK;
attr.freq = 1;
- attr.sample_freq = 1000;
+ attr.sample_freq = 10000;
pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC);
if (!ASSERT_GE(pfd, 0, "perf_fd"))
goto cleanup;