Skip to content

Commit

Permalink
8250627: Use -XX:+/-UseContainerSupport for enabling/disabling Java c…
Browse files Browse the repository at this point in the history
…ontainer metrics

Reviewed-by: aph, dholmes, bobv, shade
  • Loading branch information
jerboaa committed Jul 24, 2020
1 parent 7127455 commit 517abaa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions hotspot/make/linux/makefiles/mapfile-vers-debug
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ SUNWprivate_1.1 {
JVM_IsSilentCompiler;
JVM_IsSupportedJNIVersion;
JVM_IsThreadAlive;
JVM_IsUseContainerSupport;
JVM_IsVMGeneratedMethodIx;
JVM_LatestUserDefinedLoader;
JVM_Listen;
Expand Down
1 change: 1 addition & 0 deletions hotspot/make/linux/makefiles/mapfile-vers-product
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ SUNWprivate_1.1 {
JVM_IsInterface;
JVM_IsInterrupted;
JVM_IsNaN;
JVM_IsUseContainerSupport;
JVM_IsPrimitiveClass;
JVM_IsSameClassPackage;
JVM_IsSilentCompiler;
Expand Down
11 changes: 11 additions & 0 deletions hotspot/src/share/vm/prims/jvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,17 @@ JVM_ENTRY_NO_ENV(jint, JVM_ActiveProcessorCount(void))
JVM_END


JVM_ENTRY_NO_ENV(jboolean, JVM_IsUseContainerSupport(void))
JVMWrapper("JVM_IsUseContainerSupport");
#ifdef TARGET_OS_FAMILY_linux
if (UseContainerSupport) {
return JNI_TRUE;
}
#endif
return JNI_FALSE;
JVM_END



// java.lang.Throwable //////////////////////////////////////////////////////

Expand Down
3 changes: 3 additions & 0 deletions hotspot/src/share/vm/prims/jvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ JVM_MaxMemory(void);
JNIEXPORT jint JNICALL
JVM_ActiveProcessorCount(void);

JNIEXPORT jboolean JNICALL
JVM_IsUseContainerSupport(void);

JNIEXPORT void * JNICALL
JVM_LoadLibrary(const char *name);

Expand Down

0 comments on commit 517abaa

Please sign in to comment.