Merge
This commit is contained in:
commit
9e981ee107
@ -4,6 +4,7 @@ nbproject/private/
|
||||
^webrev
|
||||
^.hgtip
|
||||
^.bridge2
|
||||
^.jib/
|
||||
.DS_Store
|
||||
.metadata/
|
||||
.recommenders/
|
||||
|
2
.hgtags
2
.hgtags
@ -337,3 +337,5 @@ d131f4b8433a79408f935eff9bf92a0664229b60 jdk9-b90
|
||||
f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
|
||||
09206c6513b300e1ac8541f3be012e1a49312104 jdk9-b93
|
||||
25a2cab05cfbe6034b71d9e72d64c65b0572ce63 jdk9-b94
|
||||
5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95
|
||||
139f19d70350238e15e107945cea75082b6380b3 jdk-9+96
|
||||
|
@ -337,3 +337,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
|
||||
106c06398f7ab330eef9e335fbd3a5a8ead23b77 jdk9-b92
|
||||
331fda57dfd323c61804ba0472776790de572937 jdk9-b93
|
||||
349488425abcaf3ff62f580007860b4b56875d10 jdk9-b94
|
||||
12a6fb4f070f8ca8fbca219ab9abf5da8908b317 jdk-9+95
|
||||
5582a79892596169ebddb3e2c2aa44939e4e3f40 jdk-9+96
|
||||
|
@ -99,7 +99,13 @@ AC_DEFUN([BASIC_FIXUP_PATH],
|
||||
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
|
||||
fi
|
||||
|
||||
$1="`cd "$path"; $THEPWDCMD -L`"
|
||||
if test -d "$path"; then
|
||||
$1="`cd "$path"; $THEPWDCMD -L`"
|
||||
else
|
||||
dir="`$DIRNAME "$path"`"
|
||||
base="`$BASENAME "$path"`"
|
||||
$1="`cd "$dir"; $THEPWDCMD -L`/$base"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
@ -237,12 +243,18 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH],
|
||||
# Register a --enable argument but mark it as deprecated
|
||||
# $1: The name of the with argument to deprecate, not including --enable-
|
||||
# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
|
||||
# $3: Messages to user.
|
||||
AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
|
||||
[
|
||||
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
|
||||
[Deprecated. Option is kept for backwards compatibility and is ignored])])
|
||||
if test "x$enable_$2" != x; then
|
||||
AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
|
||||
|
||||
if test "x$3" != x; then
|
||||
AC_MSG_WARN([$3])
|
||||
fi
|
||||
|
||||
fi
|
||||
])
|
||||
|
||||
@ -1072,6 +1084,26 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
|
||||
AC_SUBST(BASH_ARGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Default make target
|
||||
#
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
|
||||
[
|
||||
AC_ARG_WITH(default-make-target, [AS_HELP_STRING([--with-default-make-target],
|
||||
[set the default make target @<:@exploded-image@:>@])])
|
||||
if test "x$with_default_make_target" = "x" \
|
||||
|| test "x$with_default_make_target" = "xyes"; then
|
||||
DEFAULT_MAKE_TARGET="exploded-image"
|
||||
elif test "x$with_default_make_target" = "xno"; then
|
||||
AC_MSG_ERROR([--without-default-make-target is not a valid option])
|
||||
else
|
||||
DEFAULT_MAKE_TARGET="$with_default_make_target"
|
||||
fi
|
||||
|
||||
AC_SUBST(DEFAULT_MAKE_TARGET)
|
||||
])
|
||||
|
||||
# Code to run after AC_OUTPUT
|
||||
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
|
||||
[
|
||||
|
@ -423,7 +423,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
||||
AC_MSG_ERROR([fixpath did not work!])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
FIXPATH_DETACH_FLAG="--detach"
|
||||
fi
|
||||
|
||||
AC_SUBST(FIXPATH)
|
||||
AC_SUBST(FIXPATH_DETACH_FLAG)
|
||||
])
|
||||
|
@ -375,6 +375,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
|
||||
AC_SUBST(JAVA_FLAGS_BIG)
|
||||
|
||||
# By default, the main javac compilations use big
|
||||
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
|
||||
AC_SUBST(JAVA_FLAGS_JAVAC)
|
||||
|
||||
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])
|
||||
|
||||
|
@ -59,3 +59,8 @@ JAVAH_CMD:=$(BOOT_JDK)/bin/javah
|
||||
JAR_CMD:=$(BOOT_JDK)/bin/jar
|
||||
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
|
||||
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
|
||||
# When building a 32bit target, make sure the sjavac server flags are compatible
|
||||
# with a 32bit JVM.
|
||||
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
|
||||
SJAVAC_SERVER_JAVA_FLAGS:= -Xms256M -Xmx1500M
|
||||
endif
|
||||
|
@ -138,14 +138,6 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
|
||||
JOBS="$memory_gb"
|
||||
else
|
||||
JOBS="$NUM_CORES"
|
||||
# On bigger machines, leave some room for other processes to run
|
||||
if test "$JOBS" -gt "4"; then
|
||||
JOBS=`expr $JOBS '*' 90 / 100`
|
||||
fi
|
||||
fi
|
||||
# Cap number of jobs to 16
|
||||
if test "$JOBS" -gt "16"; then
|
||||
JOBS=16
|
||||
fi
|
||||
if test "$JOBS" -eq "0"; then
|
||||
JOBS=1
|
||||
@ -246,6 +238,73 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
|
||||
fi
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Optionally enable distributed compilation of native code using icecc/icecream
|
||||
#
|
||||
AC_DEFUN([BPERF_SETUP_ICECC],
|
||||
[
|
||||
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
|
||||
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
|
||||
|
||||
if test "x${enable_icecc}" = "xyes"; then
|
||||
BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
|
||||
old_path="$PATH"
|
||||
|
||||
# Look for icecc-create-env in some known places
|
||||
PATH="$PATH:/usr/lib/icecc:/usr/lib64/icecc"
|
||||
BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env)
|
||||
# Use icecc-create-env to create a minimal compilation environment that can
|
||||
# be sent to the other hosts in the icecream cluster.
|
||||
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
|
||||
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
|
||||
AC_MSG_CHECKING([for icecc build environment for target compiler])
|
||||
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
|
||||
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
|
||||
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
# For clang, the icecc compilerwrapper is needed. It usually resides next
|
||||
# to icecc-create-env.
|
||||
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
|
||||
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
|
||||
else
|
||||
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
|
||||
fi
|
||||
PATH="$old_path"
|
||||
# The bundle with the compiler gets a name based on checksums. Parse log file
|
||||
# to find it.
|
||||
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
|
||||
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
|
||||
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
|
||||
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
|
||||
|
||||
if test "x${COMPILE_TYPE}" = "xcross"; then
|
||||
# If cross compiling, create a separate env package for the build compiler
|
||||
AC_MSG_CHECKING([for icecc build environment for build compiler])
|
||||
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
|
||||
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
|
||||
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
|
||||
elif test "x${BUILD_CC##*/}" = "xclang"; then
|
||||
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
|
||||
else
|
||||
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
|
||||
fi
|
||||
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
|
||||
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
|
||||
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
|
||||
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
|
||||
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
|
||||
else
|
||||
BUILD_ICECC="${ICECC}"
|
||||
fi
|
||||
AC_SUBST(ICECC)
|
||||
AC_SUBST(BUILD_ICECC)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
[
|
||||
|
||||
@ -258,8 +317,15 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
|
||||
|
||||
USE_PRECOMPILED_HEADER=1
|
||||
AC_MSG_CHECKING([If precompiled header is enabled])
|
||||
if test "x$ENABLE_PRECOMPH" = xno; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
USE_PRECOMPILED_HEADER=0
|
||||
elif test "x$ICECC" != "x"; then
|
||||
AC_MSG_RESULT([no, does not work effectively with icecc])
|
||||
USE_PRECOMPILED_HEADER=0
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_PRECOMPH" = xyes; then
|
||||
@ -337,9 +403,9 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
AC_MSG_RESULT([$ENABLE_SJAVAC])
|
||||
AC_SUBST(ENABLE_SJAVAC)
|
||||
|
||||
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
|
||||
[use only the server part of sjavac for faster javac compiles @<:@disabled@:>@])],
|
||||
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="no"])
|
||||
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server],
|
||||
[disable javac server @<:@enabled@:>@])],
|
||||
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"])
|
||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
|
||||
ENABLE_JAVAC_SERVER="no"
|
||||
@ -347,4 +413,10 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
AC_MSG_CHECKING([whether to use javac server])
|
||||
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
|
||||
AC_SUBST(ENABLE_JAVAC_SERVER)
|
||||
|
||||
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
|
||||
# When using a server javac, the small client instances do not need much
|
||||
# resources.
|
||||
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
|
||||
fi
|
||||
])
|
||||
|
8
common/autoconf/configure
vendored
8
common/autoconf/configure
vendored
@ -257,10 +257,14 @@ fi
|
||||
|
||||
# Now transfer control to the script generated by autoconf. This is where the
|
||||
# main work is done.
|
||||
RCDIR=`mktemp -dt jdk-build-configure.tmp.XXXXXX` || exit $?
|
||||
trap "rm -rf \"$RCDIR\"" EXIT
|
||||
conf_logfile=./configure.log
|
||||
(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
|
||||
(exec 3>&1 ; ((. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) \
|
||||
; echo $? > "$RCDIR/rc" ) \
|
||||
| tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
|
||||
|
||||
conf_result_code=$?
|
||||
conf_result_code=`cat "$RCDIR/rc"`
|
||||
###
|
||||
### Post-processing
|
||||
###
|
||||
|
@ -121,6 +121,9 @@ PKG_PROG_PKG_CONFIG
|
||||
# After basic tools have been setup, we can check build os specific details.
|
||||
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
|
||||
|
||||
# Misc basic settings
|
||||
BASIC_SETUP_DEFAULT_MAKE_TARGET
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine OpenJDK variants, options and version numbers.
|
||||
@ -237,6 +240,9 @@ BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
|
||||
# Setup smart javac (after cores and memory have been setup)
|
||||
BPERF_SETUP_SMART_JAVAC
|
||||
|
||||
# Setup use of icecc if requested
|
||||
BPERF_SETUP_ICECC
|
||||
|
||||
# Can the C/C++ compiler use precompiled headers?
|
||||
BPERF_SETUP_PRECOMPILED_HEADERS
|
||||
|
||||
|
@ -976,6 +976,19 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
|
||||
DISABLE_WARNING_PREFIX=
|
||||
fi
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
# Repeate the check for the BUILD_CC
|
||||
CC_OLD="$CC"
|
||||
CC="$BUILD_CC"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
|
||||
[BUILD_CC_CAN_DISABLE_WARNINGS=true],
|
||||
[BUILD_CC_CAN_DISABLE_WARNINGS=false]
|
||||
)
|
||||
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
|
||||
else
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX=
|
||||
fi
|
||||
CC="$CC_OLD"
|
||||
;;
|
||||
clang)
|
||||
DISABLE_WARNING_PREFIX="-Wno-"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -49,8 +49,8 @@ ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
|
||||
|
||||
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
|
||||
# compiler that produces code that can be run on the build platform.
|
||||
HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
|
||||
HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
|
||||
HOSTCC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
|
||||
HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
|
||||
|
||||
####################################################
|
||||
#
|
||||
@ -105,7 +105,7 @@ USE_CLANG := @USE_CLANG@
|
||||
|
||||
# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
|
||||
# Hotspot has its own handling on the Windows path situation.
|
||||
CXX:=@CCACHE@ @HOTSPOT_CXX@
|
||||
CXX:=@CCACHE@ @ICECC@ @HOTSPOT_CXX@
|
||||
LD:=@HOTSPOT_LD@
|
||||
MT:=@HOTSPOT_MT@
|
||||
RC:=@HOTSPOT_RC@
|
||||
|
@ -491,53 +491,74 @@ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[
|
||||
#
|
||||
# ENABLE_DEBUG_SYMBOLS
|
||||
# NATIVE_DEBUG_SYMBOLS
|
||||
# This must be done after the toolchain is setup, since we're looking at objcopy.
|
||||
#
|
||||
AC_ARG_ENABLE([debug-symbols],
|
||||
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
|
||||
AC_MSG_CHECKING([what type of native debug symbols to use])
|
||||
AC_ARG_WITH([native-debug-symbols],
|
||||
[AS_HELP_STRING([--with-native-debug-symbols],
|
||||
[set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
|
||||
[],
|
||||
[with_native_debug_symbols="zipped"])
|
||||
NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
|
||||
AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
|
||||
|
||||
AC_MSG_CHECKING([if we should generate debug symbols])
|
||||
if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
|
||||
|
||||
if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
|
||||
# explicit enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
|
||||
fi
|
||||
|
||||
if test "x$enable_debug_symbols" = "xyes"; then
|
||||
ENABLE_DEBUG_SYMBOLS=true
|
||||
elif test "x$enable_debug_symbols" = "xno"; then
|
||||
ENABLE_DEBUG_SYMBOLS=false
|
||||
else
|
||||
# Default is on if objcopy is found
|
||||
if test "x$OBJCOPY" != x; then
|
||||
ENABLE_DEBUG_SYMBOLS=true
|
||||
# MacOS X and Windows don't use objcopy but default is on for those OSes
|
||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
ENABLE_DEBUG_SYMBOLS=true
|
||||
else
|
||||
ENABLE_DEBUG_SYMBOLS=false
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OBJCOPY" = x; then
|
||||
# enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
|
||||
|
||||
#
|
||||
# ZIP_DEBUGINFO_FILES
|
||||
#
|
||||
AC_MSG_CHECKING([if we should zip debug-info files])
|
||||
AC_ARG_ENABLE([zip-debug-info],
|
||||
[AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
|
||||
[enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
|
||||
AC_MSG_RESULT([${enable_zip_debug_info}])
|
||||
|
||||
if test "x${enable_zip_debug_info}" = "xno"; then
|
||||
ZIP_DEBUGINFO_FILES=false
|
||||
else
|
||||
ENABLE_DEBUG_SYMBOLS=true
|
||||
ZIP_DEBUGINFO_FILES=true
|
||||
DEBUG_BINARIES=true
|
||||
STRIP_POLICY=min_strip
|
||||
elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
|
||||
ENABLE_DEBUG_SYMBOLS=false
|
||||
ZIP_DEBUGINFO_FILES=false
|
||||
DEBUG_BINARIES=false
|
||||
STRIP_POLICY=no_strip
|
||||
elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
|
||||
ENABLE_DEBUG_SYMBOLS=false # -g option only
|
||||
ZIP_DEBUGINFO_FILES=false
|
||||
DEBUG_BINARIES=true
|
||||
STRIP_POLICY=no_strip
|
||||
STRIP=""
|
||||
elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OBJCOPY" = x; then
|
||||
# enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
||||
fi
|
||||
fi
|
||||
|
||||
ENABLE_DEBUG_SYMBOLS=true
|
||||
ZIP_DEBUGINFO_FILES=false
|
||||
DEBUG_BINARIES=true
|
||||
STRIP_POLICY=min_strip
|
||||
else
|
||||
AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
|
||||
fi
|
||||
|
||||
# --enable-debug-symbols is deprecated.
|
||||
# Please use --with-native-debug-symbols=[internal,external,zipped] .
|
||||
BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
|
||||
[Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
|
||||
|
||||
# --enable-zip-debug-info is deprecated.
|
||||
# Please use --with-native-debug-symbols=zipped .
|
||||
BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
|
||||
[Please use --with-native-debug-symbols=zipped .])
|
||||
|
||||
AC_SUBST(NATIVE_DEBUG_SYMBOLS)
|
||||
AC_SUBST(DEBUG_BINARIES)
|
||||
AC_SUBST(STRIP_POLICY)
|
||||
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
|
||||
AC_SUBST(ZIP_DEBUGINFO_FILES)
|
||||
])
|
||||
|
@ -271,6 +271,9 @@ SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
|
||||
# Number of parallel jobs to use for compilation
|
||||
JOBS?=@JOBS@
|
||||
|
||||
# Default make target
|
||||
DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@
|
||||
|
||||
FREETYPE_LIBS:=@FREETYPE_LIBS@
|
||||
FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
|
||||
FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
|
||||
@ -329,7 +332,7 @@ WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
CC:=@FIXPATH@ @CCACHE@ @CC@
|
||||
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
|
||||
|
||||
# CFLAGS used to compile the jdk native libraries (C-code)
|
||||
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
|
||||
@ -339,7 +342,7 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
|
||||
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
||||
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
||||
|
||||
CXX:=@FIXPATH@ @CCACHE@ @CXX@
|
||||
CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@
|
||||
#CXXFLAGS:=@CXXFLAGS@
|
||||
|
||||
CPP:=@FIXPATH@ @CPP@
|
||||
@ -382,8 +385,12 @@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
|
||||
|
||||
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
|
||||
# build platform.
|
||||
BUILD_CC:=@FIXPATH@ @BUILD_CC@
|
||||
BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
|
||||
BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
|
||||
BUILD_LD:=@FIXPATH@ @BUILD_LD@
|
||||
BUILD_AS:=@FIXPATH@ @BUILD_AS@
|
||||
BUILD_AR:=@FIXPATH@ @BUILD_AR@
|
||||
BUILD_NM:=@FIXPATH@ @BUILD_NM@
|
||||
BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
|
||||
BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
|
||||
|
||||
@ -414,6 +421,9 @@ ENABLE_DEBUG_SYMBOLS:=@ENABLE_DEBUG_SYMBOLS@
|
||||
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
|
||||
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
|
||||
ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@
|
||||
NATIVE_DEBUG_SYMBOLS:=@NATIVE_DEBUG_SYMBOLS@
|
||||
DEBUG_BINARIES:=@DEBUG_BINARIES@
|
||||
STRIP_POLICY:=@STRIP_POLICY@
|
||||
|
||||
#
|
||||
# Compress (or not) jars
|
||||
@ -446,6 +456,7 @@ STRIPFLAGS:=@STRIPFLAGS@
|
||||
JAVA_FLAGS:=@JAVA_FLAGS@
|
||||
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
|
||||
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
|
||||
JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@
|
||||
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
|
||||
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
|
||||
|
||||
@ -462,13 +473,15 @@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
|
||||
# it possible to override only the *_CMD variables.
|
||||
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
||||
JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
|
||||
JAVAC=@FIXPATH@ $(JAVAC_CMD)
|
||||
JAVAH=@FIXPATH@ $(JAVAH_CMD)
|
||||
JAR=@FIXPATH@ $(JAR_CMD)
|
||||
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
||||
# A specific java binary with specific options can be used to run
|
||||
# the long running background sjavac servers and other long running tasks.
|
||||
SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAGS)
|
||||
SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
|
||||
$(SJAVAC_SERVER_JAVA_FLAGS)
|
||||
|
||||
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
|
||||
# overriding that value by using ?=.
|
||||
|
@ -539,6 +539,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
# The corresponding ar tool is lib.exe (used to create static libraries)
|
||||
AC_CHECK_PROG([AR], [lib],[lib],,,)
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
BASIC_CHECK_TOOLS(AR, ar gcc-ar)
|
||||
else
|
||||
BASIC_CHECK_TOOLS(AR, ar)
|
||||
fi
|
||||
@ -584,7 +586,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
||||
# FIXME: we should unify this with the solaris case above.
|
||||
BASIC_CHECK_TOOLS(STRIP, strip)
|
||||
BASIC_FIXUP_EXECUTABLE(STRIP)
|
||||
BASIC_CHECK_TOOLS(NM, nm)
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
BASIC_CHECK_TOOLS(NM, nm gcc-nm)
|
||||
else
|
||||
BASIC_CHECK_TOOLS(NM, nm)
|
||||
fi
|
||||
BASIC_FIXUP_EXECUTABLE(NM)
|
||||
GNM="$NM"
|
||||
AC_SUBST(GNM)
|
||||
@ -717,6 +723,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
BASIC_FIXUP_EXECUTABLE(BUILD_CC)
|
||||
BASIC_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||
BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
|
||||
BASIC_PATH_PROGS(BUILD_NM, nm gcc-nm)
|
||||
BASIC_FIXUP_EXECUTABLE(BUILD_NM)
|
||||
BASIC_PATH_PROGS(BUILD_AR, ar gcc-ar)
|
||||
BASIC_FIXUP_EXECUTABLE(BUILD_AR)
|
||||
# Assume the C compiler is the assembler
|
||||
BUILD_AS="$BUILD_CC -c"
|
||||
# Just like for the target compiler, use the compiler as linker
|
||||
BUILD_LD="$BUILD_CC"
|
||||
|
||||
PATH="$OLDPATH"
|
||||
@ -726,15 +739,21 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
BUILD_CC="$CC"
|
||||
BUILD_CXX="$CXX"
|
||||
BUILD_LD="$LD"
|
||||
BUILD_NM="$NM"
|
||||
BUILD_AS="$AS"
|
||||
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
|
||||
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
|
||||
BUILD_AR="$AR"
|
||||
fi
|
||||
|
||||
AC_SUBST(BUILD_CC)
|
||||
AC_SUBST(BUILD_CXX)
|
||||
AC_SUBST(BUILD_LD)
|
||||
AC_SUBST(BUILD_NM)
|
||||
AC_SUBST(BUILD_AS)
|
||||
AC_SUBST(BUILD_SYSROOT_CFLAGS)
|
||||
AC_SUBST(BUILD_SYSROOT_LDFLAGS)
|
||||
AC_SUBST(BUILD_AR)
|
||||
])
|
||||
|
||||
# Setup legacy variables that are still needed as alternative ways to refer to
|
||||
|
127
common/bin/jib.sh
Normal file
127
common/bin/jib.sh
Normal file
@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This script installs the JIB tool into it's own local repository and
|
||||
# puts a wrapper scripts into <source-root>/.jib
|
||||
|
||||
mydir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
myname="$(basename "${BASH_SOURCE[0]}")"
|
||||
|
||||
installed_jib_script=${mydir}/../../.jib/jib
|
||||
install_data=${mydir}/../../.jib/.data
|
||||
|
||||
setup_url() {
|
||||
if [ -f "~/.config/jib/jib.conf" ]; then
|
||||
source ~/.config/jib/jib.conf
|
||||
fi
|
||||
|
||||
jib_repository="jdk-virtual"
|
||||
jib_organization="jpg/infra/builddeps"
|
||||
jib_module="jib"
|
||||
jib_revision="2.0-SNAPSHOT"
|
||||
jib_ext="jib.sh.gz"
|
||||
|
||||
closed_script="${mydir}/../../closed/conf/jib-install.conf"
|
||||
if [ -f "${closed_script}" ]; then
|
||||
source "${closed_script}"
|
||||
fi
|
||||
|
||||
if [ -n "${JIB_SERVER}" ]; then
|
||||
jib_server="${JIB_SERVER}"
|
||||
fi
|
||||
if [ -n "${JIB_REPOSITORY}" ]; then
|
||||
jib_repository="${JIB_REPOSITORY}"
|
||||
fi
|
||||
if [ -n "${JIB_ORGANIZATION}" ]; then
|
||||
jib_organization="${JIB_ORGANIZATION}"
|
||||
fi
|
||||
if [ -n "${JIB_MODULE}" ]; then
|
||||
jib_module="${JIB_MODULE}"
|
||||
fi
|
||||
if [ -n "${JIB_REVISION}" ]; then
|
||||
jib_revision="${JIB_REVISION}"
|
||||
fi
|
||||
if [ -n "${JIB_EXTENSION}" ]; then
|
||||
jib_extension="${JIB_EXTENSION}"
|
||||
fi
|
||||
|
||||
if [ -n "${JIB_URL}" ]; then
|
||||
jib_url="${JIB_URL}"
|
||||
data_string="${jib_url}"
|
||||
else
|
||||
data_string="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
|
||||
jib_url="${jib_server}/${data_string}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_jib() {
|
||||
if [ -z "${jib_server}" -a -z "${JIB_URL}" ]; then
|
||||
echo "No jib server or URL provided, set either"
|
||||
echo "JIB_SERVER=<base server address>"
|
||||
echo "or"
|
||||
echo "JIB_URL=<full path to install script>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v curl > /dev/null; then
|
||||
getcmd="curl -s"
|
||||
elif command -v wget > /dev/null; then
|
||||
getcmd="wget --quiet -O -"
|
||||
else
|
||||
echo "Could not find either curl or wget"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v gunzip > /dev/null; then
|
||||
echo "Could not find gunzip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Downloading JIB bootstrap script"
|
||||
mkdir -p "${installed_jib_script%/*}"
|
||||
rm -f "${installed_jib_script}.gz"
|
||||
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
|
||||
if [ ! -s "${installed_jib_script}.gz" ]; then
|
||||
echo "Failed to download ${jib_url}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Extracting JIB bootstrap script"
|
||||
rm -f "${installed_jib_script}"
|
||||
gunzip "${installed_jib_script}.gz"
|
||||
chmod +x "${installed_jib_script}"
|
||||
echo "${data_string}" > "${install_data}"
|
||||
}
|
||||
|
||||
# Main body starts here
|
||||
|
||||
setup_url
|
||||
|
||||
if [ ! -x "${installed_jib_script}" ]; then
|
||||
install_jib
|
||||
elif [ ! -e "${install_data}" ] || [ "${data_string}" != "$(cat "${install_data}")" ]; then
|
||||
echo "Install url changed since last time, reinstalling"
|
||||
install_jib
|
||||
fi
|
||||
|
||||
${installed_jib_script} "$@"
|
@ -1293,10 +1293,7 @@ jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/win
|
||||
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
|
||||
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
|
||||
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent/package.html : jdk/src/macosx/classes/com/apple/concurrent/package.html
|
||||
jdk/src/jdk.deploy.osx/macosx/classes/apple/applescript : jdk/src/macosx/classes/apple/applescript
|
||||
jdk/src/jdk.deploy.osx/macosx/classes/apple/security : jdk/src/macosx/classes/apple/security
|
||||
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent : jdk/src/macosx/classes/com/apple/concurrent
|
||||
jdk/src/jdk.deploy.osx/macosx/native/libapplescriptengine : jdk/src/macosx/native/apple/applescript
|
||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
|
||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
|
||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
|
||||
|
555
common/conf/jib-profiles.js
Normal file
555
common/conf/jib-profiles.js
Normal file
@ -0,0 +1,555 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file defines build profiles for the JIB tool and others.
|
||||
*
|
||||
* A build profile defines a set of configuration options and external
|
||||
* dependencies that we for some reason or other care about specifically.
|
||||
* Typically, build profiles are defined for the build configurations we
|
||||
* build regularly.
|
||||
*
|
||||
* Contract against this file from the tools that use it, is to provide
|
||||
* a function on the form:
|
||||
*
|
||||
* getJibProfiles(input)
|
||||
*
|
||||
* which returns an object graph describing the profiles and their
|
||||
* dependencies. The name of the function is based on the name of this
|
||||
* file, minus the extension and the '-', camel cased and prefixed with
|
||||
* 'get'.
|
||||
*
|
||||
*
|
||||
* The parameter 'input' is an object that optionally contains some data.
|
||||
* Optionally because a tool may read the configuration for different purposes.
|
||||
* To initially get a list of available profiles, the active profile may not
|
||||
* yet be known for instance.
|
||||
*
|
||||
* Data that may be set on the input object:
|
||||
*
|
||||
* input.profile = <name of active profile>
|
||||
*
|
||||
* If the active profile is set, the following data from it must also
|
||||
* be provided:
|
||||
*
|
||||
* input.profile
|
||||
* input.target_os
|
||||
* input.target_cpu
|
||||
* input.build_os
|
||||
* input.build_cpu
|
||||
* input.target_platform
|
||||
* input.build_platform
|
||||
* // The build_osenv_* variables describe the unix layer on Windows systems,
|
||||
* // i.e. Cygwin, which may also be 32 or 64 bit.
|
||||
* input.build_osenv
|
||||
* input.build_osenv_cpu
|
||||
* input.build_osenv_platform
|
||||
*
|
||||
* For more complex nested attributes, there is a method "get":
|
||||
*
|
||||
* input.get("<dependency>", "<attribute>")
|
||||
*
|
||||
* Valid attributes are:
|
||||
* install_path
|
||||
* download_path
|
||||
* download_dir
|
||||
*
|
||||
*
|
||||
* The output data generated by this configuration file has the following
|
||||
* format:
|
||||
*
|
||||
* data: {
|
||||
* // Identifies the version of this format to the tool reading it
|
||||
* format_version: "1.0",
|
||||
*
|
||||
* // Name of base outputdir. JIB assumes the actual output dir is formed
|
||||
* // by adding the configuration name: <output_basedir>/<config-name>
|
||||
* output_basedir: "build",
|
||||
* // Configure argument to use to specify configuration name
|
||||
* configuration_configure_arg:
|
||||
* // Make argument to use to specify configuration name
|
||||
* configuration_make_arg:
|
||||
*
|
||||
* profiles: {
|
||||
* <profile-name>: {
|
||||
* // Name of os the profile is built to run on
|
||||
* target_os; <string>
|
||||
* // Name of cpu the profile is built to run on
|
||||
* target_cpu; <string>
|
||||
* // Combination of target_os and target_cpu for convenience
|
||||
* target_platform; <string>
|
||||
* // Name of os the profile is built on
|
||||
* build_os; <string>
|
||||
* // Name of cpu the profile is built on
|
||||
* build_cpu; <string>
|
||||
* // Combination of build_os and build_cpu for convenience
|
||||
* build_platform; <string>
|
||||
*
|
||||
* // List of dependencies needed to build this profile
|
||||
* dependencies: <Array of strings>
|
||||
*
|
||||
* // List of configure args to use for this profile
|
||||
* configure_args: <Array of strings>
|
||||
*
|
||||
* // List of free form labels describing aspects of this profile
|
||||
* labels: <Array of strings>
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* // Dependencies use a Maven like deployment structure
|
||||
* dependencies: {
|
||||
* <dependency-name>: {
|
||||
* // Organization part of path defining this dependency
|
||||
* organization: <string>
|
||||
* // File extension for this dependency
|
||||
* ext: <string>
|
||||
* // Module part of path for defining this dependency,
|
||||
* // defaults to <dependency-name>
|
||||
* module: <string>
|
||||
* // Revision part of path for defining this dependency
|
||||
* revision: <string>
|
||||
*
|
||||
* // List of configure args to add when using this dependency,
|
||||
* // defaults to
|
||||
* // "--with-<dependency-name>=input.get("<dependency-name", "install_path")"
|
||||
* configure_args: <array of strings>
|
||||
*
|
||||
* // Name of environment variable to set when using this dependency
|
||||
* // when running make
|
||||
* environment_name: <string>
|
||||
* // Value of environment variable to set when using this dependency
|
||||
* // when running make
|
||||
* environment_value: <string>
|
||||
*
|
||||
* // Value to add to the PATH variable when using this dependency,
|
||||
* // applies to both make and configure
|
||||
* environment_path: <string>
|
||||
* }
|
||||
*
|
||||
* <dependency-name>: {
|
||||
* // For certain dependencies where a legacy distribution mechanism is
|
||||
* // already in place, the "javare" server layout is also supported
|
||||
* // Indicate that an alternate server source and layout should be used
|
||||
* server: "javare"
|
||||
*
|
||||
* // For "javare", a combination of module, revision,
|
||||
* // build number (optional), files and checksum file is possible for
|
||||
* // artifacts following the standard layout.
|
||||
* module: <string>
|
||||
* revision: <string>
|
||||
* build_number: <string>
|
||||
* checksum_file: <string>
|
||||
* file: <string>
|
||||
*
|
||||
* // For other files, use checksum path and path instead
|
||||
* checksum_path: <string>
|
||||
* path: <string>
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main entry to generate the profile configuration
|
||||
*
|
||||
* @param input External data to use for generating the configuration
|
||||
* @returns {{}} Profile configuration
|
||||
*/
|
||||
var getJibProfiles = function (input) {
|
||||
|
||||
var data = {};
|
||||
|
||||
// Identifies the version of this format to the tool reading it
|
||||
data.format_version = "1.0";
|
||||
|
||||
// Organization is used when uploading/publishing build results
|
||||
data.organization = "com.oracle.jpg.jdk";
|
||||
|
||||
// The base directory for the build output. JIB will assume that the
|
||||
// actual build directory will be <output_basedir>/<configuration>
|
||||
data.output_basedir = "build";
|
||||
// The configure argument to use to specify the name of the configuration
|
||||
data.configuration_configure_arg = "--with-conf-name=";
|
||||
// The make argument to use to specify the name of the configuration
|
||||
data.configuration_make_arg = "CONF_NAME=";
|
||||
|
||||
// Define some common values
|
||||
var common = getJibProfilesCommon(input);
|
||||
// Generate the profiles part of the configuration
|
||||
data.profiles = getJibProfilesProfiles(input, common);
|
||||
// Generate the dependencies part of the configuration
|
||||
data.dependencies = getJibProfilesDependencies(input, common);
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates some common values
|
||||
*
|
||||
* @param input External data to use for generating the configuration
|
||||
* @returns Common values
|
||||
*/
|
||||
var getJibProfilesCommon = function (input) {
|
||||
var common = {
|
||||
dependencies: ["boot_jdk", "gnumake", "jtreg"],
|
||||
configure_args: ["--with-default-make-target=all"],
|
||||
configure_args_32bit: ["--with-target-bits=32", "--with-jvm-variants=client,server"],
|
||||
configure_args_debug: ["--enable-debug"],
|
||||
organization: "jpg.infra.builddeps"
|
||||
};
|
||||
|
||||
return common;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates the profiles part of the configuration.
|
||||
*
|
||||
* @param input External data to use for generating the configuration
|
||||
* @param common The common values
|
||||
* @returns {{}} Profiles part of the configuration
|
||||
*/
|
||||
var getJibProfilesProfiles = function (input, common) {
|
||||
var profiles = {};
|
||||
|
||||
// Main SE profiles
|
||||
var mainProfiles = {
|
||||
|
||||
"linux-x64": {
|
||||
target_os: "linux",
|
||||
target_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit"),
|
||||
configure_args: common.configure_args,
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"linux-x86": {
|
||||
target_os: "linux",
|
||||
target_cpu: "x86",
|
||||
build_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit"),
|
||||
configure_args: concat(common.configure_args, common.configure_args_32bit),
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"macosx-x64": {
|
||||
target_os: "macosx",
|
||||
target_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit"),
|
||||
configure_args: concat(common.configure_args, "--with-sdk-name=macosx10.9"),
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"solaris-x64": {
|
||||
target_os: "solaris",
|
||||
target_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit", "cups"),
|
||||
configure_args: common.configure_args,
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"solaris-sparcv9": {
|
||||
target_os: "solaris",
|
||||
target_cpu: "sparcv9",
|
||||
dependencies: concat(common.dependencies, "devkit", "cups"),
|
||||
configure_args: common.configure_args,
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"windows-x64": {
|
||||
target_os: "windows",
|
||||
target_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit", "freetype"),
|
||||
configure_args: common.configure_args,
|
||||
make_args: common.make_args
|
||||
},
|
||||
|
||||
"windows-x86": {
|
||||
target_os: "windows",
|
||||
target_cpu: "x86",
|
||||
build_cpu: "x64",
|
||||
dependencies: concat(common.dependencies, "devkit", "freetype"),
|
||||
configure_args: concat(common.configure_args, common.configure_args_32bit),
|
||||
make_args: common.make_args
|
||||
}
|
||||
};
|
||||
profiles = concatObjects(profiles, mainProfiles);
|
||||
// Generate debug versions of all the main profiles
|
||||
profiles = concatObjects(profiles, generateDebugProfiles(common, mainProfiles));
|
||||
|
||||
// Specific open profiles needed for JPRT testing
|
||||
var jprtOpenProfiles = {
|
||||
|
||||
"linux-x64-open": {
|
||||
target_os: mainProfiles["linux-x64"].target_os,
|
||||
target_cpu: mainProfiles["linux-x64"].target_cpu,
|
||||
dependencies: mainProfiles["linux-x64"].dependencies,
|
||||
configure_args: concat(mainProfiles["linux-x64"].configure_args,
|
||||
"--enable-openjdk-only"),
|
||||
make_args: mainProfiles["linux-x64"].make_args,
|
||||
labels: [ "open" ]
|
||||
},
|
||||
|
||||
"solaris-x64-open": {
|
||||
target_os: mainProfiles["solaris-x64"].target_os,
|
||||
target_cpu: mainProfiles["solaris-x64"].target_cpu,
|
||||
dependencies: mainProfiles["solaris-x64"].dependencies,
|
||||
configure_args: concat(mainProfiles["solaris-x64"].configure_args,
|
||||
"--enable-openjdk-only"),
|
||||
make_args: mainProfiles["solaris-x64"].make_args,
|
||||
labels: [ "open" ]
|
||||
}
|
||||
};
|
||||
profiles = concatObjects(profiles, jprtOpenProfiles);
|
||||
// Generate debug profiles for the open jprt profiles
|
||||
profiles = concatObjects(profiles, generateDebugProfiles(common, jprtOpenProfiles));
|
||||
|
||||
// Profiles used to run tests. Used in JPRT.
|
||||
var testOnlyProfiles = {
|
||||
|
||||
"run-test": {
|
||||
target_os: input.build_os,
|
||||
target_cpu: input.build_cpu,
|
||||
dependencies: [ "jtreg", "gnumake" ],
|
||||
labels: "test"
|
||||
}
|
||||
};
|
||||
profiles = concatObjects(profiles, testOnlyProfiles);
|
||||
|
||||
// Generate the missing platform attributes
|
||||
profiles = generatePlatformAttributes(profiles);
|
||||
return profiles;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate the dependencies part of the configuration
|
||||
*
|
||||
* @param input External data to use for generating the configuration
|
||||
* @param common The common values
|
||||
* @returns {{}} Dependencies part of configuration
|
||||
*/
|
||||
var getJibProfilesDependencies = function (input, common) {
|
||||
|
||||
var boot_jdk_platform = input.build_os + "-"
|
||||
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
|
||||
|
||||
var devkit_platform_revisions = {
|
||||
linux_x64: "gcc4.9.2-OEL6.4+1.0",
|
||||
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||
solaris_x64: "SS12u3-Solaris10u10+1.0",
|
||||
solaris_sparcv9: "SS12u3-Solaris10u10+1.0",
|
||||
windows_x64: "VS2013SP4+1.0"
|
||||
};
|
||||
|
||||
var devkit_platform = (input.target_cpu == "x86"
|
||||
? input.target_os + "_x64"
|
||||
: input.target_platform);
|
||||
|
||||
var dependencies = {
|
||||
|
||||
boot_jdk: {
|
||||
server: "javare",
|
||||
module: "jdk",
|
||||
revision: "8",
|
||||
checksum_file: boot_jdk_platform + "/MD5_VALUES",
|
||||
file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz",
|
||||
configure_args: (input.build_os == "macosx"
|
||||
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home"
|
||||
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0")
|
||||
},
|
||||
|
||||
devkit: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
module: "devkit-" + devkit_platform,
|
||||
revision: devkit_platform_revisions[devkit_platform]
|
||||
},
|
||||
|
||||
build_devkit: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
module: "devkit-" + input.build_platform,
|
||||
revision: devkit_platform_revisions[input.build_platform]
|
||||
},
|
||||
|
||||
cups: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "1.0118+1.0"
|
||||
},
|
||||
|
||||
jtreg: {
|
||||
server: "javare",
|
||||
revision: "4.1",
|
||||
build_number: "b12",
|
||||
checksum_file: "MD5_VALUES",
|
||||
file: "jtreg_bin-4.1.zip",
|
||||
environment_name: "JT_HOME"
|
||||
},
|
||||
|
||||
gnumake: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "4.0+1.0",
|
||||
|
||||
module: (input.build_os == "windows"
|
||||
? "gnumake-" + input.build_osenv_platform
|
||||
: "gnumake-" + input.build_platform),
|
||||
|
||||
configure_args: (input.build_os == "windows"
|
||||
? "MAKE=" + input.get("gnumake", "install_path") + "/cygwin/bin/make"
|
||||
: "MAKE=" + input.get("gnumake", "install_path") + "/bin/make"),
|
||||
|
||||
environment_path: (input.build_os == "windows"
|
||||
? input.get("gnumake", "install_path") + "/cygwin/bin"
|
||||
: input.get("gnumake", "install_path") + "/bin")
|
||||
},
|
||||
|
||||
freetype: {
|
||||
organization: common.organization,
|
||||
ext: "tar.gz",
|
||||
revision: "2.3.4+1.0",
|
||||
module: "freetype-" + input.target_platform
|
||||
}
|
||||
};
|
||||
|
||||
return dependencies;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate the missing platform attributes for profiles
|
||||
*
|
||||
* @param profiles Profiles map to generate attributes on
|
||||
* @returns {{}} New profiles map with platform attributes fully filled in
|
||||
*/
|
||||
var generatePlatformAttributes = function (profiles) {
|
||||
var ret = concatObjects(profiles, {});
|
||||
for (var profile in profiles) {
|
||||
if (ret[profile].build_os == null) {
|
||||
ret[profile].build_os = ret[profile].target_os;
|
||||
}
|
||||
if (ret[profile].build_cpu == null) {
|
||||
ret[profile].build_cpu = ret[profile].target_cpu;
|
||||
}
|
||||
ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu;
|
||||
ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates debug versions of profiles. Clones the given profiles and adds
|
||||
* debug metadata.
|
||||
*
|
||||
* @param common Common values
|
||||
* @param profiles Profiles map to generate debug profiles for
|
||||
* @returns {{}} New map of profiles containing debug profiles
|
||||
*/
|
||||
var generateDebugProfiles = function (common, profiles) {
|
||||
var newProfiles = {};
|
||||
for (var profile in profiles) {
|
||||
var debugProfile = profile + "-debug";
|
||||
newProfiles[debugProfile] = clone(profiles[profile]);
|
||||
newProfiles[debugProfile].debug_level = "fastdebug";
|
||||
newProfiles[debugProfile].labels
|
||||
= concat(newProfiles[debugProfile].labels || [], "debug"),
|
||||
newProfiles[debugProfile].configure_args
|
||||
= concat(newProfiles[debugProfile].configure_args,
|
||||
common.configure_args_debug);
|
||||
}
|
||||
return newProfiles;
|
||||
};
|
||||
|
||||
/**
|
||||
* Deep clones an object tree.
|
||||
*
|
||||
* @param o Object to clone
|
||||
* @returns {{}} Clone of o
|
||||
*/
|
||||
var clone = function (o) {
|
||||
return JSON.parse(JSON.stringify(o));
|
||||
};
|
||||
|
||||
/**
|
||||
* Concatenates all arguments into a new array
|
||||
*
|
||||
* @returns {Array.<T>} New array containing all arguments
|
||||
*/
|
||||
var concat = function () {
|
||||
return Array.prototype.concat.apply([], arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* Copies all elements in an array into a new array but replacing all
|
||||
* occurrences of original with replacement.
|
||||
*
|
||||
* @param original Element to look for
|
||||
* @param replacement Element to replace with
|
||||
* @param a Array to copy
|
||||
* @returns {Array} New array with all occurrences of original replaced
|
||||
* with replacement
|
||||
*/
|
||||
var replace = function (original, replacement, a) {
|
||||
var newA = [];
|
||||
for (var i in a) {
|
||||
if (original == a[i]) {
|
||||
newA.push(replacement);
|
||||
} else {
|
||||
newA.push(a[i]);
|
||||
}
|
||||
}
|
||||
return newA;
|
||||
};
|
||||
|
||||
/**
|
||||
* Deep concatenation of two objects. For each node encountered, merge
|
||||
* the contents with the corresponding node in the other object tree,
|
||||
* treating all strings as array elements.
|
||||
*
|
||||
* @param o1 Object to concatenate
|
||||
* @param o2 Object to concatenate
|
||||
* @returns {{}} New object tree containing the concatenation of o1 and o2
|
||||
*/
|
||||
var concatObjects = function (o1, o2) {
|
||||
var ret = {};
|
||||
for (var a in o1) {
|
||||
if (o2[a] == null) {
|
||||
ret[a] = o1[a];
|
||||
}
|
||||
}
|
||||
for (var a in o2) {
|
||||
if (o1[a] == null) {
|
||||
ret[a] = o2[a];
|
||||
} else {
|
||||
if (typeof o1[a] == 'string') {
|
||||
ret[a] = [o1[a]].concat(o2[a]);
|
||||
} else if (Array.isArray(o1[a])) {
|
||||
ret[a] = o1[a].concat(o2[a]);
|
||||
} else if (typeof o1[a] == 'object') {
|
||||
ret[a] = concatObjects(o1[a], o2[a]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
@ -358,10 +358,13 @@ int main(int argc, char const ** argv)
|
||||
char *line;
|
||||
char *current;
|
||||
int i, cmd;
|
||||
DWORD exitCode;
|
||||
DWORD exitCode = 0;
|
||||
DWORD processFlags = 0;
|
||||
BOOL processInheritHandles = TRUE;
|
||||
BOOL waitForChild = TRUE;
|
||||
|
||||
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
|
||||
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
|
||||
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -386,7 +389,22 @@ int main(int argc, char const ** argv)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
i = 2;
|
||||
if (argv[2][0] == '-') {
|
||||
if (strcmp(argv[2], "--detach") == 0) {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath in detached mode\n");
|
||||
}
|
||||
processFlags |= DETACHED_PROCESS;
|
||||
processInheritHandles = FALSE;
|
||||
waitForChild = FALSE;
|
||||
} else {
|
||||
fprintf(stderr, "fixpath Unknown argument: %s\n", argv[2]);
|
||||
exit(-1);
|
||||
}
|
||||
i = 3;
|
||||
} else {
|
||||
i = 2;
|
||||
}
|
||||
|
||||
// handle assignments
|
||||
while (i < argc) {
|
||||
@ -428,6 +446,10 @@ int main(int argc, char const ** argv)
|
||||
while (i < argc) {
|
||||
char const *replaced = replace_cygdrive(argv[i]);
|
||||
if (replaced[0] == '@') {
|
||||
if (waitForChild == FALSE) {
|
||||
fprintf(stderr, "fixpath Cannot use @-files in detached mode: %s\n", replaced);
|
||||
exit(1);
|
||||
}
|
||||
// Found at-file! Fix it!
|
||||
replaced = fix_at_file(replaced);
|
||||
}
|
||||
@ -480,8 +502,8 @@ int main(int argc, char const ** argv)
|
||||
line,
|
||||
0,
|
||||
0,
|
||||
TRUE,
|
||||
0,
|
||||
processInheritHandles,
|
||||
processFlags,
|
||||
NULL,
|
||||
NULL,
|
||||
&si,
|
||||
@ -492,24 +514,30 @@ int main(int argc, char const ** argv)
|
||||
exit(126);
|
||||
}
|
||||
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess, &exitCode);
|
||||
if (waitForChild == TRUE) {
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess, &exitCode);
|
||||
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
|
||||
files_to_delete[i]);
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
|
||||
files_to_delete[i]);
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
remove(files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (exitCode != 0) {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath exit code %d\n",
|
||||
exitCode);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
remove(files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (exitCode != 0) {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath exit code %d\n",
|
||||
exitCode);
|
||||
fprintf(stderr, "fixpath Not waiting for child process");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,3 +337,5 @@ c847a53b38d2fffb87afc483c74db05eced9b4f4 jdk9-b89
|
||||
f7d70caad89ad0c43bb057bca0aad6f17ce05a6a jdk9-b92
|
||||
27e9c8d8091e2447ea7ef3e3103e9b7dd286e03a jdk9-b93
|
||||
61e9f509be0f78f0961477960f372b0533214bb8 jdk9-b94
|
||||
fd038e8a16eec80d0d6b337d74a582790ed4b3ee jdk-9+95
|
||||
feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96
|
||||
|
@ -497,3 +497,5 @@ bc48b669bc6610fac97e16593050c0f559cf6945 jdk9-b88
|
||||
53cb98d68a1aeb08d29c89d6da748de60c448e37 jdk9-b92
|
||||
d8b24776484cc4dfd19f50b23eaa18a80a161371 jdk9-b93
|
||||
a22b7c80529f5f05c847e932e017456e83c46233 jdk9-b94
|
||||
0c79cf3cdf0904fc4a630b91b32904491e1ae430 jdk-9+95
|
||||
a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
|
||||
#endif
|
||||
|
||||
#ifdef ppc64
|
||||
#if defined(ppc64) || defined(ppc64le)
|
||||
#include "sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h"
|
||||
#endif
|
||||
|
||||
@ -223,9 +223,12 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at
|
||||
verifyBitness(env, (char *) &buf);
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
char err_buf[200];
|
||||
struct ps_prochandle* ph;
|
||||
if ( (ph = Pgrab(jpid)) == NULL) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
||||
if ( (ph = Pgrab(jpid, err_buf, sizeof(err_buf))) == NULL) {
|
||||
char msg[230];
|
||||
snprintf(msg, sizeof(msg), "Can't attach to the process: %s", err_buf);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION(msg);
|
||||
}
|
||||
(*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
|
||||
fillThreadsAndLoadObjects(env, this_obj, ph);
|
||||
@ -349,7 +352,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
return (err == PS_OK)? array : 0;
|
||||
}
|
||||
|
||||
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9) | defined(ppc64) || defined(aarch64)
|
||||
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9) | defined(ppc64) || defined(ppc64le) || defined(aarch64)
|
||||
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
|
||||
(JNIEnv *env, jobject this_obj, jint lwp_id) {
|
||||
|
||||
@ -377,7 +380,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
#if defined(sparc) || defined(sparcv9)
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
|
||||
#endif
|
||||
#ifdef ppc64
|
||||
#if defined(ppc64) || defined(ppc64le)
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_NPRGREG
|
||||
#endif
|
||||
|
||||
@ -486,7 +489,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
}
|
||||
#endif /* aarch64 */
|
||||
|
||||
#ifdef ppc64
|
||||
#if defined(ppc64) || defined(ppc64le)
|
||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_##reg
|
||||
|
||||
regs[REG_INDEX(LR)] = gregs.link;
|
||||
|
@ -68,7 +68,8 @@ combination of ptrace and /proc calls.
|
||||
*************************************************************************************/
|
||||
|
||||
|
||||
#if defined(sparc) || defined(sparcv9) || defined(ppc64)
|
||||
#if defined(sparc) || defined(sparcv9) || defined(ppc64) || defined(ppc64le)
|
||||
#include <asm/ptrace.h>
|
||||
#define user_regs_struct pt_regs
|
||||
#endif
|
||||
#if defined(aarch64)
|
||||
@ -86,7 +87,7 @@ typedef int bool;
|
||||
struct ps_prochandle;
|
||||
|
||||
// attach to a process
|
||||
struct ps_prochandle* Pgrab(pid_t pid);
|
||||
struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len);
|
||||
|
||||
// attach to a core dump
|
||||
struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile);
|
||||
|
@ -215,9 +215,12 @@ static bool ptrace_waitpid(pid_t pid) {
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
static bool ptrace_attach(pid_t pid, char* err_buf, size_t err_buf_len) {
|
||||
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
char buf[200];
|
||||
char* msg = strerror_r(errno, buf, sizeof(buf));
|
||||
snprintf(err_buf, err_buf_len, "ptrace(PTRACE_ATTACH, ..) failed for %d: %s", pid, msg);
|
||||
print_debug("%s\n", err_buf);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
@ -370,16 +373,17 @@ static ps_prochandle_ops process_ops = {
|
||||
};
|
||||
|
||||
// attach to the process. One and only one exposed stuff
|
||||
struct ps_prochandle* Pgrab(pid_t pid) {
|
||||
struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len) {
|
||||
struct ps_prochandle* ph = NULL;
|
||||
thread_info* thr = NULL;
|
||||
|
||||
if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) {
|
||||
print_debug("can't allocate memory for ps_prochandle\n");
|
||||
snprintf(err_buf, err_buf_len, "can't allocate memory for ps_prochandle");
|
||||
print_debug("%s\n", err_buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ptrace_attach(pid) != true) {
|
||||
if (ptrace_attach(pid, err_buf, err_buf_len) != true) {
|
||||
free(ph);
|
||||
return NULL;
|
||||
}
|
||||
@ -402,7 +406,7 @@ struct ps_prochandle* Pgrab(pid_t pid) {
|
||||
thr = ph->threads;
|
||||
while (thr) {
|
||||
// don't attach to the main thread again
|
||||
if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id) != true) {
|
||||
if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id, err_buf, err_buf_len) != true) {
|
||||
// even if one attach fails, we get return NULL
|
||||
Prelease(ph);
|
||||
return NULL;
|
||||
|
@ -1446,7 +1446,7 @@ public class CommandProcessor {
|
||||
if (type.equals("threads")) {
|
||||
Threads threads = VM.getVM().getThreads();
|
||||
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
||||
Address base = thread.getBaseOfStackPointer();
|
||||
Address base = thread.getStackBase();
|
||||
Address end = thread.getLastJavaSP();
|
||||
if (end == null) continue;
|
||||
if (end.lessThan(base)) {
|
||||
@ -1454,11 +1454,13 @@ public class CommandProcessor {
|
||||
base = end;
|
||||
end = tmp;
|
||||
}
|
||||
out.println("Searching " + base + " " + end);
|
||||
//out.println("Searching " + base + " " + end);
|
||||
while (base != null && base.lessThan(end)) {
|
||||
Address val = base.getAddressAt(0);
|
||||
if (AddressOps.equal(val, value)) {
|
||||
out.println(base);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
thread.printThreadIDOn(new PrintStream(bos));
|
||||
out.println("found on the stack of thread " + bos.toString() + " at " + base);
|
||||
}
|
||||
base = base.addOffsetTo(stride);
|
||||
}
|
||||
@ -1601,6 +1603,8 @@ public class CommandProcessor {
|
||||
thread.printThreadIDOn(new PrintStream(bos));
|
||||
if (all || bos.toString().equals(name)) {
|
||||
out.println("Thread " + bos.toString() + " Address " + thread.getAddress());
|
||||
thread.printInfoOn(out);
|
||||
out.println(" ");
|
||||
if (!all) return;
|
||||
}
|
||||
}
|
||||
@ -1618,6 +1622,8 @@ public class CommandProcessor {
|
||||
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
||||
thread.printThreadIDOn(out);
|
||||
out.println(" " + thread.getThreadName());
|
||||
thread.printInfoOn(out);
|
||||
out.println("\n...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,10 +125,14 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
||||
}
|
||||
}
|
||||
|
||||
// close this tool without calling System.exit
|
||||
protected void closeUI() {
|
||||
workerThread.shutdown();
|
||||
frame.dispose();
|
||||
private class CloseUI extends WindowAdapter {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
workerThread.shutdown();
|
||||
frame.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void run() {
|
||||
@ -144,7 +148,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
||||
|
||||
frame = new JFrame("HSDB - HotSpot Debugger");
|
||||
frame.setSize(800, 600);
|
||||
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
frame.addWindowListener(new CloseUI());
|
||||
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
|
||||
@ -207,7 +212,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
||||
item = createMenuItem("Exit",
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
closeUI();
|
||||
workerThread.shutdown();
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
|
||||
|
@ -37,7 +37,7 @@ public class SAGetopt {
|
||||
private boolean _optreset; // special handling of first call
|
||||
|
||||
public SAGetopt(String[] args) {
|
||||
_argv = args;
|
||||
_argv = args.clone();
|
||||
_optind = 0;
|
||||
_optopt = 1;
|
||||
_optarg = null;
|
||||
|
@ -41,7 +41,8 @@ import sun.jvm.hotspot.types.TypeDataBase;
|
||||
|
||||
public class HeapRegionSetBase extends VMObject {
|
||||
|
||||
static private long countField;
|
||||
// uint _length
|
||||
static private CIntegerField lengthField;
|
||||
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
@ -54,13 +55,11 @@ public class HeapRegionSetBase extends VMObject {
|
||||
static private synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("HeapRegionSetBase");
|
||||
|
||||
countField = type.getField("_count").getOffset();
|
||||
lengthField = type.getCIntegerField("_length");
|
||||
}
|
||||
|
||||
|
||||
public HeapRegionSetCount count() {
|
||||
Address countFieldAddr = addr.addOffsetTo(countField);
|
||||
return (HeapRegionSetCount) VMObjectFactory.newObject(HeapRegionSetCount.class, countFieldAddr);
|
||||
public long length() {
|
||||
return lengthField.getValue(addr);
|
||||
}
|
||||
|
||||
public HeapRegionSetBase(Address addr) {
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.gc.g1;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
||||
import sun.jvm.hotspot.debugger.Address;
|
||||
import sun.jvm.hotspot.runtime.VM;
|
||||
import sun.jvm.hotspot.runtime.VMObject;
|
||||
import sun.jvm.hotspot.runtime.VMObjectFactory;
|
||||
import sun.jvm.hotspot.types.AddressField;
|
||||
import sun.jvm.hotspot.types.CIntegerField;
|
||||
import sun.jvm.hotspot.types.Type;
|
||||
import sun.jvm.hotspot.types.TypeDataBase;
|
||||
|
||||
// Mirror class for HeapRegionSetCount. Represents a group of regions.
|
||||
|
||||
public class HeapRegionSetCount extends VMObject {
|
||||
|
||||
static private CIntegerField lengthField;
|
||||
static private CIntegerField capacityField;
|
||||
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
public void update(Observable o, Object data) {
|
||||
initialize(VM.getVM().getTypeDataBase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static private synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("HeapRegionSetCount");
|
||||
|
||||
lengthField = type.getCIntegerField("_length");
|
||||
capacityField = type.getCIntegerField("_capacity");
|
||||
}
|
||||
|
||||
public long length() {
|
||||
return lengthField.getValue(addr);
|
||||
}
|
||||
|
||||
public long capacity() {
|
||||
return capacityField.getValue(addr);
|
||||
}
|
||||
|
||||
public HeapRegionSetCount(Address addr) {
|
||||
super(addr);
|
||||
}
|
||||
}
|
@ -416,7 +416,7 @@ public class JavaThread extends Thread {
|
||||
} else {
|
||||
tty.println("No Java frames present");
|
||||
}
|
||||
tty.println("Base of Stack: " + getBaseOfStackPointer());
|
||||
tty.println("Base of Stack: " + getStackBase());
|
||||
tty.println("Last_Java_SP: " + getLastJavaSP());
|
||||
tty.println("Last_Java_FP: " + getLastJavaFP());
|
||||
tty.println("Last_Java_PC: " + getLastJavaPC());
|
||||
|
@ -229,17 +229,17 @@ public class VM {
|
||||
|
||||
public String getValue() {
|
||||
if (isBool()) {
|
||||
return new Boolean(getBool()).toString();
|
||||
return Boolean.toString(getBool());
|
||||
} else if (isInt()) {
|
||||
return new Long(getInt()).toString();
|
||||
return Long.toString(getInt());
|
||||
} else if (isUInt()) {
|
||||
return new Long(getUInt()).toString();
|
||||
return Long.toString(getUInt());
|
||||
} else if (isIntx()) {
|
||||
return new Long(getIntx()).toString();
|
||||
return Long.toString(getIntx());
|
||||
} else if (isUIntx()) {
|
||||
return new Long(getUIntx()).toString();
|
||||
return Long.toString(getUIntx());
|
||||
} else if (isSizet()) {
|
||||
return new Long(getSizet()).toString();
|
||||
return Long.toString(getSizet());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -112,8 +112,7 @@ public class HeapSummary extends Tool {
|
||||
long survivorRegionNum = g1mm.survivorRegionNum();
|
||||
HeapRegionSetBase oldSet = g1h.oldSet();
|
||||
HeapRegionSetBase humongousSet = g1h.humongousSet();
|
||||
long oldRegionNum = oldSet.count().length()
|
||||
+ humongousSet.count().capacity() / HeapRegion.grainBytes();
|
||||
long oldRegionNum = oldSet.length() + humongousSet.length();
|
||||
printG1Space("G1 Heap:", g1h.n_regions(),
|
||||
g1h.used(), g1h.capacity());
|
||||
System.out.println("G1 Young Generation:");
|
||||
|
@ -1921,6 +1921,15 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
|
||||
buf.link(genPCHref(addressToLong(pc)), pc.toString());
|
||||
}
|
||||
|
||||
if (!method.isStatic() && !method.isNative()) {
|
||||
OopHandle oopHandle = vf.getLocals().oopHandleAt(0);
|
||||
|
||||
if (oopHandle != null) {
|
||||
buf.append(", oop = ");
|
||||
buf.append(oopHandle.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (vf.isCompiledFrame()) {
|
||||
buf.append(" (Compiled");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class PlatformInfo {
|
||||
|
||||
public static boolean knownCPU(String cpu) {
|
||||
final String[] KNOWN =
|
||||
new String[] {"i386", "x86", "x86_64", "amd64", "sparc", "sparcv9", "ppc64", "aarch64"};
|
||||
new String[] {"i386", "x86", "x86_64", "amd64", "sparc", "sparcv9", "ppc64", "ppc64le", "aarch64"};
|
||||
|
||||
for(String s : KNOWN) {
|
||||
if(s.equals(cpu))
|
||||
@ -98,6 +98,9 @@ public class PlatformInfo {
|
||||
if (cpu.equals("x86_64"))
|
||||
return "amd64";
|
||||
|
||||
if (cpu.equals("ppc64le"))
|
||||
return "ppc64";
|
||||
|
||||
return cpu;
|
||||
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ CFLAGS += $(VM_PICFLAG)
|
||||
CFLAGS += -qnortti
|
||||
CFLAGS += -qnoeh
|
||||
|
||||
# for compiler-level tls
|
||||
CFLAGS += -qtls=default
|
||||
|
||||
CFLAGS += -D_REENTRANT
|
||||
# no xlc counterpart for -fcheck-new
|
||||
# CFLAGS += -fcheck-new
|
||||
|
@ -277,7 +277,7 @@ ifneq ($(OSNAME),windows)
|
||||
|
||||
# Use uname output for SRCARCH, but deal with platform differences. If ARCH
|
||||
# is not explicitly listed below, it is treated as x86.
|
||||
SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 aarch64 zero,$(ARCH)))
|
||||
SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 ppc64le aarch64 zero,$(ARCH)))
|
||||
ARCH/ = x86
|
||||
ARCH/sparc = sparc
|
||||
ARCH/sparc64= sparc
|
||||
@ -285,6 +285,7 @@ ifneq ($(OSNAME),windows)
|
||||
ARCH/amd64 = x86
|
||||
ARCH/x86_64 = x86
|
||||
ARCH/ppc64 = ppc
|
||||
ARCH/ppc64le= ppc
|
||||
ARCH/ppc = ppc
|
||||
ARCH/aarch64= aarch64
|
||||
ARCH/zero = zero
|
||||
@ -309,8 +310,13 @@ ifneq ($(OSNAME),windows)
|
||||
endif
|
||||
endif
|
||||
|
||||
# LIBARCH is 1:1 mapping from BUILDARCH
|
||||
LIBARCH ?= $(LIBARCH/$(BUILDARCH))
|
||||
# LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le
|
||||
ifeq ($(ARCH),ppc64le)
|
||||
LIBARCH ?= ppc64le
|
||||
else
|
||||
LIBARCH ?= $(LIBARCH/$(BUILDARCH))
|
||||
endif
|
||||
|
||||
LIBARCH/i486 = i386
|
||||
LIBARCH/amd64 = amd64
|
||||
LIBARCH/sparc = sparc
|
||||
|
@ -260,6 +260,13 @@ endif
|
||||
|
||||
OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
|
||||
|
||||
# Variable tracking size limit exceeded for VMStructs::init()
|
||||
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "1"
|
||||
# GCC >= 4.3
|
||||
# Gcc 4.1.2 does not support this flag, nor does it have problems compiling the file.
|
||||
OPT_CFLAGS/vmStructs.o += -fno-var-tracking-assignments
|
||||
endif
|
||||
|
||||
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
|
||||
# if we use expensive-optimizations
|
||||
ifeq ($(BUILDARCH), ia64)
|
||||
|
@ -58,14 +58,17 @@ define_pd_global(intx, InlineFrequencyCount, 100);
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5))
|
||||
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||
|
||||
#define MIN_STACK_YELLOW_PAGES 1
|
||||
#define MIN_STACK_RED_PAGES 1
|
||||
#define MIN_STACK_SHADOW_PAGES 1
|
||||
#define MIN_STACK_RESERVED_PAGES (0)
|
||||
|
||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||
|
||||
define_pd_global(bool, RewriteBytecodes, true);
|
||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -39,7 +39,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -260,20 +259,3 @@ address InterpreterGenerator::generate_abstract_entry(void) {
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
|
||||
|
||||
// This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
|
||||
// the days we had adapter frames. When we deoptimize a situation where a
|
||||
// compiled caller calls a compiled caller will have registers it expects
|
||||
// to survive the call to the callee. If we deoptimize the callee the only
|
||||
// way we can restore these registers is to have the oldest interpreter
|
||||
// frame that we create restore these values. That is what this routine
|
||||
// will accomplish.
|
||||
|
||||
// At the moment we have modified c2 to not have any callee save registers
|
||||
// so this problem does not exist and this routine is just a place holder.
|
||||
|
||||
assert(f->is_interpreted_frame(), "must be interpreted");
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "runtime/icache.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||
@ -4653,3 +4654,23 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
|
||||
BIND(DONE);
|
||||
sub(result, result, len); // Return index where we stopped
|
||||
}
|
||||
|
||||
// get_thread() can be called anywhere inside generated code so we
|
||||
// need to save whatever non-callee save context might get clobbered
|
||||
// by the call to JavaThread::aarch64_get_thread_helper() or, indeed,
|
||||
// the call setup code.
|
||||
//
|
||||
// aarch64_get_thread_helper() clobbers only r0, r1, and flags.
|
||||
//
|
||||
void MacroAssembler::get_thread(Register dst) {
|
||||
RegSet saved_regs = RegSet::range(r0, r1) + lr - dst;
|
||||
push(saved_regs, sp);
|
||||
|
||||
mov(lr, CAST_FROM_FN_PTR(address, JavaThread::aarch64_get_thread_helper));
|
||||
blrt(lr, 1, 0, 1);
|
||||
if (dst != c_rarg0) {
|
||||
mov(dst, c_rarg0);
|
||||
}
|
||||
|
||||
pop(saved_regs, sp);
|
||||
}
|
||||
|
@ -2319,7 +2319,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// c_rarg4 - input length
|
||||
//
|
||||
// Output:
|
||||
// r0 - input length
|
||||
// r0 - input length
|
||||
//
|
||||
address generate_cipherBlockChaining_decryptAESCrypt() {
|
||||
assert(UseAES, "need AES instructions and misaligned SSE support");
|
||||
@ -2381,7 +2381,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ br(Assembler::EQ, L_rounds_52);
|
||||
|
||||
__ aesd(v0, v17); __ aesimc(v0, v0);
|
||||
__ aesd(v0, v17); __ aesimc(v0, v0);
|
||||
__ aesd(v0, v18); __ aesimc(v0, v0);
|
||||
__ BIND(L_rounds_52);
|
||||
__ aesd(v0, v19); __ aesimc(v0, v0);
|
||||
__ aesd(v0, v20); __ aesimc(v0, v0);
|
||||
|
1925
hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
Normal file
1925
hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -43,4 +43,9 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
|
||||
// The expected size in bytes of a cache line, used to pad data structures.
|
||||
#define DEFAULT_CACHE_LINE_SIZE 128
|
||||
|
||||
#if defined(COMPILER2) && defined(AIX)
|
||||
// Include Transactional Memory lock eliding optimization
|
||||
#define INCLUDE_RTM_OPT 1
|
||||
#endif
|
||||
|
||||
#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
||||
|
@ -44,14 +44,17 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs pas
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (6)
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2))
|
||||
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||
|
||||
#define MIN_STACK_YELLOW_PAGES (1)
|
||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||
#define MIN_STACK_SHADOW_PAGES (1)
|
||||
#define MIN_STACK_RESERVED_PAGES (0)
|
||||
|
||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||
|
||||
// Use large code-entry alignment.
|
||||
define_pd_global(intx, CodeEntryAlignment, 128);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -61,26 +60,6 @@
|
||||
|
||||
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
|
||||
|
||||
int AbstractInterpreter::BasicType_as_index(BasicType type) {
|
||||
int i = 0;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: i = 0; break;
|
||||
case T_CHAR : i = 1; break;
|
||||
case T_BYTE : i = 2; break;
|
||||
case T_SHORT : i = 3; break;
|
||||
case T_INT : i = 4; break;
|
||||
case T_LONG : i = 5; break;
|
||||
case T_VOID : i = 6; break;
|
||||
case T_FLOAT : i = 7; break;
|
||||
case T_DOUBLE : i = 8; break;
|
||||
case T_OBJECT : i = 9; break;
|
||||
case T_ARRAY : i = 9; break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
|
||||
return i;
|
||||
}
|
||||
|
||||
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
|
||||
// Slow_signature handler that respects the PPC C calling conventions.
|
||||
//
|
||||
@ -579,18 +558,3 @@ address InterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
|
||||
// This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
|
||||
// the days we had adapter frames. When we deoptimize a situation where a
|
||||
// compiled caller calls a compiled caller will have registers it expects
|
||||
// to survive the call to the callee. If we deoptimize the callee the only
|
||||
// way we can restore these registers is to have the oldest interpreter
|
||||
// frame that we create restore these values. That is what this routine
|
||||
// will accomplish.
|
||||
|
||||
// At the moment we have modified c2 to not have any callee save registers
|
||||
// so this problem does not exist and this routine is just a place holder.
|
||||
|
||||
assert(f->is_interpreted_frame(), "must be interpreted");
|
||||
}
|
||||
|
@ -50,12 +50,29 @@
|
||||
// to be 'vtbl_list_size' instances of the vtable in order to
|
||||
// differentiate between the 'vtable_list_size' original Klass objects.
|
||||
|
||||
#define __ masm->
|
||||
|
||||
void MetaspaceShared::generate_vtable_methods(void** vtbl_list,
|
||||
void** vtable,
|
||||
char** md_top,
|
||||
char* md_end,
|
||||
char** mc_top,
|
||||
char* mc_end) {
|
||||
Unimplemented();
|
||||
intptr_t vtable_bytes = (num_virtuals * vtbl_list_size) * sizeof(void*);
|
||||
*(intptr_t *)(*md_top) = vtable_bytes;
|
||||
*md_top += sizeof(intptr_t);
|
||||
void** dummy_vtable = (void**)*md_top;
|
||||
*vtable = dummy_vtable;
|
||||
*md_top += vtable_bytes;
|
||||
|
||||
// Get ready to generate dummy methods.
|
||||
|
||||
CodeBuffer cb((unsigned char*)*mc_top, mc_end - *mc_top);
|
||||
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||
|
||||
// There are more general problems with CDS on ppc, so I can not
|
||||
// really test this. But having this instead of Unimplementd() allows
|
||||
// us to pass TestOptionsWithRanges.java.
|
||||
__ unimplemented();
|
||||
}
|
||||
|
||||
|
1798
hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
Normal file
1798
hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2013, 2015 SAP AG. All rights reserved.
|
||||
* Copyright (c) 2013, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,12 +28,15 @@
|
||||
|
||||
protected:
|
||||
|
||||
// Size of interpreter code. Increase if too small. Interpreter will
|
||||
// Size of interpreter code. Increase if too small. Interpreter will
|
||||
// fail with a guarantee ("not enough space for interpreter generation");
|
||||
// if too small.
|
||||
// Run with +PrintInterpreter to get the VM to print out the size.
|
||||
// Max size with JVMTI
|
||||
|
||||
const static int InterpreterCodeSize = 230*K;
|
||||
|
||||
public:
|
||||
// Support abs and sqrt like in compiler.
|
||||
// For others we can use a normal (native) entry.
|
||||
static bool math_entry_available(AbstractInterpreter::MethodKind kind);
|
||||
#endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP
|
||||
|
@ -229,12 +229,27 @@ void VM_Version::initialize() {
|
||||
}
|
||||
|
||||
// Adjust RTM (Restricted Transactional Memory) flags.
|
||||
if (!has_tcheck() && UseRTMLocking) {
|
||||
if (UseRTMLocking) {
|
||||
// If CPU or OS are too old:
|
||||
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
||||
// setting during arguments processing. See use_biased_locking().
|
||||
// VM_Version_init() is executed after UseBiasedLocking is used
|
||||
// in Thread::allocate().
|
||||
vm_exit_during_initialization("RTM instructions are not available on this CPU");
|
||||
if (!has_tcheck()) {
|
||||
vm_exit_during_initialization("RTM instructions are not available on this CPU");
|
||||
}
|
||||
bool os_too_old = true;
|
||||
#ifdef AIX
|
||||
if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30
|
||||
os_too_old = false;
|
||||
}
|
||||
#endif
|
||||
#ifdef linux
|
||||
// TODO: check kernel version (we currently have too old versions only)
|
||||
#endif
|
||||
if (os_too_old) {
|
||||
vm_exit_during_initialization("RTM is not supported on this OS version.");
|
||||
}
|
||||
}
|
||||
|
||||
if (UseRTMLocking) {
|
||||
|
@ -1453,6 +1453,9 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
|
||||
|
||||
|
||||
void LIR_Assembler::return_op(LIR_Opr result) {
|
||||
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
|
||||
__ reserved_stack_check();
|
||||
}
|
||||
// the poll may need a register so just pick one that isn't the return register
|
||||
#if defined(TIERED) && !defined(_LP64)
|
||||
if (result->type_field() == LIR_OprDesc::long_type) {
|
||||
|
@ -632,7 +632,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// stack frames shouldn't be much larger than max_stack elements
|
||||
|
||||
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
|
||||
if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -58,4 +58,8 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SOLARIS)
|
||||
#define SUPPORT_RESERVED_STACK_AREA
|
||||
#endif
|
||||
|
||||
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
|
||||
|
@ -54,6 +54,7 @@ define_pd_global(intx, InlineSmallCode, 1500);
|
||||
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
#define DEFAULT_STACK_RESERVED_PAGES (SOLARIS_ONLY(1) NOT_SOLARIS(0))
|
||||
|
||||
#ifdef _LP64
|
||||
// Stack slots are 2X larger in LP64 than in the 32 bit VM.
|
||||
@ -69,10 +70,12 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
||||
#define MIN_STACK_RESERVED_PAGES (0)
|
||||
|
||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||
|
||||
define_pd_global(bool, RewriteBytecodes, true);
|
||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||
|
@ -1140,6 +1140,19 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
|
||||
// save result (push state before jvmti call and pop it afterwards) and notify jvmti
|
||||
notify_method_exit(false, state, NotifyJVMTI);
|
||||
|
||||
if (StackReservedPages > 0) {
|
||||
// testing if Stack Reserved Area needs to be re-enabled
|
||||
Label no_reserved_zone_enabling;
|
||||
ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G3_scratch);
|
||||
cmp_and_brx_short(SP, G3_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling);
|
||||
|
||||
call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread);
|
||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError), G2_thread);
|
||||
should_not_reach_here();
|
||||
|
||||
bind(no_reserved_zone_enabling);
|
||||
}
|
||||
|
||||
interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
|
||||
verify_thread();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -62,30 +61,6 @@
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
int AbstractInterpreter::BasicType_as_index(BasicType type) {
|
||||
int i = 0;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: i = 0; break;
|
||||
case T_CHAR : i = 1; break;
|
||||
case T_BYTE : i = 2; break;
|
||||
case T_SHORT : i = 3; break;
|
||||
case T_INT : i = 4; break;
|
||||
case T_LONG : i = 5; break;
|
||||
case T_VOID : i = 6; break;
|
||||
case T_FLOAT : i = 7; break;
|
||||
case T_DOUBLE : i = 8; break;
|
||||
case T_OBJECT : i = 9; break;
|
||||
case T_ARRAY : i = 9; break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
#ifndef _LP64
|
||||
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
|
||||
address entry = __ pc();
|
||||
@ -254,28 +229,3 @@ address InterpreterGenerator::generate_abstract_entry(void) {
|
||||
return entry;
|
||||
|
||||
}
|
||||
|
||||
bool AbstractInterpreter::can_be_compiled(methodHandle m) {
|
||||
// No special entry points that preclude compilation
|
||||
return true;
|
||||
}
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
|
||||
|
||||
// This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
|
||||
// the days we had adapter frames. When we deoptimize a situation where a
|
||||
// compiled caller calls a compiled caller will have registers it expects
|
||||
// to survive the call to the callee. If we deoptimize the callee the only
|
||||
// way we can restore these registers is to have the oldest interpreter
|
||||
// frame that we create restore these values. That is what this routine
|
||||
// will accomplish.
|
||||
|
||||
// At the moment we have modified c2 to not have any callee save registers
|
||||
// so this problem does not exist and this routine is just a place holder.
|
||||
|
||||
assert(f->is_interpreted_frame(), "must be interpreted");
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Exceptions
|
||||
|
@ -347,10 +347,10 @@ void MacroAssembler::leave() {
|
||||
#ifdef ASSERT
|
||||
// a hook for debugging
|
||||
static Thread* reinitialize_thread() {
|
||||
return ThreadLocalStorage::thread();
|
||||
return Thread::current();
|
||||
}
|
||||
#else
|
||||
#define reinitialize_thread ThreadLocalStorage::thread
|
||||
#define reinitialize_thread Thread::current
|
||||
#endif
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -380,7 +380,7 @@ void MacroAssembler::get_thread() {
|
||||
}
|
||||
|
||||
static Thread* verify_thread_subroutine(Thread* gthread_value) {
|
||||
Thread* correct_value = ThreadLocalStorage::thread();
|
||||
Thread* correct_value = Thread::current();
|
||||
guarantee(gthread_value == correct_value, "G2_thread value must be the thread");
|
||||
return correct_value;
|
||||
}
|
||||
@ -3587,6 +3587,24 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp,
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::reserved_stack_check() {
|
||||
// testing if reserved zone needs to be enabled
|
||||
Label no_reserved_zone_enabling;
|
||||
|
||||
ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G4_scratch);
|
||||
cmp_and_brx_short(SP, G4_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling);
|
||||
|
||||
call_VM_leaf(L0, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread);
|
||||
|
||||
AddressLiteral stub(StubRoutines::throw_delayed_StackOverflowError_entry());
|
||||
jump_to(stub, G4_scratch);
|
||||
delayed()->restore();
|
||||
|
||||
should_not_reach_here();
|
||||
|
||||
bind(no_reserved_zone_enabling);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
#if INCLUDE_ALL_GCS
|
||||
|
||||
|
@ -1392,6 +1392,9 @@ public:
|
||||
// stack overflow + shadow pages. Clobbers tsp and scratch registers.
|
||||
void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch);
|
||||
|
||||
// Check for reserved stack access in method being exited (for JIT)
|
||||
void reserved_stack_check();
|
||||
|
||||
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset);
|
||||
|
||||
void verify_tlab();
|
||||
|
@ -52,7 +52,7 @@
|
||||
|
||||
inline void fill_subword(void* start, void* end, int value) {
|
||||
STATIC_ASSERT(BytesPerWord == 8);
|
||||
assert(pointer_delta(end, start, 1) < BytesPerWord, "precondition");
|
||||
assert(pointer_delta(end, start, 1) < (size_t)BytesPerWord, "precondition");
|
||||
// Dispatch on (end - start).
|
||||
void* pc;
|
||||
__asm__ volatile(
|
||||
@ -73,10 +73,10 @@ inline void fill_subword(void* start, void* end, int value) {
|
||||
" stb %[value], [%[end]-3]\n\t"
|
||||
" stb %[value], [%[end]-2]\n\t"
|
||||
" stb %[value], [%[end]-1]\n\t" // end[-1] = value
|
||||
: /* no outputs */
|
||||
[pc] "&=r" (pc) // temp
|
||||
: [offset] "&+r" (start),
|
||||
[end] "r" (end),
|
||||
: /* only temporaries/overwritten outputs */
|
||||
[pc] "=&r" (pc), // temp
|
||||
[offset] "+&r" (start)
|
||||
: [end] "r" (end),
|
||||
[value] "r" (value)
|
||||
: "memory");
|
||||
}
|
||||
@ -84,7 +84,7 @@ inline void fill_subword(void* start, void* end, int value) {
|
||||
void memset_with_concurrent_readers(void* to, int value, size_t size) {
|
||||
Prefetch::write(to, 0);
|
||||
void* end = static_cast<char*>(to) + size;
|
||||
if (size >= BytesPerWord) {
|
||||
if (size >= (size_t)BytesPerWord) {
|
||||
// Fill any partial word prefix.
|
||||
uintx* aligned_to = static_cast<uintx*>(align_ptr_up(to, BytesPerWord));
|
||||
fill_subword(to, aligned_to, value);
|
||||
@ -144,10 +144,10 @@ void memset_with_concurrent_readers(void* to, int value, size_t size) {
|
||||
" stx %[xvalue], [%[aend]-24]\n\t"
|
||||
" stx %[xvalue], [%[aend]-16]\n\t"
|
||||
" stx %[xvalue], [%[aend]-8]\n\t" // aligned_end[-1] = xvalue
|
||||
: /* no outputs */
|
||||
[temp] "&=r" (temp)
|
||||
: [ato] "&+r" (aligned_to),
|
||||
[aend] "r" (aligned_end),
|
||||
: /* only temporaries/overwritten outputs */
|
||||
[temp] "=&r" (temp),
|
||||
[ato] "+&r" (aligned_to)
|
||||
: [aend] "r" (aligned_end),
|
||||
[xvalue] "r" (xvalue)
|
||||
: "cc", "memory");
|
||||
to = aligned_end; // setup for suffix
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -434,7 +434,7 @@ void NativeMovConstReg32::verify() {
|
||||
|
||||
|
||||
void NativeMovConstReg32::print() {
|
||||
tty->print_cr(INTPTR_FORMAT ": mov reg, " INTPTR_FORMAT, instruction_address(), data());
|
||||
tty->print_cr(INTPTR_FORMAT ": mov reg, " INTPTR_FORMAT, p2i(instruction_address()), data());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1294,6 +1294,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
__ verify_thread();
|
||||
|
||||
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||
__ reserved_stack_check();
|
||||
}
|
||||
|
||||
// If this does safepoint polling, then do it here
|
||||
if(do_polling() && ra_->C->is_method_compilation()) {
|
||||
AddressLiteral polling_page(os::get_polling_page());
|
||||
@ -1651,6 +1655,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf,
|
||||
#endif // !_LP64
|
||||
|
||||
Unimplemented();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
@ -5355,7 +5355,12 @@ class StubGenerator: public StubCodeGenerator {
|
||||
#endif // COMPILER2 !=> _LP64
|
||||
|
||||
// Build this early so it's available for the interpreter.
|
||||
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||
StubRoutines::_throw_StackOverflowError_entry =
|
||||
generate_throw_exception("StackOverflowError throw_exception",
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||
StubRoutines::_throw_delayed_StackOverflowError_entry =
|
||||
generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError));
|
||||
|
||||
if (UseCRC32Intrinsics) {
|
||||
// set table address before stub generation which use it
|
||||
|
@ -36,7 +36,7 @@ extern "C" {
|
||||
address _flush_reg_windows(); // in .s file.
|
||||
// Flush registers to stack. In case of error we will need to stack walk.
|
||||
address bootstrap_flush_windows(void) {
|
||||
Thread* thread = ThreadLocalStorage::get_thread_slow();
|
||||
Thread* thread = Thread::current_or_null();
|
||||
// Very early in process there is no thread.
|
||||
if (thread != NULL) {
|
||||
guarantee(thread->is_Java_thread(), "Not a Java thread.");
|
||||
|
1832
hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
Normal file
1832
hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,10 @@ const char* VM_Version::_features_str = "";
|
||||
unsigned int VM_Version::_L2_data_cache_line_size = 0;
|
||||
|
||||
void VM_Version::initialize() {
|
||||
_features = determine_features();
|
||||
|
||||
assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete.");
|
||||
guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
|
||||
|
||||
PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
|
||||
PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
|
||||
PrefetchFieldsAhead = prefetch_fields_ahead();
|
||||
@ -60,8 +63,6 @@ void VM_Version::initialize() {
|
||||
FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
|
||||
}
|
||||
|
||||
guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
|
||||
|
||||
UseSSE = 0; // Only on x86 and x64
|
||||
|
||||
_supports_cx8 = has_v9();
|
||||
|
@ -128,6 +128,8 @@ public:
|
||||
// Initialization
|
||||
static void initialize();
|
||||
|
||||
static void init_before_ergo() { _features = determine_features(); }
|
||||
|
||||
// Instruction support
|
||||
static bool has_v8() { return (_features & v8_instructions_m) != 0; }
|
||||
static bool has_v9() { return (_features & v9_instructions_m) != 0; }
|
||||
|
@ -518,6 +518,10 @@ void LIR_Assembler::return_op(LIR_Opr result) {
|
||||
// Pop the stack before the safepoint code
|
||||
__ remove_frame(initial_frame_size_in_bytes());
|
||||
|
||||
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
|
||||
__ reserved_stack_check();
|
||||
}
|
||||
|
||||
bool result_is_oop = result->is_valid() ? result->is_oop() : false;
|
||||
|
||||
// Note: we do not need to round double result; float result has the right precision
|
||||
|
@ -61,4 +61,8 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
#define INCLUDE_RTM_OPT 1
|
||||
#endif
|
||||
|
||||
#if defined(LINUX) || defined(SOLARIS) || defined(__APPLE__)
|
||||
#define SUPPORT_RESERVED_STACK_AREA
|
||||
#endif
|
||||
|
||||
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
|
||||
|
@ -57,9 +57,11 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (NOT_WINDOWS(2) WINDOWS_ONLY(3))
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
#define DEFAULT_STACK_RESERVED_PAGES (NOT_WINDOWS(1) WINDOWS_ONLY(0))
|
||||
|
||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||
#define MIN_STACK_RESERVED_PAGES (0)
|
||||
|
||||
#ifdef AMD64
|
||||
// Very large C++ stack frames using solaris-amd64 optimized builds
|
||||
@ -76,6 +78,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||
|
||||
define_pd_global(bool, RewriteBytecodes, true);
|
||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||
|
@ -1023,6 +1023,25 @@ void InterpreterMacroAssembler::remove_activation(
|
||||
// get sender sp
|
||||
movptr(rbx,
|
||||
Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
|
||||
if (StackReservedPages > 0) {
|
||||
// testing if reserved zone needs to be re-enabled
|
||||
Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
|
||||
Label no_reserved_zone_enabling;
|
||||
|
||||
NOT_LP64(get_thread(rthread);)
|
||||
|
||||
cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
|
||||
jcc(Assembler::lessEqual, no_reserved_zone_enabling);
|
||||
|
||||
call_VM_leaf(
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
|
||||
push(rthread);
|
||||
call_VM(noreg, CAST_FROM_FN_PTR(address,
|
||||
InterpreterRuntime::throw_delayed_StackOverflowError));
|
||||
should_not_reach_here();
|
||||
|
||||
bind(no_reserved_zone_enabling);
|
||||
}
|
||||
leave(); // remove frame anchor
|
||||
pop(ret_addr); // get return address
|
||||
mov(rsp, rbx); // set sp to sender sp
|
||||
|
@ -175,6 +175,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
|
||||
// NULL last_sp until next java call
|
||||
movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
||||
NOT_LP64(empty_FPU_stack());
|
||||
}
|
||||
|
||||
// Helpers for swap and dup
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -184,20 +183,3 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
|
||||
|
||||
// This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
|
||||
// the days we had adapter frames. When we deoptimize a situation where a
|
||||
// compiled caller calls a compiled caller will have registers it expects
|
||||
// to survive the call to the callee. If we deoptimize the callee the only
|
||||
// way we can restore these registers is to have the oldest interpreter
|
||||
// frame that we create restore these values. That is what this routine
|
||||
// will accomplish.
|
||||
|
||||
// At the moment we have modified c2 to not have any callee save registers
|
||||
// so this problem does not exist and this routine is just a place holder.
|
||||
|
||||
assert(f->is_interpreted_frame(), "must be interpreted");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -298,19 +297,3 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
|
||||
|
||||
// This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
|
||||
// the days we had adapter frames. When we deoptimize a situation where a
|
||||
// compiled caller calls a compiled caller will have registers it expects
|
||||
// to survive the call to the callee. If we deoptimize the callee the only
|
||||
// way we can restore these registers is to have the oldest interpreter
|
||||
// frame that we create restore these values. That is what this routine
|
||||
// will accomplish.
|
||||
|
||||
// At the moment we have modified c2 to not have any callee save registers
|
||||
// so this problem does not exist and this routine is just a place holder.
|
||||
|
||||
assert(f->is_interpreted_frame(), "must be interpreted");
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||
@ -1066,6 +1067,22 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::reserved_stack_check() {
|
||||
// testing if reserved zone needs to be enabled
|
||||
Label no_reserved_zone_enabling;
|
||||
Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread);
|
||||
NOT_LP64(get_thread(rsi);)
|
||||
|
||||
cmpptr(rsp, Address(thread, JavaThread::reserved_stack_activation_offset()));
|
||||
jcc(Assembler::below, no_reserved_zone_enabling);
|
||||
|
||||
call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), thread);
|
||||
jump(RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry()));
|
||||
should_not_reach_here();
|
||||
|
||||
bind(no_reserved_zone_enabling);
|
||||
}
|
||||
|
||||
int MacroAssembler::biased_locking_enter(Register lock_reg,
|
||||
Register obj_reg,
|
||||
Register swap_reg,
|
||||
@ -11072,3 +11089,43 @@ SkipIfEqual::SkipIfEqual(
|
||||
SkipIfEqual::~SkipIfEqual() {
|
||||
_masm->bind(_label);
|
||||
}
|
||||
|
||||
// 32-bit Windows has its own fast-path implementation
|
||||
// of get_thread
|
||||
#if !defined(WIN32) || defined(_LP64)
|
||||
|
||||
// This is simply a call to Thread::current()
|
||||
void MacroAssembler::get_thread(Register thread) {
|
||||
if (thread != rax) {
|
||||
push(rax);
|
||||
}
|
||||
LP64_ONLY(push(rdi);)
|
||||
LP64_ONLY(push(rsi);)
|
||||
push(rdx);
|
||||
push(rcx);
|
||||
#ifdef _LP64
|
||||
push(r8);
|
||||
push(r9);
|
||||
push(r10);
|
||||
push(r11);
|
||||
#endif
|
||||
|
||||
MacroAssembler::call_VM_leaf_base(CAST_FROM_FN_PTR(address, Thread::current), 0);
|
||||
|
||||
#ifdef _LP64
|
||||
pop(r11);
|
||||
pop(r10);
|
||||
pop(r9);
|
||||
pop(r8);
|
||||
#endif
|
||||
pop(rcx);
|
||||
pop(rdx);
|
||||
LP64_ONLY(pop(rsi);)
|
||||
LP64_ONLY(pop(rdi);)
|
||||
if (thread != rax) {
|
||||
mov(thread, rax);
|
||||
pop(rax);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -641,6 +641,9 @@ class MacroAssembler: public Assembler {
|
||||
// stack overflow + shadow pages. Also, clobbers tmp
|
||||
void bang_stack_size(Register size, Register tmp);
|
||||
|
||||
// Check for reserved stack access in method being exited (for JIT)
|
||||
void reserved_stack_check();
|
||||
|
||||
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
|
||||
Register tmp,
|
||||
int offset);
|
||||
|
@ -3290,7 +3290,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
|
||||
|
||||
// Build this early so it's available for the interpreter
|
||||
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception",
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||
StubRoutines::_throw_delayed_StackOverflowError_entry = generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||
CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError));
|
||||
|
||||
if (UseCRC32Intrinsics) {
|
||||
// set table address before stub generation which use it
|
||||
|
@ -4458,6 +4458,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
CAST_FROM_FN_PTR(address,
|
||||
SharedRuntime::
|
||||
throw_StackOverflowError));
|
||||
StubRoutines::_throw_delayed_StackOverflowError_entry =
|
||||
generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||
CAST_FROM_FN_PTR(address,
|
||||
SharedRuntime::
|
||||
throw_delayed_StackOverflowError));
|
||||
if (UseCRC32Intrinsics) {
|
||||
// set table address before stub generation which use it
|
||||
StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
|
||||
|
File diff suppressed because it is too large
Load Diff
305
hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp
Normal file
305
hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp
Normal file
@ -0,0 +1,305 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterGenerator.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
|
||||
#ifndef CC_INTERP
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32.update(int crc, int b)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32_update_entry() {
|
||||
if (UseCRC32Intrinsics) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rbx: Method*
|
||||
// rsi: senderSP must preserved for slow path, set SP to it on fast path
|
||||
// rdx: scratch
|
||||
// rdi: scratch
|
||||
|
||||
Label slow_path;
|
||||
// If we need a safepoint check, generate full interpreter entry.
|
||||
ExternalAddress state(SafepointSynchronize::address_of_state());
|
||||
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
|
||||
SafepointSynchronize::_not_synchronized);
|
||||
__ jcc(Assembler::notEqual, slow_path);
|
||||
|
||||
// We don't generate local frame and don't align stack because
|
||||
// we call stub code and there is no safepoint on this path.
|
||||
|
||||
// Load parameters
|
||||
const Register crc = rax; // crc
|
||||
const Register val = rdx; // source java byte value
|
||||
const Register tbl = rdi; // scratch
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(val, Address(rsp, wordSize)); // byte value
|
||||
__ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC
|
||||
|
||||
__ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr()));
|
||||
__ notl(crc); // ~crc
|
||||
__ update_byte_crc32(crc, val, tbl);
|
||||
__ notl(crc); // ~crc
|
||||
// result in rax
|
||||
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
// generate a vanilla native entry as the slow path
|
||||
__ bind(slow_path);
|
||||
__ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
|
||||
return entry;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
|
||||
* int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
|
||||
if (UseCRC32Intrinsics) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rbx,: Method*
|
||||
// rsi: senderSP must preserved for slow path, set SP to it on fast path
|
||||
// rdx: scratch
|
||||
// rdi: scratch
|
||||
|
||||
Label slow_path;
|
||||
// If we need a safepoint check, generate full interpreter entry.
|
||||
ExternalAddress state(SafepointSynchronize::address_of_state());
|
||||
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
|
||||
SafepointSynchronize::_not_synchronized);
|
||||
__ jcc(Assembler::notEqual, slow_path);
|
||||
|
||||
// We don't generate local frame and don't align stack because
|
||||
// we call stub code and there is no safepoint on this path.
|
||||
|
||||
// Load parameters
|
||||
const Register crc = rax; // crc
|
||||
const Register buf = rdx; // source java byte array address
|
||||
const Register len = rdi; // length
|
||||
|
||||
// value x86_32
|
||||
// interp. arg ptr ESP + 4
|
||||
// int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
|
||||
// 3 2 1 0
|
||||
// int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
|
||||
// 4 2,3 1 0
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(len, Address(rsp, 4 + 0)); // Length
|
||||
// Calculate address of start element
|
||||
if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
|
||||
__ movptr(buf, Address(rsp, 4 + 2 * wordSize)); // long buf
|
||||
__ addptr(buf, Address(rsp, 4 + 1 * wordSize)); // + offset
|
||||
__ movl(crc, Address(rsp, 4 + 4 * wordSize)); // Initial CRC
|
||||
} else {
|
||||
__ movptr(buf, Address(rsp, 4 + 2 * wordSize)); // byte[] array
|
||||
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
|
||||
__ addptr(buf, Address(rsp, 4 + 1 * wordSize)); // + offset
|
||||
__ movl(crc, Address(rsp, 4 + 3 * wordSize)); // Initial CRC
|
||||
}
|
||||
|
||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len);
|
||||
// result in rax
|
||||
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
// generate a vanilla native entry as the slow path
|
||||
__ bind(slow_path);
|
||||
__ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
|
||||
return entry;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end)
|
||||
* int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
|
||||
if (UseCRC32CIntrinsics) {
|
||||
address entry = __ pc();
|
||||
// Load parameters
|
||||
const Register crc = rax; // crc
|
||||
const Register buf = rcx; // source java byte array address
|
||||
const Register len = rdx; // length
|
||||
const Register end = len;
|
||||
|
||||
// value x86_32
|
||||
// interp. arg ptr ESP + 4
|
||||
// int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int end)
|
||||
// 3 2 1 0
|
||||
// int java.util.zip.CRC32.updateByteBuffer(int crc, long address, int off, int end)
|
||||
// 4 2,3 1 0
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(end, Address(rsp, 4 + 0)); // end
|
||||
__ subl(len, Address(rsp, 4 + 1 * wordSize)); // end - offset == length
|
||||
// Calculate address of start element
|
||||
if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
|
||||
__ movptr(buf, Address(rsp, 4 + 2 * wordSize)); // long address
|
||||
__ addptr(buf, Address(rsp, 4 + 1 * wordSize)); // + offset
|
||||
__ movl(crc, Address(rsp, 4 + 4 * wordSize)); // Initial CRC
|
||||
} else {
|
||||
__ movptr(buf, Address(rsp, 4 + 2 * wordSize)); // byte[] array
|
||||
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
|
||||
__ addptr(buf, Address(rsp, 4 + 1 * wordSize)); // + offset
|
||||
__ movl(crc, Address(rsp, 4 + 3 * wordSize)); // Initial CRC
|
||||
}
|
||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32C()), crc, buf, len);
|
||||
// result in rax
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
return entry;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native method:
|
||||
* java.lang.Float.intBitsToFloat(int bits)
|
||||
*/
|
||||
address InterpreterGenerator::generate_Float_intBitsToFloat_entry() {
|
||||
if (UseSSE >= 1) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rsi: the sender's SP
|
||||
|
||||
// Skip safepoint check (compiler intrinsic versions of this method
|
||||
// do not perform safepoint checks either).
|
||||
|
||||
// Load 'bits' into xmm0 (interpreter returns results in xmm0)
|
||||
__ movflt(xmm0, Address(rsp, wordSize));
|
||||
|
||||
// Return
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set rsp to the sender's SP
|
||||
__ jmp(rdi);
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native method:
|
||||
* java.lang.Float.floatToRawIntBits(float value)
|
||||
*/
|
||||
address InterpreterGenerator::generate_Float_floatToRawIntBits_entry() {
|
||||
if (UseSSE >= 1) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rsi: the sender's SP
|
||||
|
||||
// Skip safepoint check (compiler intrinsic versions of this method
|
||||
// do not perform safepoint checks either).
|
||||
|
||||
// Load the parameter (a floating-point value) into rax.
|
||||
__ movl(rax, Address(rsp, wordSize));
|
||||
|
||||
// Return
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set rsp to the sender's SP
|
||||
__ jmp(rdi);
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method entry for static native method:
|
||||
* java.lang.Double.longBitsToDouble(long bits)
|
||||
*/
|
||||
address InterpreterGenerator::generate_Double_longBitsToDouble_entry() {
|
||||
if (UseSSE >= 2) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rsi: the sender's SP
|
||||
|
||||
// Skip safepoint check (compiler intrinsic versions of this method
|
||||
// do not perform safepoint checks either).
|
||||
|
||||
// Load 'bits' into xmm0 (interpreter returns results in xmm0)
|
||||
__ movdbl(xmm0, Address(rsp, wordSize));
|
||||
|
||||
// Return
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set rsp to the sender's SP
|
||||
__ jmp(rdi);
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native method:
|
||||
* java.lang.Double.doubleToRawLongBits(double value)
|
||||
*/
|
||||
address InterpreterGenerator::generate_Double_doubleToRawLongBits_entry() {
|
||||
if (UseSSE >= 2) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rsi: the sender's SP
|
||||
|
||||
// Skip safepoint check (compiler intrinsic versions of this method
|
||||
// do not perform safepoint checks either).
|
||||
|
||||
// Load the parameter (a floating-point value) into rax.
|
||||
__ movl(rdx, Address(rsp, 2*wordSize));
|
||||
__ movl(rax, Address(rsp, wordSize));
|
||||
|
||||
// Return
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, rsi); // set rsp to the sender's SP
|
||||
__ jmp(rdi);
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif // CC_INTERP
|
197
hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp
Normal file
197
hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp
Normal file
@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "interpreter/interpreter.hpp"
|
||||
#include "interpreter/interpreterGenerator.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
#ifndef CC_INTERP
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32.update(int crc, int b)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32_update_entry() {
|
||||
if (UseCRC32Intrinsics) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rbx,: Method*
|
||||
// r13: senderSP must preserved for slow path, set SP to it on fast path
|
||||
// c_rarg0: scratch (rdi on non-Win64, rcx on Win64)
|
||||
// c_rarg1: scratch (rsi on non-Win64, rdx on Win64)
|
||||
|
||||
Label slow_path;
|
||||
// If we need a safepoint check, generate full interpreter entry.
|
||||
ExternalAddress state(SafepointSynchronize::address_of_state());
|
||||
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
|
||||
SafepointSynchronize::_not_synchronized);
|
||||
__ jcc(Assembler::notEqual, slow_path);
|
||||
|
||||
// We don't generate local frame and don't align stack because
|
||||
// we call stub code and there is no safepoint on this path.
|
||||
|
||||
// Load parameters
|
||||
const Register crc = rax; // crc
|
||||
const Register val = c_rarg0; // source java byte value
|
||||
const Register tbl = c_rarg1; // scratch
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
__ movl(val, Address(rsp, wordSize)); // byte value
|
||||
__ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC
|
||||
|
||||
__ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr()));
|
||||
__ notl(crc); // ~crc
|
||||
__ update_byte_crc32(crc, val, tbl);
|
||||
__ notl(crc); // ~crc
|
||||
// result in rax
|
||||
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, r13); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
// generate a vanilla native entry as the slow path
|
||||
__ bind(slow_path);
|
||||
__ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
|
||||
return entry;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len)
|
||||
* int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
|
||||
if (UseCRC32Intrinsics) {
|
||||
address entry = __ pc();
|
||||
|
||||
// rbx,: Method*
|
||||
// r13: senderSP must preserved for slow path, set SP to it on fast path
|
||||
|
||||
Label slow_path;
|
||||
// If we need a safepoint check, generate full interpreter entry.
|
||||
ExternalAddress state(SafepointSynchronize::address_of_state());
|
||||
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
|
||||
SafepointSynchronize::_not_synchronized);
|
||||
__ jcc(Assembler::notEqual, slow_path);
|
||||
|
||||
// We don't generate local frame and don't align stack because
|
||||
// we call stub code and there is no safepoint on this path.
|
||||
|
||||
// Load parameters
|
||||
const Register crc = c_rarg0; // crc
|
||||
const Register buf = c_rarg1; // source java byte array address
|
||||
const Register len = c_rarg2; // length
|
||||
const Register off = len; // offset (never overlaps with 'len')
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
// Calculate address of start element
|
||||
if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
|
||||
__ movptr(buf, Address(rsp, 3*wordSize)); // long buf
|
||||
__ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC
|
||||
} else {
|
||||
__ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
|
||||
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
|
||||
__ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC
|
||||
}
|
||||
// Can now load 'len' since we're finished with 'off'
|
||||
__ movl(len, Address(rsp, wordSize)); // Length
|
||||
|
||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len);
|
||||
// result in rax
|
||||
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, r13); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
// generate a vanilla native entry as the slow path
|
||||
__ bind(slow_path);
|
||||
__ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
|
||||
return entry;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method entry for static native methods:
|
||||
* int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end)
|
||||
* int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end)
|
||||
*/
|
||||
address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) {
|
||||
if (UseCRC32CIntrinsics) {
|
||||
address entry = __ pc();
|
||||
// Load parameters
|
||||
const Register crc = c_rarg0; // crc
|
||||
const Register buf = c_rarg1; // source java byte array address
|
||||
const Register len = c_rarg2;
|
||||
const Register off = c_rarg3; // offset
|
||||
const Register end = len;
|
||||
|
||||
// Arguments are reversed on java expression stack
|
||||
// Calculate address of start element
|
||||
if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
|
||||
__ movptr(buf, Address(rsp, 3 * wordSize)); // long buf
|
||||
__ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 5 * wordSize)); // Initial CRC
|
||||
// Note on 5 * wordSize vs. 4 * wordSize:
|
||||
// * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end)
|
||||
// 4 2,3 1 0
|
||||
// end starts at SP + 8
|
||||
// The Java(R) Virtual Machine Specification Java SE 7 Edition
|
||||
// 4.10.2.3. Values of Types long and double
|
||||
// "When calculating operand stack length, values of type long and double have length two."
|
||||
} else {
|
||||
__ movptr(buf, Address(rsp, 3 * wordSize)); // byte[] array
|
||||
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
|
||||
__ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
|
||||
__ addq(buf, off); // + offset
|
||||
__ movl(crc, Address(rsp, 4 * wordSize)); // Initial CRC
|
||||
}
|
||||
__ movl(end, Address(rsp, wordSize)); // end
|
||||
__ subl(end, off); // end - off
|
||||
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32C()), crc, buf, len);
|
||||
// result in rax
|
||||
// _areturn
|
||||
__ pop(rdi); // get return address
|
||||
__ mov(rsp, r13); // set sp to sender sp
|
||||
__ jmp(rdi);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif // ! CC_INTERP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -116,4 +116,87 @@ void AbstractInterpreter::layout_activation(Method* method,
|
||||
method->constants()->cache();
|
||||
}
|
||||
|
||||
#ifndef _LP64
|
||||
int AbstractInterpreter::BasicType_as_index(BasicType type) {
|
||||
int i = 0;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: i = 0; break;
|
||||
case T_CHAR : i = 1; break;
|
||||
case T_BYTE : i = 2; break;
|
||||
case T_SHORT : i = 3; break;
|
||||
case T_INT : // fall through
|
||||
case T_LONG : // fall through
|
||||
case T_VOID : i = 4; break;
|
||||
case T_FLOAT : i = 5; break; // have to treat float and double separately for SSE
|
||||
case T_DOUBLE : i = 6; break;
|
||||
case T_OBJECT : // fall through
|
||||
case T_ARRAY : i = 7; break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
|
||||
return i;
|
||||
}
|
||||
#else
|
||||
int AbstractInterpreter::BasicType_as_index(BasicType type) {
|
||||
int i = 0;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: i = 0; break;
|
||||
case T_CHAR : i = 1; break;
|
||||
case T_BYTE : i = 2; break;
|
||||
case T_SHORT : i = 3; break;
|
||||
case T_INT : i = 4; break;
|
||||
case T_LONG : i = 5; break;
|
||||
case T_VOID : i = 6; break;
|
||||
case T_FLOAT : i = 7; break;
|
||||
case T_DOUBLE : i = 8; break;
|
||||
case T_OBJECT : i = 9; break;
|
||||
case T_ARRAY : i = 9; break;
|
||||
default : ShouldNotReachHere();
|
||||
}
|
||||
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
|
||||
"index out of bounds");
|
||||
return i;
|
||||
}
|
||||
#endif // _LP64
|
||||
|
||||
// These should never be compiled since the interpreter will prefer
|
||||
// the compiled version to the intrinsic version.
|
||||
bool AbstractInterpreter::can_be_compiled(methodHandle m) {
|
||||
switch (method_kind(m)) {
|
||||
case Interpreter::java_lang_math_sin : // fall thru
|
||||
case Interpreter::java_lang_math_cos : // fall thru
|
||||
case Interpreter::java_lang_math_tan : // fall thru
|
||||
case Interpreter::java_lang_math_abs : // fall thru
|
||||
case Interpreter::java_lang_math_log : // fall thru
|
||||
case Interpreter::java_lang_math_log10 : // fall thru
|
||||
case Interpreter::java_lang_math_sqrt : // fall thru
|
||||
case Interpreter::java_lang_math_pow : // fall thru
|
||||
case Interpreter::java_lang_math_exp :
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// How much stack a method activation needs in words.
|
||||
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
|
||||
const int entry_size = frame::interpreter_frame_monitor_size();
|
||||
|
||||
// total overhead size: entry_size + (saved rbp thru expr stack
|
||||
// bottom). be sure to change this if you add/subtract anything
|
||||
// to/from the overhead area
|
||||
const int overhead_size =
|
||||
-(frame::interpreter_frame_initial_sp_offset) + entry_size;
|
||||
|
||||
#ifndef _LP64
|
||||
const int stub_code = 4; // see generate_call_stub
|
||||
#else
|
||||
const int stub_code = frame::entry_frame_after_call_words;
|
||||
#endif
|
||||
|
||||
const int method_stack = (method->max_locals() + method->max_stack()) *
|
||||
Interpreter::stackElementWords;
|
||||
return (overhead_size + method_stack + stub_code);
|
||||
}
|
||||
|
||||
#endif // CC_INTERP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -43,8 +43,8 @@
|
||||
#define __ _masm->
|
||||
|
||||
// Global Register Names
|
||||
Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi);
|
||||
Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi);
|
||||
static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi);
|
||||
static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi);
|
||||
|
||||
// Platform-dependent initialization
|
||||
void TemplateTable::pd_initialize() {
|
||||
|
@ -670,17 +670,16 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
|
||||
|
||||
void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile *C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
if (C->max_vector_size() > 16) {
|
||||
// Clear upper bits of YMM registers when current compiled code uses
|
||||
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
||||
MacroAssembler masm(&cbuf);
|
||||
masm.vzeroupper();
|
||||
_masm.vzeroupper();
|
||||
}
|
||||
// If method set FPU control word, restore to standard control word
|
||||
if (C->in_24_bit_fp_mode()) {
|
||||
MacroAssembler masm(&cbuf);
|
||||
masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
|
||||
_masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
|
||||
}
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
@ -702,6 +701,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
emit_opcode(cbuf, 0x58 | EBP_enc);
|
||||
|
||||
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||
__ reserved_stack_check();
|
||||
}
|
||||
|
||||
if (do_polling() && C->is_method_compilation()) {
|
||||
cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0);
|
||||
emit_opcode(cbuf,0x85);
|
||||
@ -729,6 +732,7 @@ uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
|
||||
} else {
|
||||
size += framesize ? 3 : 0;
|
||||
}
|
||||
size += 64; // added to support ReservedStackAccess
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -953,10 +953,11 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
||||
void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||
{
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
if (C->max_vector_size() > 16) {
|
||||
// Clear upper bits of YMM registers when current compiled code uses
|
||||
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
||||
MacroAssembler _masm(&cbuf);
|
||||
__ vzeroupper();
|
||||
}
|
||||
|
||||
@ -984,6 +985,10 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||
// popq rbp
|
||||
emit_opcode(cbuf, 0x58 | RBP_enc);
|
||||
|
||||
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||
__ reserved_stack_check();
|
||||
}
|
||||
|
||||
if (do_polling() && C->is_method_compilation()) {
|
||||
MacroAssembler _masm(&cbuf);
|
||||
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
|
||||
|
@ -48,14 +48,17 @@ define_pd_global(intx, InlineSmallCode, 1000 );
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||
#define DEFAULT_STACK_RED_PAGES (1)
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (5 LP64_ONLY(+1) DEBUG_ONLY(+3))
|
||||
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||
|
||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
||||
#define MIN_STACK_RESERVED_PAGES (0)
|
||||
|
||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||
|
||||
define_pd_global(bool, RewriteBytecodes, true);
|
||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -38,7 +38,6 @@
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
@ -74,7 +73,3 @@ address InterpreterGenerator::generate_abstract_entry() {
|
||||
bool AbstractInterpreter::can_be_compiled(methodHandle m) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Deoptimization::unwind_callee_save_values(frame* f,
|
||||
vframeArray* vframe_array) {
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -170,7 +170,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
|
||||
* @return flags of this method
|
||||
*/
|
||||
private int getFlags() {
|
||||
return UNSAFE.getByte(metaspaceMethod + config().methodFlagsOffset);
|
||||
return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1227,7 +1227,7 @@ public class HotSpotVMConfig {
|
||||
@HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset;
|
||||
@HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset;
|
||||
@HotSpotVMField(name = "Method::_intrinsic_id", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset;
|
||||
@HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset;
|
||||
@HotSpotVMField(name = "Method::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset;
|
||||
@HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset;
|
||||
|
||||
@HotSpotVMField(name = "Method::_method_counters", type = "MethodCounters*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCountersOffset;
|
||||
|
@ -29,37 +29,61 @@
|
||||
//
|
||||
// Defines Aix specific flags. They are not available on other platforms.
|
||||
//
|
||||
// (Please keep the switches sorted alphabetically.)
|
||||
#define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct, range, constraint) \
|
||||
\
|
||||
/* Whether to allow the VM to run if EXTSHM=ON. EXTSHM is an environment */ \
|
||||
/* variable used on AIX to activate certain hacks which allow more shm segments */\
|
||||
/* for 32bit processes. For 64bit processes, it is pointless and may have */ \
|
||||
/* harmful side effects (e.g. for some reasonn prevents allocation of 64k pages */\
|
||||
/* via shmctl). */ \
|
||||
/* Per default we quit with an error if that variable is found; for certain */ \
|
||||
/* customer scenarios, we may want to be able to run despite that variable. */ \
|
||||
product(bool, AllowExtshm, false, \
|
||||
"Allow VM to run with EXTSHM=ON.") \
|
||||
\
|
||||
product(intx, AttachListenerTimeout, 1000, \
|
||||
"Timeout in ms the attach listener waits for a request") \
|
||||
range(0, 2147483) \
|
||||
\
|
||||
/* Maximum expected size of the data segment. That correlates with the */ \
|
||||
/* to the maximum C Heap consumption we expect. */ \
|
||||
/* We need to know this because we need to leave "breathing space" for the */ \
|
||||
/* data segment when placing the java heap. If that space is too small, we */ \
|
||||
/* reduce our chance of getting a low heap address (needed for compressed */ \
|
||||
/* Oops). */ \
|
||||
product(uintx, MaxExpectedDataSegmentSize, (SIZE_4G * 2), \
|
||||
"Maximum expected Data Segment Size.") \
|
||||
\
|
||||
/* Use optimized addresses for the polling page. */ \
|
||||
product(bool, OptimizePollingPageLocation, true, \
|
||||
"Optimize the location of the polling page used for Safepoints") \
|
||||
\
|
||||
/* Use 64K pages for virtual memory (shmat). */ \
|
||||
product(bool, Use64KPages, true, \
|
||||
"Use 64K pages if available.") \
|
||||
\
|
||||
/* If UseLargePages == true allow or deny usage of 16M pages. 16M pages are */ \
|
||||
/* a scarce resource and there may be situations where we do not want the VM */ \
|
||||
/* to run with 16M pages. (Will fall back to 64K pages). */ \
|
||||
product_pd(bool, Use16MPages, \
|
||||
"Use 16M pages if available.") \
|
||||
/* If VM uses 64K paged memory (shmat) for virtual memory: threshold below */ \
|
||||
/* which virtual memory allocations are done with 4K memory (mmap). This is */ \
|
||||
/* mainly for test purposes. */ \
|
||||
develop(uintx, Use64KPagesThreshold, 0, \
|
||||
"4K/64K page allocation threshold.") \
|
||||
\
|
||||
/* use optimized addresses for the polling page, */ \
|
||||
/* e.g. map it to a special 32-bit address. */ \
|
||||
product_pd(bool, OptimizePollingPageLocation, \
|
||||
"Optimize the location of the polling page used for Safepoints") \
|
||||
\
|
||||
product_pd(intx, AttachListenerTimeout, \
|
||||
"Timeout in ms the attach listener waits for a request") \
|
||||
range(0, 2147483) \
|
||||
/* Normally AIX commits memory on touch, but sometimes it is helpful to have */ \
|
||||
/* explicit commit behaviour. This flag, if true, causes the VM to touch */ \
|
||||
/* memory on os::commit_memory() (which normally is a noop). */ \
|
||||
product(bool, UseExplicitCommit, false, \
|
||||
"Explicit commit for virtual memory.") \
|
||||
\
|
||||
|
||||
// Per default, do not allow 16M pages. 16M pages have to be switched on specifically.
|
||||
define_pd_global(bool, Use16MPages, false);
|
||||
define_pd_global(bool, OptimizePollingPageLocation, true);
|
||||
define_pd_global(intx, AttachListenerTimeout, 1000);
|
||||
|
||||
//
|
||||
// Defines Aix-specific default values. The flags are available on all
|
||||
// platforms, but they may have different default values on other platforms.
|
||||
//
|
||||
|
||||
// UseLargePages means nothing, for now, on AIX.
|
||||
// Use Use64KPages or Use16MPages instead.
|
||||
define_pd_global(bool, UseLargePages, false);
|
||||
define_pd_global(bool, UseLargePagesIndividualAllocation, false);
|
||||
define_pd_global(bool, UseOSErrorReporting, false);
|
||||
|
@ -109,92 +109,3 @@ JVM_ENTRY_NO_ENV(jboolean, JVM_RaiseSignal(jint sig))
|
||||
return JNI_TRUE;
|
||||
JVM_END
|
||||
|
||||
/*
|
||||
All the defined signal names for Linux.
|
||||
|
||||
NOTE that not all of these names are accepted by our Java implementation
|
||||
|
||||
Via an existing claim by the VM, sigaction restrictions, or
|
||||
the "rules of Unix" some of these names will be rejected at runtime.
|
||||
For example the VM sets up to handle USR1, sigaction returns EINVAL for
|
||||
STOP, and Linux simply doesn't allow catching of KILL.
|
||||
|
||||
Here are the names currently accepted by a user of sun.misc.Signal with
|
||||
1.4.1 (ignoring potential interaction with use of chaining, etc):
|
||||
|
||||
HUP, INT, TRAP, ABRT, IOT, BUS, USR2, PIPE, ALRM, TERM, STKFLT,
|
||||
CLD, CHLD, CONT, TSTP, TTIN, TTOU, URG, XCPU, XFSZ, VTALRM, PROF,
|
||||
WINCH, POLL, IO, PWR, SYS
|
||||
|
||||
*/
|
||||
|
||||
struct siglabel {
|
||||
const char *name;
|
||||
int number;
|
||||
};
|
||||
|
||||
struct siglabel siglabels[] = {
|
||||
/* derived from /usr/include/bits/signum.h on RH7.2 */
|
||||
"HUP", SIGHUP, /* Hangup (POSIX). */
|
||||
"INT", SIGINT, /* Interrupt (ANSI). */
|
||||
"QUIT", SIGQUIT, /* Quit (POSIX). */
|
||||
"ILL", SIGILL, /* Illegal instruction (ANSI). */
|
||||
"TRAP", SIGTRAP, /* Trace trap (POSIX). */
|
||||
"ABRT", SIGABRT, /* Abort (ANSI). */
|
||||
"IOT", SIGIOT, /* IOT trap (4.2 BSD). */
|
||||
"BUS", SIGBUS, /* BUS error (4.2 BSD). */
|
||||
"FPE", SIGFPE, /* Floating-point exception (ANSI). */
|
||||
"KILL", SIGKILL, /* Kill, unblockable (POSIX). */
|
||||
"USR1", SIGUSR1, /* User-defined signal 1 (POSIX). */
|
||||
"SEGV", SIGSEGV, /* Segmentation violation (ANSI). */
|
||||
"USR2", SIGUSR2, /* User-defined signal 2 (POSIX). */
|
||||
"PIPE", SIGPIPE, /* Broken pipe (POSIX). */
|
||||
"ALRM", SIGALRM, /* Alarm clock (POSIX). */
|
||||
"TERM", SIGTERM, /* Termination (ANSI). */
|
||||
#ifdef SIGSTKFLT
|
||||
"STKFLT", SIGSTKFLT, /* Stack fault. */
|
||||
#endif
|
||||
"CLD", SIGCLD, /* Same as SIGCHLD (System V). */
|
||||
"CHLD", SIGCHLD, /* Child status has changed (POSIX). */
|
||||
"CONT", SIGCONT, /* Continue (POSIX). */
|
||||
"STOP", SIGSTOP, /* Stop, unblockable (POSIX). */
|
||||
"TSTP", SIGTSTP, /* Keyboard stop (POSIX). */
|
||||
"TTIN", SIGTTIN, /* Background read from tty (POSIX). */
|
||||
"TTOU", SIGTTOU, /* Background write to tty (POSIX). */
|
||||
"URG", SIGURG, /* Urgent condition on socket (4.2 BSD). */
|
||||
"XCPU", SIGXCPU, /* CPU limit exceeded (4.2 BSD). */
|
||||
"XFSZ", SIGXFSZ, /* File size limit exceeded (4.2 BSD). */
|
||||
"DANGER", SIGDANGER, /* System crash imminent; free up some page space (AIX). */
|
||||
"VTALRM", SIGVTALRM, /* Virtual alarm clock (4.2 BSD). */
|
||||
"PROF", SIGPROF, /* Profiling alarm clock (4.2 BSD). */
|
||||
"WINCH", SIGWINCH, /* Window size change (4.3 BSD, Sun). */
|
||||
"POLL", SIGPOLL, /* Pollable event occurred (System V). */
|
||||
"IO", SIGIO, /* I/O now possible (4.2 BSD). */
|
||||
"PWR", SIGPWR, /* Power failure restart (System V). */
|
||||
#ifdef SIGSYS
|
||||
"SYS", SIGSYS /* Bad system call. Only on some Linuxen! */
|
||||
#endif
|
||||
};
|
||||
|
||||
JVM_ENTRY_NO_ENV(jint, JVM_FindSignal(const char *name))
|
||||
|
||||
/* find and return the named signal's number */
|
||||
|
||||
for(uint i=0; i<ARRAY_SIZE(siglabels); i++)
|
||||
if(!strcmp(name, siglabels[i].name))
|
||||
return siglabels[i].number;
|
||||
|
||||
return -1;
|
||||
|
||||
JVM_END
|
||||
|
||||
// used by os::exception_name()
|
||||
extern bool signal_name(int signo, char* buf, size_t len) {
|
||||
for(uint i = 0; i < ARRAY_SIZE(siglabels); i++) {
|
||||
if (signo == siglabels[i].number) {
|
||||
jio_snprintf(buf, len, "SIG%s", siglabels[i].name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
||||
* Copyright 2012, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,18 +22,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "runtime/threadLocalStorage.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
// This is only a stub. Will flesh out later when/if we add further support
|
||||
// for PASE.
|
||||
|
||||
void ThreadLocalStorage::generate_code_for_get_thread() {
|
||||
// Nothing we can do here for user-level thread.
|
||||
}
|
||||
#include "libo4.hpp"
|
||||
|
||||
void ThreadLocalStorage::pd_init() {
|
||||
// Nothing to do.
|
||||
bool libo4::init() { return false; }
|
||||
void libo4::cleanup() {}
|
||||
bool libo4::get_memory_info (unsigned long long* p_virt_total, unsigned long long* p_real_total,
|
||||
unsigned long long* p_real_free, unsigned long long* p_pgsp_total, unsigned long long* p_pgsp_free) {
|
||||
return false;
|
||||
}
|
||||
bool libo4::get_load_avg (double* p_avg1, double* p_avg5, double* p_avg15) { return false; }
|
||||
bool libo4::realpath (const char* file_name, char* resolved_name, int resolved_name_len) { return false; }
|
||||
|
||||
void ThreadLocalStorage::pd_set_thread(Thread* thread) {
|
||||
os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread);
|
||||
}
|
77
hotspot/src/os/aix/vm/libo4.hpp
Normal file
77
hotspot/src/os/aix/vm/libo4.hpp
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright 2012, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
// A C++ wrapper around the libo4 porting library. The libo4 porting library
|
||||
// is a set of bridge functions into native AS/400 functionality.
|
||||
|
||||
#ifndef OS_AIX_VM_LIBO4_HPP
|
||||
#define OS_AIX_VM_LIBO4_HPP
|
||||
|
||||
|
||||
class libo4 {
|
||||
public:
|
||||
|
||||
// Initialize the libo4 porting library.
|
||||
// Returns true if succeeded, false if error.
|
||||
static bool init();
|
||||
|
||||
// cleanup of the libo4 porting library.
|
||||
static void cleanup();
|
||||
|
||||
// returns a number of memory statistics from the
|
||||
// AS/400.
|
||||
//
|
||||
// Specify NULL for numbers you are not interested in.
|
||||
//
|
||||
// returns false if an error happened. Activate OsMisc trace for
|
||||
// trace output.
|
||||
//
|
||||
static bool get_memory_info (unsigned long long* p_virt_total, unsigned long long* p_real_total,
|
||||
unsigned long long* p_real_free, unsigned long long* p_pgsp_total, unsigned long long* p_pgsp_free);
|
||||
|
||||
// returns information about system load
|
||||
// (similar to "loadavg()" under other Unices)
|
||||
//
|
||||
// Specify NULL for numbers you are not interested in.
|
||||
//
|
||||
// returns false if an error happened. Activate OsMisc trace for
|
||||
// trace output.
|
||||
//
|
||||
static bool get_load_avg (double* p_avg1, double* p_avg5, double* p_avg15);
|
||||
|
||||
// this is a replacement for the "realpath()" API which does not really work
|
||||
// on PASE
|
||||
//
|
||||
// Specify NULL for numbers you are not interested in.
|
||||
//
|
||||
// returns false if an error happened. Activate OsMisc trace for
|
||||
// trace output.
|
||||
//
|
||||
static bool realpath (const char* file_name,
|
||||
char* resolved_name, int resolved_name_len);
|
||||
|
||||
};
|
||||
|
||||
#endif // OS_AIX_VM_LIBO4_HPP
|
||||
|
118
hotspot/src/os/aix/vm/libodm_aix.cpp
Normal file
118
hotspot/src/os/aix/vm/libodm_aix.cpp
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2015, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "libodm_aix.hpp"
|
||||
#include "misc_aix.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
#include "runtime/arguments.hpp"
|
||||
|
||||
|
||||
dynamicOdm::dynamicOdm() {
|
||||
const char *libodmname = "/usr/lib/libodm.a(shr_64.o)";
|
||||
_libhandle = dlopen(libodmname, RTLD_MEMBER | RTLD_NOW);
|
||||
if (!_libhandle) {
|
||||
trcVerbose("Couldn't open %s", libodmname);
|
||||
return;
|
||||
}
|
||||
_odm_initialize = (fun_odm_initialize )dlsym(_libhandle, "odm_initialize" );
|
||||
_odm_set_path = (fun_odm_set_path )dlsym(_libhandle, "odm_set_path" );
|
||||
_odm_mount_class = (fun_odm_mount_class)dlsym(_libhandle, "odm_mount_class");
|
||||
_odm_get_obj = (fun_odm_get_obj )dlsym(_libhandle, "odm_get_obj" );
|
||||
_odm_terminate = (fun_odm_terminate )dlsym(_libhandle, "odm_terminate" );
|
||||
if (!_odm_initialize || !_odm_set_path || !_odm_mount_class || !_odm_get_obj || !_odm_terminate) {
|
||||
trcVerbose("Couldn't find all required odm symbols from %s", libodmname);
|
||||
dlclose(_libhandle);
|
||||
_libhandle = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dynamicOdm::~dynamicOdm() {
|
||||
if (_libhandle) { dlclose(_libhandle); }
|
||||
}
|
||||
|
||||
|
||||
void odmWrapper::clean_data() { if (_data) { free(_data); _data = NULL; } }
|
||||
|
||||
|
||||
int odmWrapper::class_offset(char *field, bool is_aix_5)
|
||||
{
|
||||
assert(has_class(), "initialization");
|
||||
for (int i = 0; i < odm_class()->nelem; i++) {
|
||||
if (strcmp(odm_class()->elem[i].elemname, field) == 0) {
|
||||
int offset = odm_class()->elem[i].offset;
|
||||
if (is_aix_5) { offset += LINK_VAL_OFFSET; }
|
||||
return offset;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void odmWrapper::determine_os_kernel_version(uint32_t* p_ver) {
|
||||
int major_aix_version = ((*p_ver) >> 24) & 0xFF,
|
||||
minor_aix_version = ((*p_ver) >> 16) & 0xFF;
|
||||
assert(*p_ver, "must be initialized");
|
||||
|
||||
odmWrapper odm("product", "/usr/lib/objrepos"); // could also use "lpp"
|
||||
if (!odm.has_class()) {
|
||||
trcVerbose("try_determine_os_kernel_version: odm init problem");
|
||||
return;
|
||||
}
|
||||
int voff, roff, moff, foff;
|
||||
bool is_aix_5 = (major_aix_version == 5);
|
||||
voff = odm.class_offset("ver", is_aix_5);
|
||||
roff = odm.class_offset("rel", is_aix_5);
|
||||
moff = odm.class_offset("mod", is_aix_5);
|
||||
foff = odm.class_offset("fix", is_aix_5);
|
||||
if (voff == -1 || roff == -1 || moff == -1 || foff == -1) {
|
||||
trcVerbose("try_determine_os_kernel_version: could not get offsets");
|
||||
return;
|
||||
}
|
||||
if (!odm.retrieve_obj("name='bos.mp64'")) {
|
||||
trcVerbose("try_determine_os_kernel_version: odm_get_obj failed");
|
||||
return;
|
||||
}
|
||||
int version, release, modification, fix_level;
|
||||
do {
|
||||
version = odm.read_short(voff);
|
||||
release = odm.read_short(roff);
|
||||
modification = odm.read_short(moff);
|
||||
fix_level = odm.read_short(foff);
|
||||
trcVerbose("odm found version: %d.%d.%d.%d", version, release, modification, fix_level);
|
||||
if (version >> 8 != 0 || release >> 8 != 0 || modification >> 8 != 0 || fix_level >> 8 != 0) {
|
||||
trcVerbose("8 bit numbers expected");
|
||||
return;
|
||||
}
|
||||
} while (odm.retrieve_obj());
|
||||
|
||||
if (version != major_aix_version || release != minor_aix_version) {
|
||||
trcVerbose("version determined by odm does not match uname");
|
||||
return;
|
||||
}
|
||||
*p_ver = version << 24 | release << 16 | modification << 8 | fix_level;
|
||||
}
|
106
hotspot/src/os/aix/vm/libodm_aix.hpp
Normal file
106
hotspot/src/os/aix/vm/libodm_aix.hpp
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2015, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
// Encapsulates the libodm library and provides more convenient interfaces.
|
||||
|
||||
#ifndef OS_AIX_VM_LIBODM_AIX_HPP
|
||||
#define OS_AIX_VM_LIBODM_AIX_HPP
|
||||
|
||||
#include <odmi.h>
|
||||
|
||||
|
||||
// The purpose of this code is to dynamically load the libodm library
|
||||
// instead of statically linking against it. The library is AIX-specific.
|
||||
// It only exists on AIX, not on PASE. In order to share binaries
|
||||
// between AIX and PASE, we can't directly link against it.
|
||||
|
||||
typedef int (*fun_odm_initialize )(void);
|
||||
typedef char* (*fun_odm_set_path )(char*);
|
||||
typedef CLASS_SYMBOL (*fun_odm_mount_class)(char*);
|
||||
typedef void* (*fun_odm_get_obj )(CLASS_SYMBOL, char*, void*, int);
|
||||
typedef int (*fun_odm_terminate )(void);
|
||||
|
||||
class dynamicOdm {
|
||||
void *_libhandle;
|
||||
protected:
|
||||
fun_odm_initialize _odm_initialize;
|
||||
fun_odm_set_path _odm_set_path;
|
||||
fun_odm_mount_class _odm_mount_class;
|
||||
fun_odm_get_obj _odm_get_obj;
|
||||
fun_odm_terminate _odm_terminate;
|
||||
public:
|
||||
dynamicOdm();
|
||||
~dynamicOdm();
|
||||
bool odm_loaded() {return _libhandle != NULL; }
|
||||
};
|
||||
|
||||
|
||||
// We provide a more convenient interface for odm access and
|
||||
// especially to determine the exact AIX kernel version.
|
||||
|
||||
class odmWrapper : private dynamicOdm {
|
||||
CLASS_SYMBOL _odm_class;
|
||||
char *_data;
|
||||
bool _initialized;
|
||||
void clean_data();
|
||||
|
||||
public:
|
||||
// Make sure everything gets initialized and cleaned up properly.
|
||||
explicit odmWrapper(char* odm_class_name, char* odm_path = NULL) : _odm_class((CLASS_SYMBOL)-1),
|
||||
_data(NULL), _initialized(false) {
|
||||
if (!odm_loaded()) { return; }
|
||||
_initialized = ((*_odm_initialize)() != -1);
|
||||
if (_initialized) {
|
||||
if (odm_path) { (*_odm_set_path)(odm_path); }
|
||||
_odm_class = (*_odm_mount_class)(odm_class_name);
|
||||
}
|
||||
}
|
||||
~odmWrapper() {
|
||||
if (_initialized) { (*_odm_terminate)(); clean_data(); }
|
||||
}
|
||||
|
||||
CLASS_SYMBOL odm_class() { return _odm_class; }
|
||||
bool has_class() { return odm_class() != (CLASS_SYMBOL)-1; }
|
||||
int class_offset(char *field, bool is_aix_5);
|
||||
char* data() { return _data; }
|
||||
|
||||
char* retrieve_obj(char* name = NULL) {
|
||||
clean_data();
|
||||
char *cnp = (char*)(void*)(*_odm_get_obj)(odm_class(), name, NULL, (name == NULL) ? ODM_NEXT : ODM_FIRST);
|
||||
if (cnp != (char*)-1) { _data = cnp; }
|
||||
return data();
|
||||
}
|
||||
|
||||
int read_short(int offs) {
|
||||
short *addr = (short*)(data() + offs);
|
||||
return *addr;
|
||||
}
|
||||
|
||||
// Determine the exact AIX kernel version as 4 byte value.
|
||||
// The high order 2 bytes must be initialized already. They can be determined by uname.
|
||||
static void determine_os_kernel_version(uint32_t* p_ver);
|
||||
};
|
||||
|
||||
#endif // OS_AIX_VM_LIBODM_AIX_HPP
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012, 2013 SAP AG. All rights reserved.
|
||||
* Copyright 2012, 2015 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,49 +22,50 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "libperfstat_aix.hpp"
|
||||
#include "misc_aix.hpp"
|
||||
|
||||
// For dlopen and friends
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
// handle to the libperfstat
|
||||
// Handle to the libperfstat.
|
||||
static void* g_libhandle = NULL;
|
||||
|
||||
// whether initialization worked
|
||||
static bool g_initialized = false;
|
||||
|
||||
|
||||
typedef int (*fun_perfstat_cpu_total_t) (perfstat_id_t *name, perfstat_cpu_total_t* userbuff,
|
||||
typedef int (*fun_perfstat_cpu_total_t) (perfstat_id_t *name, PERFSTAT_CPU_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
typedef int (*fun_perfstat_memory_total_t) (perfstat_id_t *name, perfstat_memory_total_t* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
typedef int (*fun_perfstat_partition_total_t) (perfstat_id_t *name,
|
||||
PERFSTAT_PARTITON_TOTAL_T_LATEST* userbuff, int sizeof_userbuff,
|
||||
int desired_number);
|
||||
|
||||
typedef int (*fun_perfstat_wpar_total_t) (perfstat_id_wpar_t *name,
|
||||
PERFSTAT_WPAR_TOTAL_T_LATEST* userbuff, int sizeof_userbuff,
|
||||
int desired_number);
|
||||
|
||||
typedef void (*fun_perfstat_reset_t) ();
|
||||
|
||||
typedef cid_t (*fun_wpar_getcid_t) ();
|
||||
|
||||
static fun_perfstat_cpu_total_t g_fun_perfstat_cpu_total = NULL;
|
||||
static fun_perfstat_memory_total_t g_fun_perfstat_memory_total = NULL;
|
||||
static fun_perfstat_partition_total_t g_fun_perfstat_partition_total = NULL;
|
||||
static fun_perfstat_wpar_total_t g_fun_perfstat_wpar_total = NULL;
|
||||
static fun_perfstat_reset_t g_fun_perfstat_reset = NULL;
|
||||
static fun_wpar_getcid_t g_fun_wpar_getcid = NULL;
|
||||
|
||||
bool libperfstat::init() {
|
||||
|
||||
if (g_initialized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
g_initialized = false;
|
||||
|
||||
// dynamically load the libperfstat porting library.
|
||||
// Dynamically load the libperfstat porting library.
|
||||
g_libhandle = dlopen("/usr/lib/libperfstat.a(shr_64.o)", RTLD_MEMBER | RTLD_NOW);
|
||||
if (!g_libhandle) {
|
||||
if (Verbose) {
|
||||
fprintf(stderr, "Cannot load libperfstat.a (dlerror: %s)", dlerror());
|
||||
}
|
||||
trcVerbose("Cannot load libperfstat.a (dlerror: %s)", dlerror());
|
||||
return false;
|
||||
}
|
||||
|
||||
// resolve function pointers
|
||||
// Resolve function pointers
|
||||
|
||||
#define RESOLVE_FUN_NO_ERROR(name) \
|
||||
g_fun_##name = (fun_##name##_t) dlsym(g_libhandle, #name);
|
||||
@ -72,26 +73,28 @@ bool libperfstat::init() {
|
||||
#define RESOLVE_FUN(name) \
|
||||
RESOLVE_FUN_NO_ERROR(name) \
|
||||
if (!g_fun_##name) { \
|
||||
if (Verbose) { \
|
||||
fprintf(stderr, "Cannot resolve " #name "() from libperfstat.a\n" \
|
||||
trcVerbose("Cannot resolve " #name "() from libperfstat.a\n" \
|
||||
" (dlerror: %s)", dlerror()); \
|
||||
} \
|
||||
return false; \
|
||||
}
|
||||
|
||||
// These functions may or may not be there depending on the OS release.
|
||||
RESOLVE_FUN_NO_ERROR(perfstat_partition_total);
|
||||
RESOLVE_FUN_NO_ERROR(perfstat_wpar_total);
|
||||
RESOLVE_FUN_NO_ERROR(wpar_getcid);
|
||||
|
||||
// These functions are required for every release.
|
||||
RESOLVE_FUN(perfstat_cpu_total);
|
||||
RESOLVE_FUN(perfstat_memory_total);
|
||||
RESOLVE_FUN(perfstat_reset);
|
||||
|
||||
g_initialized = true;
|
||||
trcVerbose("libperfstat loaded.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void libperfstat::cleanup() {
|
||||
|
||||
g_initialized = false;
|
||||
|
||||
if (g_libhandle) {
|
||||
dlclose(g_libhandle);
|
||||
g_libhandle = NULL;
|
||||
@ -99,26 +102,250 @@ void libperfstat::cleanup() {
|
||||
|
||||
g_fun_perfstat_cpu_total = NULL;
|
||||
g_fun_perfstat_memory_total = NULL;
|
||||
g_fun_perfstat_partition_total = NULL;
|
||||
g_fun_perfstat_wpar_total = NULL;
|
||||
g_fun_perfstat_reset = NULL;
|
||||
g_fun_wpar_getcid = NULL;
|
||||
|
||||
}
|
||||
|
||||
int libperfstat::perfstat_memory_total(perfstat_id_t *name,
|
||||
perfstat_memory_total_t* userbuff,
|
||||
int sizeof_userbuff, int desired_number) {
|
||||
assert(g_initialized, "libperfstat not initialized");
|
||||
assert(g_fun_perfstat_memory_total, "");
|
||||
if (g_fun_perfstat_memory_total == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return g_fun_perfstat_memory_total(name, userbuff, sizeof_userbuff, desired_number);
|
||||
}
|
||||
|
||||
int libperfstat::perfstat_cpu_total(perfstat_id_t *name, perfstat_cpu_total_t* userbuff,
|
||||
int libperfstat::perfstat_cpu_total(perfstat_id_t *name, PERFSTAT_CPU_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number) {
|
||||
assert(g_initialized, "libperfstat not initialized");
|
||||
assert(g_fun_perfstat_cpu_total, "");
|
||||
if (g_fun_perfstat_cpu_total == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return g_fun_perfstat_cpu_total(name, userbuff, sizeof_userbuff, desired_number);
|
||||
}
|
||||
|
||||
void libperfstat::perfstat_reset() {
|
||||
assert(g_initialized, "libperfstat not initialized");
|
||||
assert(g_fun_perfstat_reset, "");
|
||||
g_fun_perfstat_reset();
|
||||
int libperfstat::perfstat_partition_total(perfstat_id_t *name, PERFSTAT_PARTITON_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number) {
|
||||
if (g_fun_perfstat_partition_total == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return g_fun_perfstat_partition_total(name, userbuff, sizeof_userbuff, desired_number);
|
||||
}
|
||||
|
||||
int libperfstat::perfstat_wpar_total(perfstat_id_wpar_t *name, PERFSTAT_WPAR_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number) {
|
||||
if (g_fun_perfstat_wpar_total == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return g_fun_perfstat_wpar_total(name, userbuff, sizeof_userbuff, desired_number);
|
||||
}
|
||||
|
||||
void libperfstat::perfstat_reset() {
|
||||
if (g_fun_perfstat_reset != NULL) {
|
||||
g_fun_perfstat_reset();
|
||||
}
|
||||
}
|
||||
|
||||
cid_t libperfstat::wpar_getcid() {
|
||||
if (g_fun_wpar_getcid == NULL) {
|
||||
return (cid_t) -1;
|
||||
}
|
||||
return g_fun_wpar_getcid();
|
||||
}
|
||||
|
||||
|
||||
//////////////////// convenience functions, release-independent /////////////////////////////
|
||||
|
||||
// Excerpts from systemcfg.h definitions newer than AIX 5.3 (our oldest build platform)
|
||||
|
||||
#define PV_6 0x100000 /* Power PC 6 */
|
||||
#define PV_6_1 0x100001 /* Power PC 6 DD1.x */
|
||||
#define PV_7 0x200000 /* Power PC 7 */
|
||||
#define PV_5_Compat 0x0F8000 /* Power PC 5 */
|
||||
#define PV_6_Compat 0x108000 /* Power PC 6 */
|
||||
#define PV_7_Compat 0x208000 /* Power PC 7 */
|
||||
#define PV_8 0x300000 /* Power PC 8 */
|
||||
#define PV_8_Compat 0x308000 /* Power PC 8 */
|
||||
|
||||
|
||||
// Retrieve global cpu information.
|
||||
bool libperfstat::get_cpuinfo(cpuinfo_t* pci) {
|
||||
|
||||
assert(pci, "get_cpuinfo: invalid parameter");
|
||||
memset(pci, 0, sizeof(cpuinfo_t));
|
||||
|
||||
PERFSTAT_CPU_TOTAL_T_LATEST psct;
|
||||
memset (&psct, '\0', sizeof(psct));
|
||||
|
||||
if (-1 == libperfstat::perfstat_cpu_total(NULL, &psct, sizeof(PERFSTAT_CPU_TOTAL_T_LATEST), 1)) {
|
||||
if (-1 == libperfstat::perfstat_cpu_total(NULL, &psct, sizeof(perfstat_cpu_total_t_61), 1)) {
|
||||
if (-1 == libperfstat::perfstat_cpu_total(NULL, &psct, sizeof(perfstat_cpu_total_t_53), 1)) {
|
||||
trcVerbose("perfstat_cpu_total() failed (errno=%d)", errno);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Global cpu information.
|
||||
strcpy (pci->description, psct.description);
|
||||
pci->processorHZ = psct.processorHZ;
|
||||
pci->ncpus = psct.ncpus;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
pci->loadavg[i] = (double) psct.loadavg[i] / (1 << SBITS);
|
||||
}
|
||||
|
||||
pci->user_clock_ticks = psct.user;
|
||||
pci->sys_clock_ticks = psct.sys;
|
||||
pci->idle_clock_ticks = psct.idle;
|
||||
pci->wait_clock_ticks = psct.wait;
|
||||
|
||||
// Get the processor version from _system_configuration.
|
||||
switch (_system_configuration.version) {
|
||||
case PV_8:
|
||||
strcpy(pci->version, "Power PC 8");
|
||||
break;
|
||||
case PV_7:
|
||||
strcpy(pci->version, "Power PC 7");
|
||||
break;
|
||||
case PV_6_1:
|
||||
strcpy(pci->version, "Power PC 6 DD1.x");
|
||||
break;
|
||||
case PV_6:
|
||||
strcpy(pci->version, "Power PC 6");
|
||||
break;
|
||||
case PV_5:
|
||||
strcpy(pci->version, "Power PC 5");
|
||||
break;
|
||||
case PV_5_2:
|
||||
strcpy(pci->version, "Power PC 5_2");
|
||||
break;
|
||||
case PV_5_3:
|
||||
strcpy(pci->version, "Power PC 5_3");
|
||||
break;
|
||||
case PV_5_Compat:
|
||||
strcpy(pci->version, "PV_5_Compat");
|
||||
break;
|
||||
case PV_6_Compat:
|
||||
strcpy(pci->version, "PV_6_Compat");
|
||||
break;
|
||||
case PV_7_Compat:
|
||||
strcpy(pci->version, "PV_7_Compat");
|
||||
break;
|
||||
case PV_8_Compat:
|
||||
strcpy(pci->version, "PV_8_Compat");
|
||||
break;
|
||||
default:
|
||||
strcpy(pci->version, "unknown");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Retrieve partition information.
|
||||
bool libperfstat::get_partitioninfo(partitioninfo_t* ppi) {
|
||||
|
||||
assert(ppi, "get_partitioninfo: invalid parameter");
|
||||
memset(ppi, 0, sizeof(partitioninfo_t));
|
||||
|
||||
PERFSTAT_PARTITON_TOTAL_T_LATEST pspt;
|
||||
memset(&pspt, '\0', sizeof(pspt));
|
||||
|
||||
bool ame_details = true;
|
||||
|
||||
if (-1 == libperfstat::perfstat_partition_total(NULL, &pspt, sizeof(PERFSTAT_PARTITON_TOTAL_T_LATEST), 1)) {
|
||||
if (-1 == libperfstat::perfstat_partition_total(NULL, &pspt, sizeof(perfstat_partition_total_t_71), 1)) {
|
||||
ame_details = false;
|
||||
if (-1 == libperfstat::perfstat_partition_total(NULL, &pspt, sizeof(perfstat_partition_total_t_61), 1)) {
|
||||
if (-1 == libperfstat::perfstat_partition_total(NULL, &pspt, sizeof(perfstat_partition_total_t_53), 1)) {
|
||||
if (-1 == libperfstat::perfstat_partition_total(NULL, &pspt, sizeof(perfstat_partition_total_t_53_5), 1)) {
|
||||
trcVerbose("perfstat_partition_total() failed (errno=%d)", errno);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// partition type info
|
||||
ppi->shared_enabled = pspt.type.b.shared_enabled;
|
||||
ppi->smt_capable = pspt.type.b.smt_capable;
|
||||
ppi->smt_enabled = pspt.type.b.smt_enabled;
|
||||
ppi->lpar_capable = pspt.type.b.lpar_capable;
|
||||
ppi->lpar_enabled = pspt.type.b.lpar_enabled;
|
||||
ppi->dlpar_capable = pspt.type.b.dlpar_capable;
|
||||
ppi->capped = pspt.type.b.capped;
|
||||
ppi->kernel_is_64 = pspt.type.b.kernel_is_64;
|
||||
ppi->pool_util_authority = pspt.type.b.pool_util_authority;
|
||||
ppi->donate_capable = pspt.type.b.donate_capable;
|
||||
ppi->donate_enabled = pspt.type.b.donate_enabled;
|
||||
ppi->ams_capable = pspt.type.b.ams_capable;
|
||||
ppi->ams_enabled = pspt.type.b.ams_enabled;
|
||||
ppi->power_save = pspt.type.b.power_save;
|
||||
ppi->ame_enabled = pspt.type.b.ame_enabled;
|
||||
|
||||
// partition total info
|
||||
ppi->online_cpus = pspt.online_cpus;
|
||||
ppi->entitled_proc_capacity = pspt.entitled_proc_capacity;
|
||||
ppi->var_proc_capacity_weight = pspt.var_proc_capacity_weight;
|
||||
ppi->phys_cpus_pool = pspt.phys_cpus_pool;
|
||||
ppi->pool_id = pspt.pool_id;
|
||||
ppi->entitled_pool_capacity = pspt.entitled_pool_capacity;
|
||||
strcpy(ppi->name, pspt.name);
|
||||
|
||||
// Added values to ppi that we need for later computation of cpu utilization
|
||||
// ( pool authorization needed for pool_idle_time ??? )
|
||||
ppi->timebase_last = pspt.timebase_last;
|
||||
ppi->pool_idle_time = pspt.pool_idle_time;
|
||||
ppi->pcpu_tics_user = pspt.puser;
|
||||
ppi->pcpu_tics_sys = pspt.psys;
|
||||
ppi->pcpu_tics_idle = pspt.pidle;
|
||||
ppi->pcpu_tics_wait = pspt.pwait;
|
||||
|
||||
// Additional AME information.
|
||||
if (ame_details) {
|
||||
ppi->true_memory = pspt.true_memory * 4096;
|
||||
ppi->expanded_memory = pspt.expanded_memory * 4096;
|
||||
ppi->target_memexp_factr = pspt.target_memexp_factr;
|
||||
ppi->current_memexp_factr = pspt.current_memexp_factr;
|
||||
ppi->cmcs_total_time = pspt.cmcs_total_time;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Retrieve wpar information.
|
||||
bool libperfstat::get_wparinfo(wparinfo_t* pwi) {
|
||||
|
||||
assert(pwi, "get_wparinfo: invalid parameter");
|
||||
memset(pwi, 0, sizeof(wparinfo_t));
|
||||
|
||||
if (libperfstat::wpar_getcid() <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PERFSTAT_WPAR_TOTAL_T_LATEST pswt;
|
||||
memset (&pswt, '\0', sizeof(pswt));
|
||||
|
||||
if (-1 == libperfstat::perfstat_wpar_total(NULL, &pswt, sizeof(PERFSTAT_WPAR_TOTAL_T_LATEST), 1)) {
|
||||
if (-1 == libperfstat::perfstat_wpar_total(NULL, &pswt, sizeof(perfstat_wpar_total_t_61), 1)) {
|
||||
trcVerbose("perfstat_wpar_total() failed (errno=%d)", errno);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// WPAR type info.
|
||||
pwi->app_wpar = pswt.type.b.app_wpar;
|
||||
pwi->cpu_rset = pswt.type.b.cpu_rset;
|
||||
pwi->cpu_xrset = pswt.type.b.cpu_xrset;
|
||||
pwi->cpu_limits = pswt.type.b.cpu_limits;
|
||||
pwi->mem_limits = pswt.type.b.mem_limits;
|
||||
// WPAR total info.
|
||||
strcpy(pwi->name, pswt.name);
|
||||
pwi->wpar_id = pswt.wpar_id;
|
||||
pwi->cpu_limit = pswt.cpu_limit;
|
||||
pwi->mem_limit = pswt.mem_limit;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// encapsulates the libperfstat library.
|
||||
// Encapsulates the libperfstat library.
|
||||
//
|
||||
// The purpose of this code is to dynamically load the libperfstat library
|
||||
// instead of statically linking against it. The libperfstat library is an
|
||||
@ -32,7 +32,732 @@
|
||||
#ifndef OS_AIX_VM_LIBPERFSTAT_AIX_HPP
|
||||
#define OS_AIX_VM_LIBPERFSTAT_AIX_HPP
|
||||
|
||||
#include <libperfstat.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// These are excerpts from the AIX 5.3, 6.1, 7.1 libperfstat.h -
|
||||
// this is all we need from libperfstat.h and I want to avoid having to include <libperfstat.h>
|
||||
//
|
||||
// Note: I define all structures as if I were to include libperfstat.h on an AIX 5.2
|
||||
// build machine.
|
||||
//
|
||||
// The ratio behind that is that if I would build on an AIX 5.2 build machine,
|
||||
// include libperfstat.h and hard-link against libperfstat.a, the program should
|
||||
// work without recompilation on all newer AIX versions.
|
||||
//
|
||||
|
||||
#define IDENTIFIER_LENGTH 64 /* length of strings included in the structures */
|
||||
|
||||
|
||||
typedef struct { /* structure element identifier */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the identifier */
|
||||
} perfstat_id_t;
|
||||
|
||||
#define CEC_ID_LEN 40 /* CEC identifier length */
|
||||
#define MAXCORRALNAMELEN 25 /* length of the wpar name */
|
||||
#define FIRST_WPARNAME "" /* pseudo-name for the first WPAR */
|
||||
#define FIRST_WPARID -1 /* pseudo-id for the first WPAR */
|
||||
|
||||
typedef unsigned short cid_t; /* workload partition identifier */
|
||||
|
||||
typedef struct { /* Virtual memory utilization */
|
||||
u_longlong_t virt_total; /* total virtual memory (in 4KB pages) */
|
||||
u_longlong_t real_total; /* total real memory (in 4KB pages) */
|
||||
u_longlong_t real_free; /* free real memory (in 4KB pages) */
|
||||
u_longlong_t real_pinned; /* real memory which is pinned (in 4KB pages) */
|
||||
u_longlong_t real_inuse; /* real memory which is in use (in 4KB pages) */
|
||||
u_longlong_t pgbad; /* number of bad pages */
|
||||
u_longlong_t pgexct; /* number of page faults */
|
||||
u_longlong_t pgins; /* number of pages paged in */
|
||||
u_longlong_t pgouts; /* number of pages paged out */
|
||||
u_longlong_t pgspins; /* number of page ins from paging space */
|
||||
u_longlong_t pgspouts; /* number of page outs from paging space */
|
||||
u_longlong_t scans; /* number of page scans by clock */
|
||||
u_longlong_t cycles; /* number of page replacement cycles */
|
||||
u_longlong_t pgsteals; /* number of page steals */
|
||||
u_longlong_t numperm; /* number of frames used for files (in 4KB pages) */
|
||||
u_longlong_t pgsp_total; /* total paging space (in 4KB pages) */
|
||||
u_longlong_t pgsp_free; /* free paging space (in 4KB pages) */
|
||||
u_longlong_t pgsp_rsvd; /* reserved paging space (in 4KB pages) */
|
||||
u_longlong_t real_system; /* real memory used by system segments (in 4KB pages). This is the sum of all the used pages in segment marked for system usage.
|
||||
* Since segment classifications are not always guaranteed to be accurate, this number is only an approximation. */
|
||||
u_longlong_t real_user; /* real memory used by non-system segments (in 4KB pages). This is the sum of all pages used in segments not marked for system usage.
|
||||
* Since segment classifications are not always guaranteed to be accurate, this number is only an approximation. */
|
||||
u_longlong_t real_process; /* real memory used by process segments (in 4KB pages). This is real_total-real_free-numperm-real_system. Since real_system is an
|
||||
* approximation, this number is too. */
|
||||
u_longlong_t virt_active; /* Active virtual pages. Virtual pages are considered active if they have been accessed */
|
||||
|
||||
} perfstat_memory_total_t;
|
||||
|
||||
typedef struct { /* global cpu information AIX 5.3 < TL10 */
|
||||
int ncpus; /* number of active logical processors */
|
||||
int ncpus_cfg; /* number of configured processors */
|
||||
char description[IDENTIFIER_LENGTH]; /* processor description (type/official name) */
|
||||
u_longlong_t processorHZ; /* processor speed in Hz */
|
||||
u_longlong_t user; /* raw total number of clock ticks spent in user mode */
|
||||
u_longlong_t sys; /* raw total number of clock ticks spent in system mode */
|
||||
u_longlong_t idle; /* raw total number of clock ticks spent idle */
|
||||
u_longlong_t wait; /* raw total number of clock ticks spent waiting for I/O */
|
||||
u_longlong_t pswitch; /* number of process switches (change in currently running process) */
|
||||
u_longlong_t syscall; /* number of system calls executed */
|
||||
u_longlong_t sysread; /* number of read system calls executed */
|
||||
u_longlong_t syswrite; /* number of write system calls executed */
|
||||
u_longlong_t sysfork; /* number of forks system calls executed */
|
||||
u_longlong_t sysexec; /* number of execs system calls executed */
|
||||
u_longlong_t readch; /* number of characters tranferred with read system call */
|
||||
u_longlong_t writech; /* number of characters tranferred with write system call */
|
||||
u_longlong_t devintrs; /* number of device interrupts */
|
||||
u_longlong_t softintrs; /* number of software interrupts */
|
||||
time_t lbolt; /* number of ticks since last reboot */
|
||||
u_longlong_t loadavg[3]; /* (1<<SBITS) times the average number of runnables processes during the last 1, 5 and 15 minutes.
|
||||
* To calculate the load average, divide the numbers by (1<<SBITS). SBITS is defined in <sys/proc.h>. */
|
||||
u_longlong_t runque; /* length of the run queue (processes ready) */
|
||||
u_longlong_t swpque; /* ength of the swap queue (processes waiting to be paged in) */
|
||||
u_longlong_t bread; /* number of blocks read */
|
||||
u_longlong_t bwrite; /* number of blocks written */
|
||||
u_longlong_t lread; /* number of logical read requests */
|
||||
u_longlong_t lwrite; /* number of logical write requests */
|
||||
u_longlong_t phread; /* number of physical reads (reads on raw devices) */
|
||||
u_longlong_t phwrite; /* number of physical writes (writes on raw devices) */
|
||||
u_longlong_t runocc; /* updated whenever runque is updated, i.e. the runqueue is occupied.
|
||||
* This can be used to compute the simple average of ready processes */
|
||||
u_longlong_t swpocc; /* updated whenever swpque is updated. i.e. the swpqueue is occupied.
|
||||
* This can be used to compute the simple average processes waiting to be paged in */
|
||||
u_longlong_t iget; /* number of inode lookups */
|
||||
u_longlong_t namei; /* number of vnode lookup from a path name */
|
||||
u_longlong_t dirblk; /* number of 512-byte block reads by the directory search routine to locate an entry for a file */
|
||||
u_longlong_t msg; /* number of IPC message operations */
|
||||
u_longlong_t sema; /* number of IPC semaphore operations */
|
||||
u_longlong_t rcvint; /* number of tty receive interrupts */
|
||||
u_longlong_t xmtint; /* number of tyy transmit interrupts */
|
||||
u_longlong_t mdmint; /* number of modem interrupts */
|
||||
u_longlong_t tty_rawinch; /* number of raw input characters */
|
||||
u_longlong_t tty_caninch; /* number of canonical input characters (always zero) */
|
||||
u_longlong_t tty_rawoutch; /* number of raw output characters */
|
||||
u_longlong_t ksched; /* number of kernel processes created */
|
||||
u_longlong_t koverf; /* kernel process creation attempts where:
|
||||
* -the user has forked to their maximum limit
|
||||
* -the configuration limit of processes has been reached */
|
||||
u_longlong_t kexit; /* number of kernel processes that became zombies */
|
||||
u_longlong_t rbread; /* number of remote read requests */
|
||||
u_longlong_t rcread; /* number of cached remote reads */
|
||||
u_longlong_t rbwrt; /* number of remote writes */
|
||||
u_longlong_t rcwrt; /* number of cached remote writes */
|
||||
u_longlong_t traps; /* number of traps */
|
||||
int ncpus_high; /* index of highest processor online */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t decrintrs; /* number of decrementer tics interrupts */
|
||||
u_longlong_t mpcrintrs; /* number of mpc's received interrupts */
|
||||
u_longlong_t mpcsintrs; /* number of mpc's sent interrupts */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
short iowait; /* number of processes that are asleep waiting for buffered I/O */
|
||||
short physio; /* number of processes waiting for raw I/O */
|
||||
longlong_t twait; /* number of threads that are waiting for filesystem direct(cio) */
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds) */
|
||||
} perfstat_cpu_total_t_53;
|
||||
|
||||
typedef struct { /* global cpu information AIX 6.1|5.3 > TL09 */
|
||||
int ncpus; /* number of active logical processors */
|
||||
int ncpus_cfg; /* number of configured processors */
|
||||
char description[IDENTIFIER_LENGTH]; /* processor description (type/official name) */
|
||||
u_longlong_t processorHZ; /* processor speed in Hz */
|
||||
u_longlong_t user; /* raw total number of clock ticks spent in user mode */
|
||||
u_longlong_t sys; /* raw total number of clock ticks spent in system mode */
|
||||
u_longlong_t idle; /* raw total number of clock ticks spent idle */
|
||||
u_longlong_t wait; /* raw total number of clock ticks spent waiting for I/O */
|
||||
u_longlong_t pswitch; /* number of process switches (change in currently running process) */
|
||||
u_longlong_t syscall; /* number of system calls executed */
|
||||
u_longlong_t sysread; /* number of read system calls executed */
|
||||
u_longlong_t syswrite; /* number of write system calls executed */
|
||||
u_longlong_t sysfork; /* number of forks system calls executed */
|
||||
u_longlong_t sysexec; /* number of execs system calls executed */
|
||||
u_longlong_t readch; /* number of characters tranferred with read system call */
|
||||
u_longlong_t writech; /* number of characters tranferred with write system call */
|
||||
u_longlong_t devintrs; /* number of device interrupts */
|
||||
u_longlong_t softintrs; /* number of software interrupts */
|
||||
time_t lbolt; /* number of ticks since last reboot */
|
||||
u_longlong_t loadavg[3]; /* (1<<SBITS) times the average number of runnables processes during the last 1, 5 and 15 minutes.
|
||||
* To calculate the load average, divide the numbers by (1<<SBITS). SBITS is defined in <sys/proc.h>. */
|
||||
u_longlong_t runque; /* length of the run queue (processes ready) */
|
||||
u_longlong_t swpque; /* length of the swap queue (processes waiting to be paged in) */
|
||||
u_longlong_t bread; /* number of blocks read */
|
||||
u_longlong_t bwrite; /* number of blocks written */
|
||||
u_longlong_t lread; /* number of logical read requests */
|
||||
u_longlong_t lwrite; /* number of logical write requests */
|
||||
u_longlong_t phread; /* number of physical reads (reads on raw devices) */
|
||||
u_longlong_t phwrite; /* number of physical writes (writes on raw devices) */
|
||||
u_longlong_t runocc; /* updated whenever runque is updated, i.e. the runqueue is occupied.
|
||||
* This can be used to compute the simple average of ready processes */
|
||||
u_longlong_t swpocc; /* updated whenever swpque is updated. i.e. the swpqueue is occupied.
|
||||
* This can be used to compute the simple average processes waiting to be paged in */
|
||||
u_longlong_t iget; /* number of inode lookups */
|
||||
u_longlong_t namei; /* number of vnode lookup from a path name */
|
||||
u_longlong_t dirblk; /* number of 512-byte block reads by the directory search routine to locate an entry for a file */
|
||||
u_longlong_t msg; /* number of IPC message operations */
|
||||
u_longlong_t sema; /* number of IPC semaphore operations */
|
||||
u_longlong_t rcvint; /* number of tty receive interrupts */
|
||||
u_longlong_t xmtint; /* number of tyy transmit interrupts */
|
||||
u_longlong_t mdmint; /* number of modem interrupts */
|
||||
u_longlong_t tty_rawinch; /* number of raw input characters */
|
||||
u_longlong_t tty_caninch; /* number of canonical input characters (always zero) */
|
||||
u_longlong_t tty_rawoutch; /* number of raw output characters */
|
||||
u_longlong_t ksched; /* number of kernel processes created */
|
||||
u_longlong_t koverf; /* kernel process creation attempts where:
|
||||
* -the user has forked to their maximum limit
|
||||
* -the configuration limit of processes has been reached */
|
||||
u_longlong_t kexit; /* number of kernel processes that became zombies */
|
||||
u_longlong_t rbread; /* number of remote read requests */
|
||||
u_longlong_t rcread; /* number of cached remote reads */
|
||||
u_longlong_t rbwrt; /* number of remote writes */
|
||||
u_longlong_t rcwrt; /* number of cached remote writes */
|
||||
u_longlong_t traps; /* number of traps */
|
||||
int ncpus_high; /* index of highest processor online */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t decrintrs; /* number of decrementer tics interrupts */
|
||||
u_longlong_t mpcrintrs; /* number of mpc's received interrupts */
|
||||
u_longlong_t mpcsintrs; /* number of mpc's sent interrupts */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
short iowait; /* number of processes that are asleep waiting for buffered I/O */
|
||||
short physio; /* number of processes waiting for raw I/O */
|
||||
longlong_t twait; /* number of threads that are waiting for filesystem direct(cio) */
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds) */
|
||||
u_longlong_t puser_spurr; /* number of spurr cycles spent in user mode */
|
||||
u_longlong_t psys_spurr; /* number of spurr cycles spent in kernel mode */
|
||||
u_longlong_t pidle_spurr; /* number of spurr cycles spent in idle mode */
|
||||
u_longlong_t pwait_spurr; /* number of spurr cycles spent in wait mode */
|
||||
int spurrflag; /* set if running in spurr mode */
|
||||
} perfstat_cpu_total_t_61;
|
||||
|
||||
typedef struct { /* global cpu information AIX 7.1 */
|
||||
int ncpus; /* number of active logical processors */
|
||||
int ncpus_cfg; /* number of configured processors */
|
||||
char description[IDENTIFIER_LENGTH]; /* processor description (type/official name) */
|
||||
u_longlong_t processorHZ; /* processor speed in Hz */
|
||||
u_longlong_t user; /* raw total number of clock ticks spent in user mode */
|
||||
u_longlong_t sys; /* raw total number of clock ticks spent in system mode */
|
||||
u_longlong_t idle; /* raw total number of clock ticks spent idle */
|
||||
u_longlong_t wait; /* raw total number of clock ticks spent waiting for I/O */
|
||||
u_longlong_t pswitch; /* number of process switches (change in currently running process) */
|
||||
u_longlong_t syscall; /* number of system calls executed */
|
||||
u_longlong_t sysread; /* number of read system calls executed */
|
||||
u_longlong_t syswrite; /* number of write system calls executed */
|
||||
u_longlong_t sysfork; /* number of forks system calls executed */
|
||||
u_longlong_t sysexec; /* number of execs system calls executed */
|
||||
u_longlong_t readch; /* number of characters tranferred with read system call */
|
||||
u_longlong_t writech; /* number of characters tranferred with write system call */
|
||||
u_longlong_t devintrs; /* number of device interrupts */
|
||||
u_longlong_t softintrs; /* number of software interrupts */
|
||||
time_t lbolt; /* number of ticks since last reboot */
|
||||
u_longlong_t loadavg[3]; /* (1<<SBITS) times the average number of runnables processes during the last 1, 5 and 15 minutes.
|
||||
* To calculate the load average, divide the numbers by (1<<SBITS). SBITS is defined in <sys/proc.h>. */
|
||||
u_longlong_t runque; /* length of the run queue (processes ready) */
|
||||
u_longlong_t swpque; /* ength of the swap queue (processes waiting to be paged in) */
|
||||
u_longlong_t bread; /* number of blocks read */
|
||||
u_longlong_t bwrite; /* number of blocks written */
|
||||
u_longlong_t lread; /* number of logical read requests */
|
||||
u_longlong_t lwrite; /* number of logical write requests */
|
||||
u_longlong_t phread; /* number of physical reads (reads on raw devices) */
|
||||
u_longlong_t phwrite; /* number of physical writes (writes on raw devices) */
|
||||
u_longlong_t runocc; /* updated whenever runque is updated, i.e. the runqueue is occupied.
|
||||
* This can be used to compute the simple average of ready processes */
|
||||
u_longlong_t swpocc; /* updated whenever swpque is updated. i.e. the swpqueue is occupied.
|
||||
* This can be used to compute the simple average processes waiting to be paged in */
|
||||
u_longlong_t iget; /* number of inode lookups */
|
||||
u_longlong_t namei; /* number of vnode lookup from a path name */
|
||||
u_longlong_t dirblk; /* number of 512-byte block reads by the directory search routine to locate an entry for a file */
|
||||
u_longlong_t msg; /* number of IPC message operations */
|
||||
u_longlong_t sema; /* number of IPC semaphore operations */
|
||||
u_longlong_t rcvint; /* number of tty receive interrupts */
|
||||
u_longlong_t xmtint; /* number of tyy transmit interrupts */
|
||||
u_longlong_t mdmint; /* number of modem interrupts */
|
||||
u_longlong_t tty_rawinch; /* number of raw input characters */
|
||||
u_longlong_t tty_caninch; /* number of canonical input characters (always zero) */
|
||||
u_longlong_t tty_rawoutch; /* number of raw output characters */
|
||||
u_longlong_t ksched; /* number of kernel processes created */
|
||||
u_longlong_t koverf; /* kernel process creation attempts where:
|
||||
* -the user has forked to their maximum limit
|
||||
* -the configuration limit of processes has been reached */
|
||||
u_longlong_t kexit; /* number of kernel processes that became zombies */
|
||||
u_longlong_t rbread; /* number of remote read requests */
|
||||
u_longlong_t rcread; /* number of cached remote reads */
|
||||
u_longlong_t rbwrt; /* number of remote writes */
|
||||
u_longlong_t rcwrt; /* number of cached remote writes */
|
||||
u_longlong_t traps; /* number of traps */
|
||||
int ncpus_high; /* index of highest processor online */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t decrintrs; /* number of decrementer tics interrupts */
|
||||
u_longlong_t mpcrintrs; /* number of mpc's received interrupts */
|
||||
u_longlong_t mpcsintrs; /* number of mpc's sent interrupts */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
short iowait; /* number of processes that are asleep waiting for buffered I/O */
|
||||
short physio; /* number of processes waiting for raw I/O */
|
||||
longlong_t twait; /* number of threads that are waiting for filesystem direct(cio) */
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds) */
|
||||
u_longlong_t puser_spurr; /* number of spurr cycles spent in user mode */
|
||||
u_longlong_t psys_spurr; /* number of spurr cycles spent in kernel mode */
|
||||
u_longlong_t pidle_spurr; /* number of spurr cycles spent in idle mode */
|
||||
u_longlong_t pwait_spurr; /* number of spurr cycles spent in wait mode */
|
||||
int spurrflag; /* set if running in spurr mode */
|
||||
u_longlong_t version; /* version number (1, 2, etc.,) */
|
||||
/* >>>>> END OF STRUCTURE DEFINITION <<<<< */
|
||||
#define CURR_VERSION_CPU_TOTAL 1 /* Incremented by one for every new release *
|
||||
* of perfstat_cpu_total_t data structure */
|
||||
} perfstat_cpu_total_t_71;
|
||||
|
||||
typedef union {
|
||||
uint w;
|
||||
struct {
|
||||
unsigned smt_capable :1; /* OS supports SMT mode */
|
||||
unsigned smt_enabled :1; /* SMT mode is on */
|
||||
unsigned lpar_capable :1; /* OS supports logical partitioning */
|
||||
unsigned lpar_enabled :1; /* logical partitioning is on */
|
||||
unsigned shared_capable :1; /* OS supports shared processor LPAR */
|
||||
unsigned shared_enabled :1; /* partition runs in shared mode */
|
||||
unsigned dlpar_capable :1; /* OS supports dynamic LPAR */
|
||||
unsigned capped :1; /* partition is capped */
|
||||
unsigned kernel_is_64 :1; /* kernel is 64 bit */
|
||||
unsigned pool_util_authority :1; /* pool utilization available */
|
||||
unsigned donate_capable :1; /* capable of donating cycles */
|
||||
unsigned donate_enabled :1; /* enabled for donating cycles */
|
||||
unsigned ams_capable:1; /* 1 = AMS(Active Memory Sharing) capable, 0 = Not AMS capable */
|
||||
unsigned ams_enabled:1; /* 1 = AMS(Active Memory Sharing) enabled, 0 = Not AMS enabled */
|
||||
unsigned power_save:1; /* 1 = Power saving mode is enabled */
|
||||
unsigned ame_enabled:1; /* Active Memory Expansion is enabled */
|
||||
unsigned shared_extended :1;
|
||||
unsigned spare :15; /* reserved for future usage */
|
||||
} b;
|
||||
} perfstat_partition_type_t;
|
||||
|
||||
typedef struct { /* partition total information AIX 5.3 < TL6 */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
perfstat_partition_type_t type; /* set of bits describing the partition */
|
||||
int lpar_id; /* logical partition identifier */
|
||||
int group_id; /* identifier of the LPAR group this partition is a member of */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int max_cpus; /* maximum number of virtual CPUs this parition can ever have */
|
||||
int min_cpus; /* minimum number of virtual CPUs this partition must have */
|
||||
u_longlong_t online_memory; /* amount of memory currently online */
|
||||
u_longlong_t max_memory; /* maximum amount of memory this partition can ever have */
|
||||
u_longlong_t min_memory; /* minimum amount of memory this partition must have */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int max_proc_capacity; /* maximum number of processor units this partition can ever have */
|
||||
int min_proc_capacity; /* minimum number of processor units this partition must have */
|
||||
int proc_capacity_increment; /* increment value to the entitled capacity */
|
||||
int unalloc_proc_capacity; /* number of processor units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int unalloc_var_proc_capacity_weight; /* number of variable processor capacity weight units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int online_phys_cpus_sys; /* number of physical CPUs currently active in the system containing this partition */
|
||||
int max_phys_cpus_sys; /* maximum possible number of physical CPUs in the system containing this partition */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t pool_idle_time; /* number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts received by the partition */
|
||||
u_longlong_t invol_virt_cswitch; /* number involuntary virtual CPU context switches */
|
||||
u_longlong_t vol_virt_cswitch; /* number voluntary virtual CPU context switches */
|
||||
u_longlong_t timebase_last; /* most recently cpu time base */
|
||||
u_longlong_t reserved_pages; /* Currenlty number of 16GB pages. Cannot participate in DR operations */
|
||||
u_longlong_t reserved_pagesize; /* Currently 16GB pagesize Cannot participate in DR operations */
|
||||
} perfstat_partition_total_t_53_5;
|
||||
|
||||
typedef struct { /* partition total information AIX 5.3 < TL10 */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
perfstat_partition_type_t type; /* set of bits describing the partition */
|
||||
int lpar_id; /* logical partition identifier */
|
||||
int group_id; /* identifier of the LPAR group this partition is a member of */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int max_cpus; /* maximum number of virtual CPUs this parition can ever have */
|
||||
int min_cpus; /* minimum number of virtual CPUs this partition must have */
|
||||
u_longlong_t online_memory; /* amount of memory currently online */
|
||||
u_longlong_t max_memory; /* maximum amount of memory this partition can ever have */
|
||||
u_longlong_t min_memory; /* minimum amount of memory this partition must have */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int max_proc_capacity; /* maximum number of processor units this partition can ever have */
|
||||
int min_proc_capacity; /* minimum number of processor units this partition must have */
|
||||
int proc_capacity_increment; /* increment value to the entitled capacity */
|
||||
int unalloc_proc_capacity; /* number of processor units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int unalloc_var_proc_capacity_weight; /* number of variable processor capacity weight units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int online_phys_cpus_sys; /* number of physical CPUs currently active in the system containing this partition */
|
||||
int max_phys_cpus_sys; /* maximum possible number of physical CPUs in the system containing this partition */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t pool_idle_time; /* number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts received by the partition */
|
||||
u_longlong_t invol_virt_cswitch; /* number involuntary virtual CPU context switches */
|
||||
u_longlong_t vol_virt_cswitch; /* number voluntary virtual CPU context switches */
|
||||
u_longlong_t timebase_last; /* most recently cpu time base */
|
||||
u_longlong_t reserved_pages; /* Currenlty number of 16GB pages. Cannot participate in DR operations */
|
||||
u_longlong_t reserved_pagesize; /* Currently 16GB pagesize Cannot participate in DR operations */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t shcpus_in_sys; /* Number of physical processors allocated for shared processor use */
|
||||
u_longlong_t max_pool_capacity; /* Maximum processor capacity of partitions pool */
|
||||
u_longlong_t entitled_pool_capacity; /* Entitled processor capacity of partitions pool */
|
||||
u_longlong_t pool_max_time; /* Summation of maximum time that could be consumed by the pool (nano seconds) */
|
||||
u_longlong_t pool_busy_time; /* Summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t pool_scaled_busy_time; /* Scaled summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t shcpu_tot_time; /* Summation of total time across all physical processors allocated for shared processor use (nano seconds) */
|
||||
u_longlong_t shcpu_busy_time; /* Summation of busy (non-idle) time accumulated across all shared processor partitions (nano seconds) */
|
||||
u_longlong_t shcpu_scaled_busy_time; /* Scaled summation of busy time accumulated across all shared processor partitions (nano seconds) */
|
||||
int ams_pool_id; /* AMS pool id of the pool the LPAR belongs to */
|
||||
int var_mem_weight; /* variable memory capacity weight */
|
||||
u_longlong_t iome; /* I/O memory entitlement of the partition in bytes*/
|
||||
u_longlong_t pmem; /* Physical memory currently backing the partition's logical memory in bytes*/
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds)*/
|
||||
u_longlong_t hypv_pagesize; /* Hypervisor page size in KB*/
|
||||
} perfstat_partition_total_t_53;
|
||||
|
||||
typedef struct { /* partition total information AIX 6.1|5.3 > TL09 */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
perfstat_partition_type_t type; /* set of bits describing the partition */
|
||||
int lpar_id; /* logical partition identifier */
|
||||
int group_id; /* identifier of the LPAR group this partition is a member of */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int max_cpus; /* maximum number of virtual CPUs this parition can ever have */
|
||||
int min_cpus; /* minimum number of virtual CPUs this partition must have */
|
||||
u_longlong_t online_memory; /* amount of memory currently online */
|
||||
u_longlong_t max_memory; /* maximum amount of memory this partition can ever have */
|
||||
u_longlong_t min_memory; /* minimum amount of memory this partition must have */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int max_proc_capacity; /* maximum number of processor units this partition can ever have */
|
||||
int min_proc_capacity; /* minimum number of processor units this partition must have */
|
||||
int proc_capacity_increment; /* increment value to the entitled capacity */
|
||||
int unalloc_proc_capacity; /* number of processor units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int unalloc_var_proc_capacity_weight; /* number of variable processor capacity weight units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int online_phys_cpus_sys; /* number of physical CPUs currently active in the system containing this partition */
|
||||
int max_phys_cpus_sys; /* maximum possible number of physical CPUs in the system containing this partition */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t pool_idle_time; /* number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts received by the partition */
|
||||
u_longlong_t invol_virt_cswitch; /* number involuntary virtual CPU context switches */
|
||||
u_longlong_t vol_virt_cswitch; /* number voluntary virtual CPU context switches */
|
||||
u_longlong_t timebase_last; /* most recently cpu time base */
|
||||
u_longlong_t reserved_pages; /* Currenlty number of 16GB pages. Cannot participate in DR operations */
|
||||
u_longlong_t reserved_pagesize; /* Currently 16GB pagesize Cannot participate in DR operations */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t shcpus_in_sys; /* Number of physical processors allocated for shared processor use */
|
||||
u_longlong_t max_pool_capacity; /* Maximum processor capacity of partitions pool */
|
||||
u_longlong_t entitled_pool_capacity; /* Entitled processor capacity of partitions pool */
|
||||
u_longlong_t pool_max_time; /* Summation of maximum time that could be consumed by the pool (nano seconds) */
|
||||
u_longlong_t pool_busy_time; /* Summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t pool_scaled_busy_time; /* Scaled summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t shcpu_tot_time; /* Summation of total time across all physical processors allocated for shared processor use (nano seconds) */
|
||||
u_longlong_t shcpu_busy_time; /* Summation of busy (non-idle) time accumulated across all shared processor partitions (nano seconds) */
|
||||
u_longlong_t shcpu_scaled_busy_time; /* Scaled summation of busy time accumulated across all shared processor partitions (nano seconds) */
|
||||
int ams_pool_id; /* AMS pool id of the pool the LPAR belongs to */
|
||||
int var_mem_weight; /* variable memory capacity weight */
|
||||
u_longlong_t iome; /* I/O memory entitlement of the partition in bytes*/
|
||||
u_longlong_t pmem; /* Physical memory currently backing the partition's logical memory in bytes*/
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds)*/
|
||||
u_longlong_t hypv_pagesize; /* Hypervisor page size in KB*/
|
||||
uint online_lcpus; /* number of online logical cpus */
|
||||
uint smt_thrds; /* number of hardware threads that are running */
|
||||
u_longlong_t puser_spurr; /* number of spurr cycles spent in user mode */
|
||||
u_longlong_t psys_spurr; /* number of spurr cycles spent in kernel mode */
|
||||
u_longlong_t pidle_spurr; /* number of spurr cycles spent in idle mode */
|
||||
u_longlong_t pwait_spurr; /* number of spurr cycles spent in wait mode */
|
||||
int spurrflag; /* set if running in spurr mode */
|
||||
} perfstat_partition_total_t_61;
|
||||
|
||||
typedef struct { /* partition total information AIX 7.1 */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
perfstat_partition_type_t type; /* set of bits describing the partition */
|
||||
int lpar_id; /* logical partition identifier */
|
||||
int group_id; /* identifier of the LPAR group this partition is a member of */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int max_cpus; /* maximum number of virtual CPUs this parition can ever have */
|
||||
int min_cpus; /* minimum number of virtual CPUs this partition must have */
|
||||
u_longlong_t online_memory; /* amount of memory currently online */
|
||||
u_longlong_t max_memory; /* maximum amount of memory this partition can ever have */
|
||||
u_longlong_t min_memory; /* minimum amount of memory this partition must have */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int max_proc_capacity; /* maximum number of processor units this partition can ever have */
|
||||
int min_proc_capacity; /* minimum number of processor units this partition must have */
|
||||
int proc_capacity_increment; /* increment value to the entitled capacity */
|
||||
int unalloc_proc_capacity; /* number of processor units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int unalloc_var_proc_capacity_weight; /* number of variable processor capacity weight units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int online_phys_cpus_sys; /* number of physical CPUs currently active in the system containing this partition */
|
||||
int max_phys_cpus_sys; /* maximum possible number of physical CPUs in the system containing this partition */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t pool_idle_time; /* number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts received by the partition */
|
||||
u_longlong_t invol_virt_cswitch; /* number involuntary virtual CPU context switches */
|
||||
u_longlong_t vol_virt_cswitch; /* number voluntary virtual CPU context switches */
|
||||
u_longlong_t timebase_last; /* most recently cpu time base */
|
||||
u_longlong_t reserved_pages; /* Currenlty number of 16GB pages. Cannot participate in DR operations */
|
||||
u_longlong_t reserved_pagesize; /* Currently 16GB pagesize Cannot participate in DR operations */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t shcpus_in_sys; /* Number of physical processors allocated for shared processor use */
|
||||
u_longlong_t max_pool_capacity; /* Maximum processor capacity of partitions pool */
|
||||
u_longlong_t entitled_pool_capacity; /* Entitled processor capacity of partitions pool */
|
||||
u_longlong_t pool_max_time; /* Summation of maximum time that could be consumed by the pool (nano seconds) */
|
||||
u_longlong_t pool_busy_time; /* Summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t pool_scaled_busy_time; /* Scaled summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t shcpu_tot_time; /* Summation of total time across all physical processors allocated for shared processor use (nano seconds) */
|
||||
u_longlong_t shcpu_busy_time; /* Summation of busy (non-idle) time accumulated across all shared processor partitions (nano seconds) */
|
||||
u_longlong_t shcpu_scaled_busy_time; /* Scaled summation of busy time accumulated across all shared processor partitions (nano seconds) */
|
||||
int ams_pool_id; /* AMS pool id of the pool the LPAR belongs to */
|
||||
int var_mem_weight; /* variable memory capacity weight */
|
||||
u_longlong_t iome; /* I/O memory entitlement of the partition in bytes*/
|
||||
u_longlong_t pmem; /* Physical memory currently backing the partition's logical memory in bytes*/
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds)*/
|
||||
u_longlong_t hypv_pagesize; /* Hypervisor page size in KB*/
|
||||
uint online_lcpus; /* number of online logical cpus */
|
||||
uint smt_thrds; /* number of hardware threads that are running */
|
||||
u_longlong_t puser_spurr; /* number of spurr cycles spent in user mode */
|
||||
u_longlong_t psys_spurr; /* number of spurr cycles spent in kernel mode */
|
||||
u_longlong_t pidle_spurr; /* number of spurr cycles spent in idle mode */
|
||||
u_longlong_t pwait_spurr; /* number of spurr cycles spent in wait mode */
|
||||
int spurrflag; /* set if running in spurr mode */
|
||||
char hardwareid[CEC_ID_LEN]; /* CEC Identifier */
|
||||
uint power_save_mode; /* Power save mode for the LPAR. Introduced through LI 53K PRF : Feature 728 292*/
|
||||
ushort ame_version; /* AME Version */
|
||||
u_longlong_t true_memory; /* True Memory Size in 4KB pages */
|
||||
u_longlong_t expanded_memory; /* Expanded Memory Size in 4KB pages */
|
||||
u_longlong_t target_memexp_factr; /* Target Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t current_memexp_factr; /* Current Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t target_cpool_size; /* Target Compressed Pool Size in bytes */
|
||||
u_longlong_t max_cpool_size; /* Max Size of Compressed Pool in bytes */
|
||||
u_longlong_t min_ucpool_size; /* Min Size of Uncompressed Pool in bytes */
|
||||
u_longlong_t ame_deficit_size; /*Deficit memory size in bytes */
|
||||
u_longlong_t version; /* version number (1, 2, etc.,) */
|
||||
u_longlong_t cmcs_total_time; /* Total CPU time spent due to active memory expansion */
|
||||
} perfstat_partition_total_t_71;
|
||||
|
||||
typedef struct { /* partition total information AIX 7.1 >= TL1*/
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
perfstat_partition_type_t type; /* set of bits describing the partition */
|
||||
int lpar_id; /* logical partition identifier */
|
||||
int group_id; /* identifier of the LPAR group this partition is a member of */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int max_cpus; /* maximum number of virtual CPUs this parition can ever have */
|
||||
int min_cpus; /* minimum number of virtual CPUs this partition must have */
|
||||
u_longlong_t online_memory; /* amount of memory currently online */
|
||||
u_longlong_t max_memory; /* maximum amount of memory this partition can ever have */
|
||||
u_longlong_t min_memory; /* minimum amount of memory this partition must have */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int max_proc_capacity; /* maximum number of processor units this partition can ever have */
|
||||
int min_proc_capacity; /* minimum number of processor units this partition must have */
|
||||
int proc_capacity_increment; /* increment value to the entitled capacity */
|
||||
int unalloc_proc_capacity; /* number of processor units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int unalloc_var_proc_capacity_weight; /* number of variable processor capacity weight units currently unallocated in the shared processor pool this partition belongs to */
|
||||
int online_phys_cpus_sys; /* number of physical CPUs currently active in the system containing this partition */
|
||||
int max_phys_cpus_sys; /* maximum possible number of physical CPUs in the system containing this partition */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
u_longlong_t puser; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t psys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pidle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pwait; /* raw number of physical processor tics waiting for I/O */
|
||||
u_longlong_t pool_idle_time; /* number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t phantintrs; /* number of phantom interrupts received by the partition */
|
||||
u_longlong_t invol_virt_cswitch; /* number involuntary virtual CPU context switches */
|
||||
u_longlong_t vol_virt_cswitch; /* number voluntary virtual CPU context switches */
|
||||
u_longlong_t timebase_last; /* most recently cpu time base */
|
||||
u_longlong_t reserved_pages; /* Currenlty number of 16GB pages. Cannot participate in DR operations */
|
||||
u_longlong_t reserved_pagesize; /* Currently 16GB pagesize Cannot participate in DR operations */
|
||||
u_longlong_t idle_donated_purr; /* number of idle cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_donated_spurr; /* number of idle spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_purr; /* number of busy cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t busy_donated_spurr; /* number of busy spurr cycles donated by a dedicated partition enabled for donation */
|
||||
u_longlong_t idle_stolen_purr; /* number of idle cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t idle_stolen_spurr; /* number of idle spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_purr; /* number of busy cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t busy_stolen_spurr; /* number of busy spurr cycles stolen by the hypervisor from a dedicated partition */
|
||||
u_longlong_t shcpus_in_sys; /* Number of physical processors allocated for shared processor use */
|
||||
u_longlong_t max_pool_capacity; /* Maximum processor capacity of partitions pool */
|
||||
u_longlong_t entitled_pool_capacity; /* Entitled processor capacity of partitions pool */
|
||||
u_longlong_t pool_max_time; /* Summation of maximum time that could be consumed by the pool (nano seconds) */
|
||||
u_longlong_t pool_busy_time; /* Summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t pool_scaled_busy_time; /* Scaled summation of busy (non-idle) time accumulated across all partitions in the pool (nano seconds) */
|
||||
u_longlong_t shcpu_tot_time; /* Summation of total time across all physical processors allocated for shared processor use (nano seconds) */
|
||||
u_longlong_t shcpu_busy_time; /* Summation of busy (non-idle) time accumulated across all shared processor partitions (nano seconds) */
|
||||
u_longlong_t shcpu_scaled_busy_time; /* Scaled summation of busy time accumulated across all shared processor partitions (nano seconds) */
|
||||
int ams_pool_id; /* AMS pool id of the pool the LPAR belongs to */
|
||||
int var_mem_weight; /* variable memory capacity weight */
|
||||
u_longlong_t iome; /* I/O memory entitlement of the partition in bytes*/
|
||||
u_longlong_t pmem; /* Physical memory currently backing the partition's logical memory in bytes*/
|
||||
u_longlong_t hpi; /* number of hypervisor page-ins */
|
||||
u_longlong_t hpit; /* Time spent in hypervisor page-ins (in nanoseconds)*/
|
||||
u_longlong_t hypv_pagesize; /* Hypervisor page size in KB*/
|
||||
uint online_lcpus; /* number of online logical cpus */
|
||||
uint smt_thrds; /* number of hardware threads that are running */
|
||||
u_longlong_t puser_spurr; /* number of spurr cycles spent in user mode */
|
||||
u_longlong_t psys_spurr; /* number of spurr cycles spent in kernel mode */
|
||||
u_longlong_t pidle_spurr; /* number of spurr cycles spent in idle mode */
|
||||
u_longlong_t pwait_spurr; /* number of spurr cycles spent in wait mode */
|
||||
int spurrflag; /* set if running in spurr mode */
|
||||
char hardwareid[CEC_ID_LEN]; /* CEC Identifier */
|
||||
uint power_save_mode; /* Power save mode for the LPAR. Introduced through LI 53K PRF : Feature 728 292*/
|
||||
ushort ame_version; /* AME Version */
|
||||
u_longlong_t true_memory; /* True Memory Size in 4KB pages */
|
||||
u_longlong_t expanded_memory; /* Expanded Memory Size in 4KB pages */
|
||||
u_longlong_t target_memexp_factr; /* Target Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t current_memexp_factr; /* Current Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t target_cpool_size; /* Target Compressed Pool Size in bytes */
|
||||
u_longlong_t max_cpool_size; /* Max Size of Compressed Pool in bytes */
|
||||
u_longlong_t min_ucpool_size; /* Min Size of Uncompressed Pool in bytes */
|
||||
u_longlong_t ame_deficit_size; /*Deficit memory size in bytes */
|
||||
u_longlong_t version; /* version number (1, 2, etc.,) */
|
||||
u_longlong_t cmcs_total_time; /* Total CPU time spent due to active memory expansion */
|
||||
u_longlong_t purr_coalescing; /* If the calling partition is authorized to see pool wide statistics then PURR cycles consumed to coalesce data else set to zero.*/
|
||||
u_longlong_t spurr_coalescing; /* If the calling partition is authorized to see pool wide statistics then SPURR cycles consumed to coalesce data else set to zero.*/
|
||||
u_longlong_t MemPoolSize; /* Indicates the memory pool size of the pool that the partition belongs to (in bytes)., mpsz */
|
||||
u_longlong_t IOMemEntInUse; /* I/O memory entitlement of the LPAR in use in bytes. iomu */
|
||||
u_longlong_t IOMemEntFree; /* free I/O memory entitlement in bytes. iomf */
|
||||
u_longlong_t IOHighWaterMark; /* high water mark of I/O memory entitlement usage in bytes. iohwn */
|
||||
u_longlong_t purr_counter; /* number of purr cycles spent in user + kernel mode */
|
||||
u_longlong_t spurr_counter; /* number of spurr cycles spent in user + kernel mode */
|
||||
|
||||
/* Marketing Requirement(MR): MR1124083744 */
|
||||
u_longlong_t real_free; /* free real memory (in 4KB pages) */
|
||||
u_longlong_t real_avail; /* number of pages available for user application (memfree + numperm - minperm - minfree) */
|
||||
/* >>>>> END OF STRUCTURE DEFINITION <<<<< */
|
||||
#define CURR_VERSION_PARTITION_TOTAL 5 /* Incremented by one for every new release *
|
||||
* of perfstat_partition_total_t data structure */
|
||||
} perfstat_partition_total_t_71_1;
|
||||
|
||||
typedef union { /* WPAR Type & Flags */
|
||||
uint w;
|
||||
struct {
|
||||
unsigned app_wpar :1; /* Application WPAR */
|
||||
unsigned cpu_rset :1; /* WPAR restricted to CPU resource set */
|
||||
unsigned cpu_xrset:1; /* WPAR restricted to CPU Exclusive resource set */
|
||||
unsigned cpu_limits :1; /* CPU resource limits enforced */
|
||||
unsigned mem_limits :1; /* Memory resource limits enforced */
|
||||
unsigned spare :27; /* reserved for future usage */
|
||||
} b;
|
||||
} perfstat_wpar_type_t;
|
||||
|
||||
typedef struct { /* Workload partition Information AIX 5.3 & 6.1*/
|
||||
char name[MAXCORRALNAMELEN+1]; /* name of the Workload Partition */
|
||||
perfstat_wpar_type_t type; /* set of bits describing the wpar */
|
||||
cid_t wpar_id; /* workload partition identifier */
|
||||
uint online_cpus; /* Number of Virtual CPUs in partition rset or number of virtual CPUs currently online on the Global partition*/
|
||||
int cpu_limit; /* CPU limit in 100ths of % - 1..10000 */
|
||||
int mem_limit; /* Memory limit in 100ths of % - 1..10000 */
|
||||
u_longlong_t online_memory; /* amount of memory currently online in Global Partition */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
} perfstat_wpar_total_t_61;
|
||||
|
||||
typedef struct { /* Workload partition Information AIX 7.1*/
|
||||
char name[MAXCORRALNAMELEN+1]; /* name of the Workload Partition */
|
||||
perfstat_wpar_type_t type; /* set of bits describing the wpar */
|
||||
cid_t wpar_id; /* workload partition identifier */
|
||||
uint online_cpus; /* Number of Virtual CPUs in partition rset or number of virtual CPUs currently online on the Global partition*/
|
||||
int cpu_limit; /* CPU limit in 100ths of % - 1..10000 */
|
||||
int mem_limit; /* Memory limit in 100ths of % - 1..10000 */
|
||||
u_longlong_t online_memory; /* amount of memory currently online in Global Partition */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
u_longlong_t version; /* version number (1, 2, etc.,) */
|
||||
/* >>>>> END OF STRUCTURE DEFINITION <<<<< */
|
||||
#define CURR_VERSION_WPAR_TOTAL 1 /* Incremented by one for every new release *
|
||||
* of perfstat_wpar_total_t data structure */
|
||||
} perfstat_wpar_total_t_71;
|
||||
|
||||
typedef void * rsethandle_t; /* Type to identify a resource set handle: rsethandle_t */
|
||||
|
||||
typedef enum { WPARNAME, WPARID, RSETHANDLE } wparid_specifier; /* Type of wparid_specifier */
|
||||
|
||||
typedef struct { /* WPAR identifier */
|
||||
wparid_specifier spec; /* Specifier to choose wpar id or name */
|
||||
union {
|
||||
cid_t wpar_id; /* WPAR ID */
|
||||
rsethandle_t rset; /* Rset Handle */
|
||||
char wparname[MAXCORRALNAMELEN+1]; /* WPAR NAME */
|
||||
} u;
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the structure element identifier */
|
||||
} perfstat_id_wpar_t;
|
||||
|
||||
|
||||
|
||||
// end: libperfstat.h (AIX 5.2, 5.3, 6.1, 7.1)
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define PERFSTAT_PARTITON_TOTAL_T_LATEST perfstat_partition_total_t_71_1/* latest perfstat_partition_total_t structure */
|
||||
#define PERFSTAT_CPU_TOTAL_T_LATEST perfstat_cpu_total_t_71 /* latest perfstat_cpu_total_t structure */
|
||||
#define PERFSTAT_WPAR_TOTAL_T_LATEST perfstat_wpar_total_t_71 /* latest perfstat_wpar_total_t structure */
|
||||
|
||||
class libperfstat {
|
||||
|
||||
@ -41,19 +766,107 @@ public:
|
||||
// Load the libperfstat library (must be in LIBPATH).
|
||||
// Returns true if succeeded, false if error.
|
||||
static bool init();
|
||||
|
||||
// cleanup of the libo4 porting library.
|
||||
static void cleanup();
|
||||
|
||||
// direct wrappers for the libperfstat functionality. All they do is
|
||||
// Direct wrappers for the libperfstat functionality. All they do is
|
||||
// to call the functions with the same name via function pointers.
|
||||
static int perfstat_cpu_total(perfstat_id_t *name, perfstat_cpu_total_t* userbuff,
|
||||
// Get all available data also on newer AIX versions (PERFSTAT_CPU_TOTAL_T_LATEST).
|
||||
static int perfstat_cpu_total(perfstat_id_t *name, PERFSTAT_CPU_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
static int perfstat_memory_total(perfstat_id_t *name, perfstat_memory_total_t* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
static int perfstat_partition_total(perfstat_id_t *name, PERFSTAT_PARTITON_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
static void perfstat_reset();
|
||||
|
||||
static int perfstat_wpar_total(perfstat_id_wpar_t *name, PERFSTAT_WPAR_TOTAL_T_LATEST* userbuff,
|
||||
int sizeof_userbuff, int desired_number);
|
||||
|
||||
static cid_t wpar_getcid();
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// The convenience functions get_partitioninfo(), get_cpuinfo(), get_wparinfo() return
|
||||
// information about partition, cpu and wpars, respectivly. They can be used without
|
||||
// regard for which OS release we are on. On older AIX release, some output structure
|
||||
// members will be 0.
|
||||
|
||||
// Result struct for get_partitioninfo().
|
||||
struct partitioninfo_t {
|
||||
// partition type info
|
||||
unsigned smt_capable :1; /* OS supports SMT mode */
|
||||
unsigned smt_enabled :1; /* SMT mode is on */
|
||||
unsigned lpar_capable :1; /* OS supports logical partitioning */
|
||||
unsigned lpar_enabled :1; /* logical partitioning is on */
|
||||
unsigned shared_capable :1; /* OS supports shared processor LPAR */
|
||||
unsigned shared_enabled :1; /* partition runs in shared mode */
|
||||
unsigned dlpar_capable :1; /* OS supports dynamic LPAR */
|
||||
unsigned capped :1; /* partition is capped */
|
||||
unsigned kernel_is_64 :1; /* kernel is 64 bit */
|
||||
unsigned pool_util_authority :1; /* pool utilization available */
|
||||
unsigned donate_capable :1; /* capable of donating cycles */
|
||||
unsigned donate_enabled :1; /* enabled for donating cycles */
|
||||
unsigned ams_capable:1; /* 1 = AMS(Active Memory Sharing) capable, 0 = Not AMS capable */
|
||||
unsigned ams_enabled:1; /* 1 = AMS(Active Memory Sharing) enabled, 0 = Not AMS enabled */
|
||||
unsigned power_save:1; /* 1 = Power saving mode is enabled */
|
||||
unsigned ame_enabled:1; /* Active Memory Expansion is enabled */
|
||||
// partition total info
|
||||
int online_cpus; /* number of virtual CPUs currently online on the partition */
|
||||
int entitled_proc_capacity; /* number of processor units this partition is entitled to receive */
|
||||
int var_proc_capacity_weight; /* partition priority weight to receive extra capacity */
|
||||
int phys_cpus_pool; /* number of the physical CPUs currently in the shared processor pool this partition belong to */
|
||||
int pool_id; /* identifier of the shared pool of physical processors this partition is a member of */
|
||||
u_longlong_t entitled_pool_capacity; /* Entitled processor capacity of partitions pool */
|
||||
char name[IDENTIFIER_LENGTH]; /* name of the logical partition */
|
||||
|
||||
u_longlong_t timebase_last; /* most recently cpu time base (an incremented long int on PowerPC) */
|
||||
u_longlong_t pool_idle_time; /* pool idle time = number of clock tics a processor in the shared pool was idle */
|
||||
u_longlong_t pcpu_tics_user; /* raw number of physical processor tics in user mode */
|
||||
u_longlong_t pcpu_tics_sys; /* raw number of physical processor tics in system mode */
|
||||
u_longlong_t pcpu_tics_idle; /* raw number of physical processor tics idle */
|
||||
u_longlong_t pcpu_tics_wait; /* raw number of physical processor tics waiting for I/O */
|
||||
|
||||
u_longlong_t true_memory; /* True Memory Size in 4KB pages */
|
||||
u_longlong_t expanded_memory; /* Expanded Memory Size in 4KB pages */
|
||||
u_longlong_t target_memexp_factr; /* Target Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t current_memexp_factr; /* Current Memory Expansion Factor scaled by 100 */
|
||||
u_longlong_t cmcs_total_time; /* Total CPU time spent due to active memory expansion */
|
||||
};
|
||||
|
||||
// Result struct for get_cpuinfo().
|
||||
struct cpuinfo_t {
|
||||
char description[IDENTIFIER_LENGTH]; // processor description (type/official name)
|
||||
u_longlong_t processorHZ; // processor speed in Hz
|
||||
int ncpus; // number of active logical processors
|
||||
double loadavg[3]; // (1<<SBITS) times the average number of runnables processes during the last 1, 5 and 15 minutes.
|
||||
// To calculate the load average, divide the numbers by (1<<SBITS). SBITS is defined in <sys/proc.h>.
|
||||
char version[20]; // processor version from _system_configuration (sys/systemcfg.h)
|
||||
unsigned long long user_clock_ticks; // raw total number of clock ticks spent in user mode
|
||||
unsigned long long sys_clock_ticks; // raw total number of clock ticks spent in system mode
|
||||
unsigned long long idle_clock_ticks; // raw total number of clock ticks spent idle
|
||||
unsigned long long wait_clock_ticks; // raw total number of clock ticks spent waiting for I/O
|
||||
};
|
||||
|
||||
// Result struct for get_wparinfo().
|
||||
struct wparinfo_t {
|
||||
char name[MAXCORRALNAMELEN+1]; /* name of the Workload Partition */
|
||||
unsigned short wpar_id; /* workload partition identifier */
|
||||
unsigned app_wpar :1; /* Application WPAR */
|
||||
unsigned cpu_rset :1; /* WPAR restricted to CPU resource set */
|
||||
unsigned cpu_xrset:1; /* WPAR restricted to CPU Exclusive resource set */
|
||||
unsigned cpu_limits :1; /* CPU resource limits enforced */
|
||||
unsigned mem_limits :1; /* Memory resource limits enforced */
|
||||
int cpu_limit; /* CPU limit in 100ths of % - 1..10000 */
|
||||
int mem_limit; /* Memory limit in 100ths of % - 1..10000 */
|
||||
};
|
||||
|
||||
static bool get_partitioninfo(partitioninfo_t* ppi);
|
||||
static bool get_cpuinfo(cpuinfo_t* pci);
|
||||
static bool get_wparinfo(wparinfo_t* pwi);
|
||||
|
||||
};
|
||||
|
||||
#endif // OS_AIX_VM_LIBPERFSTAT_AIX_HPP
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user