diff --git a/make/Images.gmk b/make/Images.gmk index 61a4106a006..c3a0c809475 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -247,6 +247,57 @@ ifeq ($(GCOV_ENABLED), true) endif +# SapMachine 2024-09-13: import async profiler binaries +################################################################################ +# Async profiler import +# we can reference into the workspace where we download the async profiler; +# this has to be set via configure +ifeq ($(ASYNC_PROFILER_IMPORT_ENABLED), true) +ifeq ($(call isTargetOs, linux macosx), true) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_BIN_TO_JDK, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH)/bin, \ + DEST := $(JDK_IMAGE_DIR)/bin, \ + FILES := asprof, \ +)) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_BIN_TO_JRE, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH)/bin, \ + DEST := $(JRE_IMAGE_DIR)/bin, \ + FILES := asprof, \ +)) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_LIB_TO_JDK, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH)/lib, \ + DEST := $(JDK_IMAGE_DIR)/lib, \ + FILES := async-profiler.jar converter.jar libasyncProfiler$(SHARED_LIBRARY_SUFFIX), \ +)) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_LIB_TO_JRE, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH)/lib, \ + DEST := $(JRE_IMAGE_DIR)/lib, \ + FILES := async-profiler.jar converter.jar libasyncProfiler$(SHARED_LIBRARY_SUFFIX), \ +)) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_LEGAL_TO_JDK, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH), \ + DEST := $(JDK_IMAGE_DIR)/legal/async, \ + FILES := CHANGELOG.md LICENSE README.md, \ +)) + +$(eval $(call SetupCopyFiles, COPY_ASYNC_PROFILER_LEGAL_TO_JRE, \ + SRC := $(ASYNC_PROFILER_IMPORT_PATH), \ + DEST := $(JRE_IMAGE_DIR)/legal/async, \ + FILES := CHANGELOG.md LICENSE README.md, \ +)) + + +JDK_TARGETS += $(COPY_ASYNC_PROFILER_BIN_TO_JDK) $(COPY_ASYNC_PROFILER_LIB_TO_JDK) $(COPY_ASYNC_PROFILER_LEGAL_TO_JDK) +JRE_TARGETS += $(COPY_ASYNC_PROFILER_BIN_TO_JRE) $(COPY_ASYNC_PROFILER_LIB_TO_JRE) $(COPY_ASYNC_PROFILER_LEGAL_TO_JRE) + +endif +endif + ################################################################################ # Debug symbols # Since debug symbols are not included in the jmod files, they need to be copied diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index 11c55c78930..5db54e55ce2 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -223,6 +223,21 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], fi AC_SUBST(COPYRIGHT_YEAR) + # SapMachine 2024-09-13: import async profiler binaries + AC_ARG_WITH(async-profiler-import-path, [AS_HELP_STRING([--with-async-profiler-import-path], + [Set import path for downloaded async profiler binaries])]) + if test "x$with_async_profiler_import_path" != x; then + ASYNC_PROFILER_IMPORT_PATH="$with_async_profiler_import_path" + if test -f "$ASYNC_PROFILER_IMPORT_PATH/LICENSE"; then + ASYNC_PROFILER_IMPORT_ENABLED=true + AC_MSG_NOTICE([LICENSE file exists, enabling async-profiler import]) + else + AC_MSG_ERROR([Async profiler import path was set, but LICENSE file not found there]) + fi + fi + AC_SUBST(ASYNC_PROFILER_IMPORT_PATH) + AC_SUBST(ASYNC_PROFILER_IMPORT_ENABLED) + # Override default library path AC_ARG_WITH([jni-libpath], [AS_HELP_STRING([--with-jni-libpath], [override default JNI library search path])]) diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index 15c549946b9..62b19bcd29e 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -449,6 +449,10 @@ CACERTS_SRC := @CACERTS_SRC@ # Enable unlimited crypto policy UNLIMITED_CRYPTO := @UNLIMITED_CRYPTO@ +# SapMachine 2024-09-13: import async profiler binaries +ASYNC_PROFILER_IMPORT_PATH=@ASYNC_PROFILER_IMPORT_PATH@ +ASYNC_PROFILER_IMPORT_ENABLED=@ASYNC_PROFILER_IMPORT_ENABLED@ + GCOV_ENABLED := @GCOV_ENABLED@ JCOV_ENABLED := @JCOV_ENABLED@ JCOV_HOME := @JCOV_HOME@