From 4c7d90e203825eeb2e23efebeadfc1ab847a94bc Mon Sep 17 00:00:00 2001 From: Tobi Ajila Date: Tue, 19 Mar 2024 15:49:25 -0400 Subject: [PATCH] Add JFR flags Signed-off-by: Tobi Ajila --- closed/OpenJ9.gmk | 15 +++++++++++- closed/autoconf/custom-hook.m4 | 37 ++++++++++++++++++++++++++---- closed/autoconf/custom-spec.gmk.in | 3 ++- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 61d067cd6ad..050dc8f7739 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -280,6 +280,13 @@ else FEATURE_SED_SCRIPT += $(call SedDisable,opt_jitserver) endif +# Adjust JFR enablement flags. +ifeq (true,$(OPENJ9_ENABLE_JFR)) + FEATURE_SED_SCRIPT += $(call SedEnable,opt_jfr) +else + FEATURE_SED_SCRIPT += $(call SedDisable,opt_jfr) +endif + # Adjust Inline-Types enablement flags. ifeq (true,$(OPENJ9_ENABLE_INLINE_TYPES)) SPEC_SED_SCRIPT += $(call SedEnable,opt_valhallaValueTypes) @@ -462,13 +469,19 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE)) else # OPENJ9_ENABLE_INLINE_TYPES CMAKE_ARGS += -DJ9VM_OPT_VALHALLA_VALUE_TYPES=OFF endif # OPENJ9_ENABLE_INLINE_TYPES - + ifeq (true,$(OPENJ9_ENABLE_CRAC_SUPPORT)) CMAKE_ARGS += -DJ9VM_OPT_CRAC_SUPPORT=ON else # OPENJ9_ENABLE_CRAC_SUPPORT CMAKE_ARGS += -DJ9VM_OPT_CRAC_SUPPORT=OFF endif # OPENJ9_ENABLE_CRAC_SUPPORT + ifeq (true,$(OPENJ9_ENABLE_JFR)) + CMAKE_ARGS += -DJ9VM_OPT_JFR=ON + else # OPENJ9_ENABLE_JFR + CMAKE_ARGS += -DJ9VM_OPT_JFR=OFF + endif # OPENJ9_ENABLE_JFR + ifeq (true,$(OPENJ9_ENABLE_CRIU_SUPPORT)) CMAKE_ARGS += -DJ9VM_OPT_CRIU_SUPPORT=ON else # OPENJ9_ENABLE_CRIU_SUPPORT diff --git a/closed/autoconf/custom-hook.m4 b/closed/autoconf/custom-hook.m4 index 059cdfd4ef0..d8b18c012fe 100644 --- a/closed/autoconf/custom-hook.m4 +++ b/closed/autoconf/custom-hook.m4 @@ -46,14 +46,15 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], OPENJ9_CONFIGURE_CUDA OPENJ9_CONFIGURE_DDR OPENJ9_CONFIGURE_DEMOS - OPENJ9_CONFIGURE_HEALTHCENTER - OPENJ9_CONFIGURE_NUMA - OPENJ9_CONFIGURE_WARNINGS + OPENJ9_CONFIGURE_JFR OPENJ9_CONFIGURE_JITSERVER + OPENJ9_CONFIGURE_HEALTHCENTER OPENJ9_CONFIGURE_INLINE_TYPES - OPENJ9_THIRD_PARTY_REQUIREMENTS OPENJ9_CHECK_NASM_VERSION + OPENJ9_CONFIGURE_NUMA + OPENJ9_THIRD_PARTY_REQUIREMENTS OPENJCEPLUS_SETUP + OPENJ9_CONFIGURE_WARNINGS ]) AC_DEFUN([OPENJ9_CONFIGURE_CMAKE], @@ -445,6 +446,34 @@ AC_DEFUN([OPENJ9_CONFIGURE_JITSERVER], AC_SUBST(OPENJ9_ENABLE_JITSERVER) ]) +AC_DEFUN([OPENJ9_CONFIGURE_JFR], +[ + AC_ARG_ENABLE([jfr], [AS_HELP_STRING([--enable-jfr], [enable JFR support @<:@disabled@:>@])]) + + AC_MSG_CHECKING([for jfr]) + OPENJ9_ENABLE_JITSERVER=false + if test "x$enable_jfr" = xyes ; then + AC_MSG_RESULT([yes (explicitly enabled)]) + OPENJ9_ENABLE_JFR=true + elif test "x$enable_jfr" = xno ; then + AC_MSG_RESULT([no (explicitly disabled)]) + elif test "x$enable_jfr" = x ; then + case "$OPENJ9_PLATFORM_CODE" in + xa64) + AC_MSG_RESULT([yes (default)]) + OPENJ9_ENABLE_JFR=true + ;; + *) + AC_MSG_RESULT([no (default)]) + ;; + esac + else + AC_MSG_ERROR([--enable-jfr accepts no argument]) + fi + + AC_SUBST(OPENJ9_ENABLE_JFR) +]) + AC_DEFUN([OPENJ9_CONFIGURE_CONTINUATION_PROFILE], [ AC_MSG_CHECKING([for Continuation profiling]) diff --git a/closed/autoconf/custom-spec.gmk.in b/closed/autoconf/custom-spec.gmk.in index cd8bdd1ff6a..d40132c845f 100644 --- a/closed/autoconf/custom-spec.gmk.in +++ b/closed/autoconf/custom-spec.gmk.in @@ -74,8 +74,9 @@ OPENJ9_ENABLE_CRAC_SUPPORT := @OPENJ9_ENABLE_CRAC_SUPPORT@ OPENJ9_ENABLE_CRIU_SUPPORT := @OPENJ9_ENABLE_CRIU_SUPPORT@ OPENJ9_ENABLE_DDR := @OPENJ9_ENABLE_DDR@ OPENJ9_ENABLE_DEMOS := @OPENJ9_ENABLE_DEMOS@ -OPENJ9_ENABLE_INLINE_TYPES := @OPENJ9_ENABLE_INLINE_TYPES@ +OPENJ9_ENABLE_JFR := @OPENJ9_ENABLE_JFR@ OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@ +OPENJ9_ENABLE_INLINE_TYPES := @OPENJ9_ENABLE_INLINE_TYPES@ # for constructing version output COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@