Skip to content

Commit

Permalink
Import async-profiler into the jdk and jre images (#1825)
Browse files Browse the repository at this point in the history
* Async-profiler import

* avoid check in configure
  • Loading branch information
MBaesken authored Sep 19, 2024
1 parent 1b29b80 commit 06f965b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
51 changes: 51 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])])
Expand Down
4 changes: 4 additions & 0 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down

0 comments on commit 06f965b

Please sign in to comment.