Blob Blame History Raw
From: Song Liu <songliubraving@fb.com>
Date: Mon, 25 Oct 2021 17:07:33 -0700
Subject: selftests/bpf: Skip all serial_test_get_branch_snapshot in vm
Patch-mainline: v5.16-rc1
Git-commit: b4e87072762d063f9c20ba0ab2120e1910fa379f
References: jsc#PED-1377

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 <songliubraving@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211026000733.477714-1-songliubraving@fb.com
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c |   16 ++++-------
 1 file changed, 6 insertions(+), 10 deletions(-)

--- a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
+++ b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
@@ -78,6 +78,12 @@ void serial_test_get_branch_snapshot(voi
 	struct get_branch_snapshot *skel = NULL;
 	int err;
 
+	/* 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 */
 		goto cleanup;
@@ -106,16 +112,6 @@ void serial_test_get_branch_snapshot(voi
 		test__skip();
 		goto cleanup;
 	}
-
-	if (is_hypervisor()) {
-		/* As of today, LBR in hypervisor cannot be stopped before
-		 * too many entries are flushed. Skip the hit/waste test
-		 * for now in hypervisor until we optimize the LBR in
-		 * hypervisor.
-		 */
-		test__skip();
-		goto cleanup;
-	}
 
 	ASSERT_GT(skel->bss->test1_hits, 6, "find_looptest_in_lbr");