selftests/bpf: update send_signal to lower perf evemts frequency
authorEduard Zingerman <eddyz87@gmail.com>
Tue, 12 Nov 2024 11:09:06 +0000 (03:09 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 12 Nov 2024 21:53:27 +0000 (13:53 -0800)
Similar to commit [1] sample perf events less often in
test_send_signal_nmi(). This should reduce perf events throttling.

[1] 7015843afcaf ("selftests/bpf: Fix send_signal test with nested CONFIG_PARAVIRT")

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20241112110906.3045278-5-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/send_signal.c

index 4e03d7a..1702aa5 100644 (file)
@@ -229,7 +229,8 @@ static void test_send_signal_perf(bool signal_thread, bool remote)
 static void test_send_signal_nmi(bool signal_thread, bool remote)
 {
        struct perf_event_attr attr = {
-               .sample_period = 1,
+               .freq = 1,
+               .sample_freq = 1000,
                .type = PERF_TYPE_HARDWARE,
                .config = PERF_COUNT_HW_CPU_CYCLES,
        };