linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] tools/build: Add a feature test for libopenssl
@ 2025-12-03 23:29 Namhyung Kim
  2025-12-03 23:29 ` [PATCH 2/2] perf tools: Disable BPF skeleton if no libopenssl found Namhyung Kim
  2025-12-04  0:34 ` [PATCH 1/2] tools/build: Add a feature test for libopenssl Ian Rogers
  0 siblings, 2 replies; 9+ messages in thread
From: Namhyung Kim @ 2025-12-03 23:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, James Clark
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, bpf

It's used by bpftool and the kernel build.  Let's add a feature test so
that perf can decide what to do based on the availability.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/build/Makefile.feature          | 6 ++++--
 tools/build/feature/Makefile          | 8 ++++++--
 tools/build/feature/test-all.c        | 5 +++++
 tools/build/feature/test-libopenssl.c | 7 +++++++
 4 files changed, 22 insertions(+), 4 deletions(-)
 create mode 100644 tools/build/feature/test-libopenssl.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index fc6abe369f7373c5..bc6d85bad379321b 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -99,7 +99,8 @@ FEATURE_TESTS_BASIC :=                  \
         libzstd				\
         disassembler-four-args		\
         disassembler-init-styled	\
-        file-handle
+        file-handle			\
+        libopenssl
 
 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
 # of all feature tests
@@ -147,7 +148,8 @@ FEATURE_DISPLAY ?=              \
          lzma                   \
          bpf			\
          libaio			\
-         libzstd
+         libzstd		\
+         libopenssl
 
 #
 # Declare group members of a feature to display the logical OR of the detection
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 7c90e0d0157ac9b1..3fd5ad0db2109778 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -67,12 +67,13 @@ FILES=                                          \
          test-libopencsd.bin			\
          test-clang.bin				\
          test-llvm.bin				\
-         test-llvm-perf.bin   \
+         test-llvm-perf.bin   			\
          test-libaio.bin			\
          test-libzstd.bin			\
          test-clang-bpf-co-re.bin		\
          test-file-handle.bin			\
-         test-libpfm4.bin
+         test-libpfm4.bin			\
+         test-libopenssl.bin
 
 FILES := $(addprefix $(OUTPUT),$(FILES))
 
@@ -381,6 +382,9 @@ endif
 $(OUTPUT)test-libpfm4.bin:
 	$(BUILD) -lpfm
 
+$(OUTPUT)test-libopenssl.bin:
+	$(BUILD) -lssl
+
 $(OUTPUT)test-bpftool-skeletons.bin:
 	$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
 		> $(@:.bin=.make.output) 2>&1
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index eb346160d0ba0e2f..1488bf6e607836e5 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -142,6 +142,10 @@
 # include "test-libtraceevent.c"
 #undef main
 
+#define main main_test_libopenssl
+# include "test-libopenssl.c"
+#undef main
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -173,6 +177,7 @@ int main(int argc, char *argv[])
 	main_test_reallocarray();
 	main_test_libzstd();
 	main_test_libtraceevent();
+	main_test_libopenssl();
 
 	return 0;
 }
diff --git a/tools/build/feature/test-libopenssl.c b/tools/build/feature/test-libopenssl.c
new file mode 100644
index 0000000000000000..168c45894e8be687
--- /dev/null
+++ b/tools/build/feature/test-libopenssl.c
@@ -0,0 +1,7 @@
+#include <openssl/ssl.h>
+#include <openssl/opensslv.h>
+
+int main(void)
+{
+	return SSL_library_init();
+}
-- 
2.52.0.177.g9f829587af-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-12-16  6:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 23:29 [PATCH 1/2] tools/build: Add a feature test for libopenssl Namhyung Kim
2025-12-03 23:29 ` [PATCH 2/2] perf tools: Disable BPF skeleton if no libopenssl found Namhyung Kim
2025-12-04  0:34 ` [PATCH 1/2] tools/build: Add a feature test for libopenssl Ian Rogers
2025-12-04  7:52   ` Namhyung Kim
2025-12-04 16:16   ` Arnaldo Carvalho de Melo
2025-12-04 23:52     ` Namhyung Kim
2025-12-05  6:27       ` Ian Rogers
2025-12-05 10:28         ` Quentin Monnet
2025-12-16  6:19           ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).