diff mbox series

[3/3] perf tests: Remove bpf prologue generation test

Message ID 20220123221932.537060-3-jolsa@kernel.org (mailing list archive)
State Not Applicable
Delegated to: BPF
Headers show
Series [1/3] perf/bpf: Remove prologue generation | expand

Checks

Context Check Description
bpf/vmtest-bpf-PR fail merge-conflict
netdev/tree_selection success Not a local patch

Commit Message

Jiri Olsa Jan. 23, 2022, 10:19 p.m. UTC
Removing bpf prologue generation test, because its
support was removed in previous patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/tests/Build  |  9 +-------
 tools/perf/tests/bpf.c  | 51 -----------------------------------------
 tools/perf/tests/llvm.c | 19 ---------------
 tools/perf/tests/llvm.h |  2 --
 4 files changed, 1 insertion(+), 80 deletions(-)
diff mbox series

Patch

diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index af2b37ef7c70..10a5287dbc94 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -36,7 +36,7 @@  perf-y += sample-parsing.o
 perf-y += parse-no-sample-id-all.o
 perf-y += kmod-path.o
 perf-y += thread-map.o
-perf-y += llvm.o llvm-src-base.o llvm-src-kbuild.o llvm-src-prologue.o llvm-src-relocation.o
+perf-y += llvm.o llvm-src-base.o llvm-src-kbuild.o llvm-src-relocation.o
 perf-y += bpf.o
 perf-y += topology.o
 perf-y += mem.o
@@ -81,13 +81,6 @@  $(OUTPUT)tests/llvm-src-kbuild.c: tests/bpf-script-test-kbuild.c tests/Build
 	$(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
 	$(Q)echo ';' >> $@
 
-$(OUTPUT)tests/llvm-src-prologue.c: tests/bpf-script-test-prologue.c tests/Build
-	$(call rule_mkdir)
-	$(Q)echo '#include <tests/llvm.h>' > $@
-	$(Q)echo 'const char test_llvm__bpf_test_prologue_prog[] =' >> $@
-	$(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
-	$(Q)echo ';' >> $@
-
 $(OUTPUT)tests/llvm-src-relocation.c: tests/bpf-script-test-relocation.c tests/Build
 	$(call rule_mkdir)
 	$(Q)echo '#include <tests/llvm.h>' > $@
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 573490530194..c7ade2debbbf 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -37,29 +37,6 @@  static int epoll_pwait_loop(void)
 	return 0;
 }
 
-#ifdef HAVE_BPF_PROLOGUE
-
-static int llseek_loop(void)
-{
-	int fds[2], i;
-
-	fds[0] = open("/dev/null", O_RDONLY);
-	fds[1] = open("/dev/null", O_RDWR);
-
-	if (fds[0] < 0 || fds[1] < 0)
-		return -1;
-
-	for (i = 0; i < NR_ITERS; i++) {
-		lseek(fds[i % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET);
-		lseek(fds[(i + 1) % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET);
-	}
-	close(fds[0]);
-	close(fds[1]);
-	return 0;
-}
-
-#endif
-
 static struct {
 	enum test_llvm__testcase prog_id;
 	const char *name;
@@ -86,16 +63,6 @@  static struct {
 		.expect_result	  = (NR_ITERS + 1) / 2,
 		.pin		  = true,
 	},
-#ifdef HAVE_BPF_PROLOGUE
-	{
-		.prog_id	  = LLVM_TESTCASE_BPF_PROLOGUE,
-		.name		  = "[bpf_prologue_test]",
-		.msg_compile_fail = "fix kbuild first",
-		.msg_load_fail	  = "check your vmlinux setting?",
-		.target_func	  = &llseek_loop,
-		.expect_result	  = (NR_ITERS + 1) / 4,
-	},
-#endif
 };
 
 static int do_test(struct bpf_object *obj, int (*func)(void),
@@ -355,31 +322,13 @@  static int test__bpf_pinning(struct test_suite *test __maybe_unused,
 #endif
 }
 
-static int test__bpf_prologue_test(struct test_suite *test __maybe_unused,
-				   int subtest __maybe_unused)
-{
-#if defined(HAVE_LIBBPF_SUPPORT) && defined(HAVE_BPF_PROLOGUE)
-	return test__bpf(2);
-#else
-	pr_debug("Skip BPF test because BPF support is not compiled\n");
-	return TEST_SKIP;
-#endif
-}
-
-
 static struct test_case bpf_tests[] = {
 #ifdef HAVE_LIBBPF_SUPPORT
 	TEST_CASE("Basic BPF filtering", basic_bpf_test),
 	TEST_CASE("BPF pinning", bpf_pinning),
-#ifdef HAVE_BPF_PROLOGUE
-	TEST_CASE("BPF prologue generation", bpf_prologue_test),
-#else
-	TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test, "not compiled in"),
-#endif
 #else
 	TEST_CASE_REASON("Basic BPF filtering", basic_bpf_test, "not compiled in"),
 	TEST_CASE_REASON("BPF pinning", bpf_pinning, "not compiled in"),
-	TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test, "not compiled in"),
 #endif
 	{ .name = NULL, }
 };
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c
index 8ac0a3a457ef..b57f24185dda 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -33,10 +33,6 @@  static struct {
 		.source = test_llvm__bpf_test_kbuild_prog,
 		.desc = "kbuild searching",
 	},
-	[LLVM_TESTCASE_BPF_PROLOGUE] = {
-		.source = test_llvm__bpf_test_prologue_prog,
-		.desc = "Compile source for BPF prologue generation",
-	},
 	[LLVM_TESTCASE_BPF_RELOCATION] = {
 		.source = test_llvm__bpf_test_relocation,
 		.desc = "Compile source for BPF relocation",
@@ -172,17 +168,6 @@  static int test__llvm__bpf_test_kbuild_prog(struct test_suite *test __maybe_unus
 #endif
 }
 
-static int test__llvm__bpf_test_prologue_prog(struct test_suite *test __maybe_unused,
-					      int subtest __maybe_unused)
-{
-#ifdef HAVE_LIBBPF_SUPPORT
-	return test__llvm(LLVM_TESTCASE_BPF_PROLOGUE);
-#else
-	pr_debug("Skip LLVM test because BPF support is not compiled\n");
-	return TEST_SKIP;
-#endif
-}
-
 static int test__llvm__bpf_test_relocation(struct test_suite *test __maybe_unused,
 					   int subtest __maybe_unused)
 {
@@ -199,14 +184,10 @@  static struct test_case llvm_tests[] = {
 #ifdef HAVE_LIBBPF_SUPPORT
 	TEST_CASE("Basic BPF llvm compile", llvm__bpf_base_prog),
 	TEST_CASE("kbuild searching", llvm__bpf_test_kbuild_prog),
-	TEST_CASE("Compile source for BPF prologue generation",
-		  llvm__bpf_test_prologue_prog),
 	TEST_CASE("Compile source for BPF relocation", llvm__bpf_test_relocation),
 #else
 	TEST_CASE_REASON("Basic BPF llvm compile", llvm__bpf_base_prog, "not compiled in"),
 	TEST_CASE_REASON("kbuild searching", llvm__bpf_test_kbuild_prog, "not compiled in"),
-	TEST_CASE_REASON("Compile source for BPF prologue generation",
-			llvm__bpf_test_prologue_prog, "not compiled in"),
 	TEST_CASE_REASON("Compile source for BPF relocation",
 			llvm__bpf_test_relocation, "not compiled in"),
 #endif
diff --git a/tools/perf/tests/llvm.h b/tools/perf/tests/llvm.h
index f68b0d9b8ae2..8e1c4352b1cc 100644
--- a/tools/perf/tests/llvm.h
+++ b/tools/perf/tests/llvm.h
@@ -11,13 +11,11 @@  extern "C" {
 
 extern const char test_llvm__bpf_base_prog[];
 extern const char test_llvm__bpf_test_kbuild_prog[];
-extern const char test_llvm__bpf_test_prologue_prog[];
 extern const char test_llvm__bpf_test_relocation[];
 
 enum test_llvm__testcase {
 	LLVM_TESTCASE_BASE,
 	LLVM_TESTCASE_KBUILD,
-	LLVM_TESTCASE_BPF_PROLOGUE,
 	LLVM_TESTCASE_BPF_RELOCATION,
 	__LLVM_TESTCASE_MAX,
 };