8139986: Store debug level in java.vm.debug and conditionally print in "java -version"
Reviewed-by: ihse, dcubed, ksrini, dholmes
This commit is contained in:
parent
8fe1b0faab
commit
c573c1777e
@ -81,6 +81,7 @@ JDK_VER_DEFS = -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
|||||||
-DVERSION_BUILD=$(VERSION_BUILD)
|
-DVERSION_BUILD=$(VERSION_BUILD)
|
||||||
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
||||||
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
||||||
|
-DDEBUG_LEVEL="\"$(DEBUG_LEVEL)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
|
@ -80,6 +80,7 @@ JDK_VER_DEFS = -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
|||||||
-DVERSION_BUILD=$(VERSION_BUILD)
|
-DVERSION_BUILD=$(VERSION_BUILD)
|
||||||
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
||||||
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
||||||
|
-DDEBUG_LEVEL="\"$(DEBUG_LEVEL)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
|
@ -82,6 +82,7 @@ JDK_VER_DEFS = -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
|||||||
-DVERSION_BUILD=$(VERSION_BUILD)
|
-DVERSION_BUILD=$(VERSION_BUILD)
|
||||||
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
||||||
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
||||||
|
-DDEBUG_LEVEL="\"$(DEBUG_LEVEL)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
|
@ -76,6 +76,7 @@ JDK_VER_DEFS = -DVERSION_MAJOR=$(VERSION_MAJOR) \
|
|||||||
-DVERSION_BUILD=$(VERSION_BUILD)
|
-DVERSION_BUILD=$(VERSION_BUILD)
|
||||||
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
VM_VER_DEFS = -DHOTSPOT_VERSION_STRING="\"$(HOTSPOT_VERSION_STRING)\"" \
|
||||||
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
-DVERSION_STRING="\"$(VERSION_STRING)\"" \
|
||||||
|
-DDEBUG_LEVEL="\"$(DEBUG_LEVEL)\"" \
|
||||||
$(JDK_VER_DEFS)
|
$(JDK_VER_DEFS)
|
||||||
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
|
||||||
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
|
||||||
|
@ -184,6 +184,7 @@ MAKE_ARGS += VERSION_MINOR=$(VERSION_MINOR)
|
|||||||
MAKE_ARGS += VERSION_SECURITY=$(VERSION_SECURITY)
|
MAKE_ARGS += VERSION_SECURITY=$(VERSION_SECURITY)
|
||||||
MAKE_ARGS += VERSION_PATCH=$(VERSION_PATCH)
|
MAKE_ARGS += VERSION_PATCH=$(VERSION_PATCH)
|
||||||
MAKE_ARGS += VERSION_BUILD=$(VERSION_BUILD)
|
MAKE_ARGS += VERSION_BUILD=$(VERSION_BUILD)
|
||||||
|
MAKE_ARGS += DEBUG_LEVEL=$(DEBUG_LEVEL)
|
||||||
|
|
||||||
# JDK_DOTVER and JDK_VER are needed in Windows RC files
|
# JDK_DOTVER and JDK_VER are needed in Windows RC files
|
||||||
COMMA:=,
|
COMMA:=,
|
||||||
|
@ -65,6 +65,7 @@ CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_SECURITY=$(VERSION_SECURITY)"
|
|||||||
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_PATCH=$(VERSION_PATCH)"
|
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_PATCH=$(VERSION_PATCH)"
|
||||||
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_BUILD=$(VERSION_BUILD)"
|
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_BUILD=$(VERSION_BUILD)"
|
||||||
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_STRING=\"$(VERSION_STRING)\""
|
CXX_FLAGS=$(CXX_FLAGS) /D "VERSION_STRING=\"$(VERSION_STRING)\""
|
||||||
|
CXX_FLAGS=$(CXX_FLAGS) /D "DEBUG_LEVEL=\"$(DEBUG_LEVEL)\""
|
||||||
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(HOTSPOT_LIB_ARCH)\""
|
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(HOTSPOT_LIB_ARCH)\""
|
||||||
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
|
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
|
||||||
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
|
CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
|
||||||
|
@ -115,7 +115,7 @@ VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER)
|
|||||||
VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER)
|
VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER)
|
||||||
VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER)
|
VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER)
|
||||||
|
|
||||||
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define VERSION_MAJOR=$(VERSION_MAJOR) -define VERSION_MINOR=$(VERSION_MINOR) -define VERSION_SECURITY=$(VERSION_SECURITY) -define VERSION_PATCH=$(VERSION_PATCH) -define VISUAL_STUDIO_BUILD=true
|
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define VERSION_MAJOR=$(VERSION_MAJOR) -define VERSION_MINOR=$(VERSION_MINOR) -define VERSION_SECURITY=$(VERSION_SECURITY) -define VERSION_PATCH=$(VERSION_PATCH) -define DEBUG_LEVEL=$(DEBUG_LEVEL) -define VISUAL_STUDIO_BUILD=true
|
||||||
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
||||||
|
|
||||||
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
||||||
|
@ -197,6 +197,7 @@ void Arguments::init_system_properties() {
|
|||||||
PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(), false));
|
PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(), false));
|
||||||
PropertyList_add(&_system_properties, new SystemProperty("java.vm.name", VM_Version::vm_name(), false));
|
PropertyList_add(&_system_properties, new SystemProperty("java.vm.name", VM_Version::vm_name(), false));
|
||||||
PropertyList_add(&_system_properties, new SystemProperty("java.vm.info", VM_Version::vm_info_string(), true));
|
PropertyList_add(&_system_properties, new SystemProperty("java.vm.info", VM_Version::vm_info_string(), true));
|
||||||
|
PropertyList_add(&_system_properties, new SystemProperty("jdk.debug", VM_Version::jdk_debug_level(), false));
|
||||||
|
|
||||||
// Following are JVMTI agent writable properties.
|
// Following are JVMTI agent writable properties.
|
||||||
// Properties values are set to NULL and they are
|
// Properties values are set to NULL and they are
|
||||||
|
@ -223,6 +223,7 @@ static const char* property_counters_ss[] = {
|
|||||||
"java.vm.name",
|
"java.vm.name",
|
||||||
"java.vm.vendor",
|
"java.vm.vendor",
|
||||||
"java.vm.info",
|
"java.vm.info",
|
||||||
|
"jdk.debug",
|
||||||
"java.library.path",
|
"java.library.path",
|
||||||
"java.class.path",
|
"java.class.path",
|
||||||
"java.version",
|
"java.version",
|
||||||
|
@ -64,6 +64,10 @@ int Abstract_VM_Version::_reserve_for_allocation_prefetch = 0;
|
|||||||
#error VERSION_STRING must be defined
|
#error VERSION_STRING must be defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef DEBUG_LEVEL
|
||||||
|
#error DEBUG_LEVEL must be defined
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOTE: Builds within Visual Studio do not define the build target in
|
// NOTE: Builds within Visual Studio do not define the build target in
|
||||||
// HOTSPOT_VERSION_STRING, so it must be done here
|
// HOTSPOT_VERSION_STRING, so it must be done here
|
||||||
#if defined(VISUAL_STUDIO_BUILD) && !defined(PRODUCT)
|
#if defined(VISUAL_STUDIO_BUILD) && !defined(PRODUCT)
|
||||||
@ -243,6 +247,10 @@ const char *Abstract_VM_Version::vm_build_user() {
|
|||||||
return HOTSPOT_BUILD_USER;
|
return HOTSPOT_BUILD_USER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *Abstract_VM_Version::jdk_debug_level() {
|
||||||
|
return DEBUG_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int Abstract_VM_Version::jvm_version() {
|
unsigned int Abstract_VM_Version::jvm_version() {
|
||||||
return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
|
return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
|
||||||
((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
|
((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
|
||||||
|
@ -87,6 +87,7 @@ class Abstract_VM_Version: AllStatic {
|
|||||||
// Internal version providing additional build information
|
// Internal version providing additional build information
|
||||||
static const char* internal_vm_info_string();
|
static const char* internal_vm_info_string();
|
||||||
static const char* jre_release_version();
|
static const char* jre_release_version();
|
||||||
|
static const char* jdk_debug_level();
|
||||||
|
|
||||||
// does HW support an 8-byte compare-exchange operation?
|
// does HW support an 8-byte compare-exchange operation?
|
||||||
static bool supports_cx8() {
|
static bool supports_cx8() {
|
||||||
|
@ -29,7 +29,7 @@ public class Platform {
|
|||||||
private static final String osName = System.getProperty("os.name");
|
private static final String osName = System.getProperty("os.name");
|
||||||
private static final String dataModel = System.getProperty("sun.arch.data.model");
|
private static final String dataModel = System.getProperty("sun.arch.data.model");
|
||||||
private static final String vmVersion = System.getProperty("java.vm.version");
|
private static final String vmVersion = System.getProperty("java.vm.version");
|
||||||
private static final String javaVersion = System.getProperty("java.version");
|
private static final String jdkDebug = System.getProperty("jdk.debug");
|
||||||
private static final String osArch = System.getProperty("os.arch");
|
private static final String osArch = System.getProperty("os.arch");
|
||||||
private static final String vmName = System.getProperty("java.vm.name");
|
private static final String vmName = System.getProperty("java.vm.name");
|
||||||
private static final String userName = System.getProperty("user.name");
|
private static final String userName = System.getProperty("user.name");
|
||||||
@ -100,8 +100,7 @@ public class Platform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDebugBuild() {
|
public static boolean isDebugBuild() {
|
||||||
return (vmVersion.toLowerCase().contains("debug") ||
|
return (jdkDebug.toLowerCase().contains("debug"));
|
||||||
javaVersion.toLowerCase().contains("debug"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getVMVersion() {
|
public static String getVMVersion() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user