Skipping the second half of the test is not enough to silent the warning
in dmesg. Skip the whole test before we can either properly silent the
warning in kernel, or fix LBR snapshot for VM.
Fixes: 025bd7c753aa ("selftests/bpf: Add test for bpf_get_branch_snapshot")
Fixes: aa67fdb46436 ("selftests/bpf: Skip the second half of get_branch_snapshot in vm")
Signed-off-by: Song Liu <redacted>
---
.../bpf/prog_tests/get_branch_snapshot.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
@@ -78,6 +78,12 @@ void serial_test_get_branch_snapshot(void)structget_branch_snapshot*skel=NULL;interr;+/* Skip the test before we fix LBR snapshot for hypervisor. */+if(is_hypervisor()){+test__skip();+return;+}+if(create_perf_events()){test__skip();/* system doesn't support LBR */gotocleanup;
@@ -107,16 +113,6 @@ void serial_test_get_branch_snapshot(void)gotocleanup;}-if(is_hypervisor()){-/* As of today, LBR in hypervisor cannot be stopped before-*toomanyentriesareflushed.Skipthehit/wastetest-*fornowinhypervisoruntilweoptimizetheLBRin-*hypervisor.-*/-test__skip();-gotocleanup;-}-ASSERT_GT(skel->bss->test1_hits,6,"find_looptest_in_lbr");/* Given we stop LBR in software, we will waste a few entries.
On Mon, Oct 25, 2021 at 5:07 PM Song Liu [off-list ref] wrote:
Skipping the second half of the test is not enough to silent the warning
in dmesg. Skip the whole test before we can either properly silent the
warning in kernel, or fix LBR snapshot for VM.
Fixes: 025bd7c753aa ("selftests/bpf: Add test for bpf_get_branch_snapshot")
Fixes: aa67fdb46436 ("selftests/bpf: Skip the second half of get_branch_snapshot in vm")
Signed-off-by: Song Liu <redacted>
---
@@ -78,6 +78,12 @@ void serial_test_get_branch_snapshot(void)structget_branch_snapshot*skel=NULL;interr;+/* Skip the test before we fix LBR snapshot for hypervisor. */+if(is_hypervisor()){+test__skip();+return;+}+if(create_perf_events()){test__skip();/* system doesn't support LBR */gotocleanup;
@@ -107,16 +113,6 @@ void serial_test_get_branch_snapshot(void)gotocleanup;}-if(is_hypervisor()){-/* As of today, LBR in hypervisor cannot be stopped before-*toomanyentriesareflushed.Skipthehit/wastetest-*fornowinhypervisoruntilweoptimizetheLBRin-*hypervisor.-*/-test__skip();-gotocleanup;-}-ASSERT_GT(skel->bss->test1_hits,6,"find_looptest_in_lbr");/* Given we stop LBR in software, we will waste a few entries.--