VMs running on latest kernel support LBR. However, bpf_get_branch_snapshot
couldn't stop the LBR before too many entries are flushed. Skip the test
for VMs before we find a proper fix for VMs.
Read the "flags" line from /proc/cpuinfo, if it contains "hypervisor",
skip test get_branch_snapshot.
Fixes: 025bd7c753aa (selftests/bpf: Add test for bpf_get_branch_snapshot)
Signed-off-by: Song Liu <redacted>
---
.../bpf/prog_tests/get_branch_snapshot.c | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -54,6 +78,14 @@ void test_get_branch_snapshot(void)structget_branch_snapshot*skel=NULL;interr;+if(is_hypervisor()){+/* As of today, LBR in hypervisor cannot be stopped before+*toomanyentriesareflushed.Skipthetestfornowin+*hypervisoruntilweoptimizetheLBRinhypervisor.+*/+test__skip();+return;+}if(create_perf_events()){test__skip();/* system doesn't support LBR */gotocleanup;
From: Song Liu <song@kernel.org> Date: 2021-10-06 20:39:02
On Wed, Oct 6, 2021 at 1:32 PM Song Liu [off-list ref] wrote:
VMs running on latest kernel support LBR. However, bpf_get_branch_snapshot
couldn't stop the LBR before too many entries are flushed. Skip the test
for VMs before we find a proper fix for VMs.
Read the "flags" line from /proc/cpuinfo, if it contains "hypervisor",
skip test get_branch_snapshot.
Forgot to use --subject-prefix. This applies to bpf-next.
Thanks,
Song
quoted hunk
Fixes: 025bd7c753aa (selftests/bpf: Add test for bpf_get_branch_snapshot)
Signed-off-by: Song Liu <redacted>
---
.../bpf/prog_tests/get_branch_snapshot.c | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -54,6 +78,14 @@ void test_get_branch_snapshot(void)structget_branch_snapshot*skel=NULL;interr;+if(is_hypervisor()){+/* As of today, LBR in hypervisor cannot be stopped before+*toomanyentriesareflushed.Skipthetestfornowin+*hypervisoruntilweoptimizetheLBRinhypervisor.+*/+test__skip();+return;+}if(create_perf_events()){test__skip();/* system doesn't support LBR */gotocleanup;--
On Wed, Oct 6, 2021 at 1:31 PM Song Liu [off-list ref] wrote:
VMs running on latest kernel support LBR. However, bpf_get_branch_snapshot
couldn't stop the LBR before too many entries are flushed. Skip the test
for VMs before we find a proper fix for VMs.
Read the "flags" line from /proc/cpuinfo, if it contains "hypervisor",
skip test get_branch_snapshot.
Fixes: 025bd7c753aa (selftests/bpf: Add test for bpf_get_branch_snapshot)
missing quotes?
quoted hunk
Signed-off-by: Song Liu <redacted>
---
.../bpf/prog_tests/get_branch_snapshot.c | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -54,6 +78,14 @@ void test_get_branch_snapshot(void) struct get_branch_snapshot *skel = NULL; int err;+ if (is_hypervisor()) {+ /* As of today, LBR in hypervisor cannot be stopped before+ * too many entries are flushed. Skip the test for now in+ * hypervisor until we optimize the LBR in hypervisor.+ */+ test__skip();+ return;+ } if (create_perf_events()) { test__skip(); /* system doesn't support LBR */ goto cleanup;--
From: Song Liu <song@kernel.org> Date: 2021-10-07 00:35:43
On Wed, Oct 6, 2021 at 2:36 PM Andrii Nakryiko
[off-list ref] wrote:
On Wed, Oct 6, 2021 at 1:31 PM Song Liu [off-list ref] wrote:
quoted
VMs running on latest kernel support LBR. However, bpf_get_branch_snapshot
couldn't stop the LBR before too many entries are flushed. Skip the test
for VMs before we find a proper fix for VMs.
Read the "flags" line from /proc/cpuinfo, if it contains "hypervisor",
skip test get_branch_snapshot.
Fixes: 025bd7c753aa (selftests/bpf: Add test for bpf_get_branch_snapshot)
missing quotes?
Aha, I copied this line from e31eec77e4ab90dcec7d2da93415f839098dc287. Will fix.
quoted
Signed-off-by: Song Liu <redacted>
---
.../bpf/prog_tests/get_branch_snapshot.c | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -54,6 +78,14 @@ void test_get_branch_snapshot(void) struct get_branch_snapshot *skel = NULL; int err;+ if (is_hypervisor()) {+ /* As of today, LBR in hypervisor cannot be stopped before+ * too many entries are flushed. Skip the test for now in+ * hypervisor until we optimize the LBR in hypervisor.+ */+ test__skip();+ return;+ } if (create_perf_events()) { test__skip(); /* system doesn't support LBR */ goto cleanup;--