Skip to content

Commit

Permalink
selftests/bpf: Skip all serial_test_get_branch_snapshot in vm
Browse files Browse the repository at this point in the history
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: 025bd7c ("selftests/bpf: Add test for bpf_get_branch_snapshot")
Fixes: aa67fdb ("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
  • Loading branch information
liu-song-6 authored and anakryiko committed Oct 26, 2021
1 parent e02daf4 commit b4e8707
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b4e8707

Please sign in to comment.