diff mbox series

[bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm

Message ID 20211026000733.477714-1-songliubraving@fb.com (mailing list archive)
State Accepted
Delegated to: BPF
Headers show
Series [bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next success VM_Test
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 7 maintainers not CCed: john.fastabend@gmail.com linux-kselftest@vger.kernel.org yhs@fb.com memxor@gmail.com kafai@fb.com kpsingh@kernel.org shuah@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Song Liu Oct. 26, 2021, 12:07 a.m. UTC
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>
---
 .../bpf/prog_tests/get_branch_snapshot.c         | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

Comments

Andrii Nakryiko Oct. 26, 2021, 3:45 a.m. UTC | #1
On Mon, Oct 25, 2021 at 5:07 PM Song Liu <songliubraving@fb.com> 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 <songliubraving@fb.com>
> ---

Applied to bpf-next, thanks for the fix!

>  .../bpf/prog_tests/get_branch_snapshot.c         | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
> index d6d70a359aeb5..81402e4439844 100644
> --- 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(void)
>         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;
> @@ -107,16 +113,6 @@ void serial_test_get_branch_snapshot(void)
>                 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");
>
>         /* Given we stop LBR in software, we will waste a few entries.
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
index d6d70a359aeb5..81402e4439844 100644
--- 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(void)
 	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;
@@ -107,16 +113,6 @@  void serial_test_get_branch_snapshot(void)
 		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");
 
 	/* Given we stop LBR in software, we will waste a few entries.