[PATCH] libtracefs utest: Do not test kprobe interface if there's no kprobes

Steven Rostedt <[email protected]>
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

If the kernel does not support kprobes, do not bother testing the kprobe
interface.

Signed-off-by: Steven Rostedt (Google) <[email protected]>
---
 utest/tracefs-utest.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index b295253..5bfd665 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -2280,6 +2280,11 @@ static void test_kprobes_instance(struct tracefs_instance *instance)
 	int ret;
 	int i;
 
+	if (!tracefs_file_exists(NULL, "kprobe_events")) {
+		printf("[KERNEL DOES NOT HAVE KPROBE EVENTS] ...");
+		return;
+	}
+
 	tep = tep_alloc();
 	CU_TEST(tep != NULL);
 
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.