From d0426d7d41dca8757e04cddbfaae1d6fc4c97a45 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 10 Mar 2016 14:20:59 -0500 Subject: [PATCH 01/15] 8150778: Reduce Throwable.getStackTrace() calls to the JVM Replace JVM_GetStackTraceDepth and JVM_GetStackTraceElement, with JVM_GetStackTraceElements that gets all the elements in the StackTraceElement[] Reviewed-by: dfuchs, mchung, shade, hseigel --- jdk/make/mapfiles/libjava/mapfile-vers | 3 +- jdk/make/mapfiles/libjava/reorder-sparc | 3 +- jdk/make/mapfiles/libjava/reorder-sparcv9 | 3 +- jdk/make/mapfiles/libjava/reorder-x86 | 3 +- .../classes/java/lang/StackTraceElement.java | 8 ++++- .../share/classes/java/lang/Throwable.java | 36 ++++++++----------- jdk/src/java.base/share/native/include/jvm.h | 9 ++--- .../share/native/libjava/Throwable.c | 16 +++------ 8 files changed, 34 insertions(+), 47 deletions(-) diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers index ac21dd24890..852716aac1f 100644 --- a/jdk/make/mapfiles/libjava/mapfile-vers +++ b/jdk/make/mapfiles/libjava/mapfile-vers @@ -227,8 +227,7 @@ SUNWprivate_1.1 { Java_java_lang_System_setOut0; Java_java_lang_Thread_registerNatives; Java_java_lang_Throwable_fillInStackTrace; - Java_java_lang_Throwable_getStackTraceDepth; - Java_java_lang_Throwable_getStackTraceElement; + Java_java_lang_Throwable_getStackTraceElements; Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2; Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2; Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2; diff --git a/jdk/make/mapfiles/libjava/reorder-sparc b/jdk/make/mapfiles/libjava/reorder-sparc index db653652f4f..6544e40393c 100644 --- a/jdk/make/mapfiles/libjava/reorder-sparc +++ b/jdk/make/mapfiles/libjava/reorder-sparc @@ -78,8 +78,7 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; text: .text%Java_java_lang_reflect_Array_newArray; -text: .text%Java_java_lang_Throwable_getStackTraceDepth; -text: .text%Java_java_lang_Throwable_getStackTraceElement; +text: .text%Java_java_lang_Throwable_getStackTraceElements; text: .text%throwFileNotFoundException; text: .text%JNU_NotifyAll; # Test LoadFrame diff --git a/jdk/make/mapfiles/libjava/reorder-sparcv9 b/jdk/make/mapfiles/libjava/reorder-sparcv9 index d6e3a326b35..71e44cf938c 100644 --- a/jdk/make/mapfiles/libjava/reorder-sparcv9 +++ b/jdk/make/mapfiles/libjava/reorder-sparcv9 @@ -74,8 +74,7 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri text: .text%JNU_GetEnv; text: .text%Java_java_io_UnixFileSystem_checkAccess; text: .text%Java_java_lang_reflect_Array_newArray; -text: .text%Java_java_lang_Throwable_getStackTraceDepth; -text: .text%Java_java_lang_Throwable_getStackTraceElement; +text: .text%Java_java_lang_Throwable_getStackTraceElements; text: .text%throwFileNotFoundException: OUTPUTDIR/io_util.o; text: .text%JNU_NotifyAll; # Test LoadFrame diff --git a/jdk/make/mapfiles/libjava/reorder-x86 b/jdk/make/mapfiles/libjava/reorder-x86 index 0728f662c03..5031cd133af 100644 --- a/jdk/make/mapfiles/libjava/reorder-x86 +++ b/jdk/make/mapfiles/libjava/reorder-x86 @@ -78,8 +78,7 @@ text: .text%Java_java_io_UnixFileSystem_checkAccess; text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0; text: .text%Java_java_io_FileInputStream_available; text: .text%Java_java_lang_reflect_Array_newArray; -text: .text%Java_java_lang_Throwable_getStackTraceDepth; -text: .text%Java_java_lang_Throwable_getStackTraceElement; +text: .text%Java_java_lang_Throwable_getStackTraceElements; text: .text%Java_java_lang_System_identityHashCode; text: .text%JNU_NotifyAll; # Test LoadFrame diff --git a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java index 58738d83c8c..fa9758f3f22 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java +++ b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -74,6 +74,12 @@ public final class StackTraceElement implements java.io.Serializable { this.lineNumber = lineNumber; } + + /** + * Creates an empty stack frame element to be filled in by Throwable. + */ + StackTraceElement() { } + /** * Returns the name of the source file containing the execution point * represented by this stack trace element. Generally, this corresponds diff --git a/jdk/src/java.base/share/classes/java/lang/Throwable.java b/jdk/src/java.base/share/classes/java/lang/Throwable.java index 9d5f547c2a5..72a3455e637 100644 --- a/jdk/src/java.base/share/classes/java/lang/Throwable.java +++ b/jdk/src/java.base/share/classes/java/lang/Throwable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2016, 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 @@ -118,7 +118,7 @@ public class Throwable implements Serializable { private static final long serialVersionUID = -3042686055658047285L; /** - * Native code saves some indication of the stack backtrace in this slot. + * The JVM saves some indication of the stack backtrace in this slot. */ private transient Object backtrace; @@ -211,6 +211,11 @@ public class Throwable implements Serializable { */ private StackTraceElement[] stackTrace = UNASSIGNED_STACK; + /** + * The JVM code sets the depth of the backtrace for later retrieval + */ + private transient int depth; + // Setting this static field introduces an acceptable // initialization dependency on a few java.util classes. private static final List SUPPRESSED_SENTINEL = Collections.emptyList(); @@ -828,10 +833,11 @@ public class Throwable implements Serializable { if (backtrace instanceof StackStreamFactory.StackTrace) { stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements(); } else { - int depth = getStackTraceDepth(); stackTrace = new StackTraceElement[depth]; - for (int i = 0; i < depth; i++) - stackTrace[i] = getStackTraceElement(i); + for (int i = 0; i < depth; i++) { + stackTrace[i] = new StackTraceElement(); + } + getStackTraceElements(stackTrace); } } else if (stackTrace == null) { return UNASSIGNED_STACK; @@ -884,23 +890,11 @@ public class Throwable implements Serializable { } /** - * Returns the number of elements in the stack trace (or 0 if the stack - * trace is unavailable). - * - * package-protection for use by SharedSecrets. + * Gets the stack trace elements. + * @param elements + * @throws IndexOutOfBoundsException if {@code elements.length != depth } */ - native int getStackTraceDepth(); - - /** - * Returns the specified element of the stack trace. - * - * package-protection for use by SharedSecrets. - * - * @param index index of the element to return. - * @throws IndexOutOfBoundsException if {@code index < 0 || - * index >= getStackTraceDepth() } - */ - native StackTraceElement getStackTraceElement(int index); + private native void getStackTraceElements(StackTraceElement[] elements); /** * Reads a {@code Throwable} from a stream, enforcing diff --git a/jdk/src/java.base/share/native/include/jvm.h b/jdk/src/java.base/share/native/include/jvm.h index 99f7c7f8be4..968296604fb 100644 --- a/jdk/src/java.base/share/native/include/jvm.h +++ b/jdk/src/java.base/share/native/include/jvm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -171,11 +171,8 @@ JVM_IsSupportedJNIVersion(jint version); JNIEXPORT void JNICALL JVM_FillInStackTrace(JNIEnv *env, jobject throwable); -JNIEXPORT jint JNICALL -JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable); - -JNIEXPORT jobject JNICALL -JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index); +JNIEXPORT void JNICALL +JVM_GetStackTraceElements(JNIEnv *env, jobject throwable, jobjectArray elements); /* * java.lang.StackWalker diff --git a/jdk/src/java.base/share/native/libjava/Throwable.c b/jdk/src/java.base/share/native/libjava/Throwable.c index 768c7e114a4..9944d48af19 100644 --- a/jdk/src/java.base/share/native/libjava/Throwable.c +++ b/jdk/src/java.base/share/native/libjava/Throwable.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2016, 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 @@ -50,15 +50,9 @@ Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint d return throwable; } -JNIEXPORT jint JNICALL -Java_java_lang_Throwable_getStackTraceDepth(JNIEnv *env, jobject throwable) +JNIEXPORT void JNICALL +Java_java_lang_Throwable_getStackTraceElements(JNIEnv *env, + jobject throwable, jobjectArray elements) { - return JVM_GetStackTraceDepth(env, throwable); -} - -JNIEXPORT jobject JNICALL -Java_java_lang_Throwable_getStackTraceElement(JNIEnv *env, - jobject throwable, jint index) -{ - return JVM_GetStackTraceElement(env, throwable, index); + JVM_GetStackTraceElements(env, throwable, elements); } From ec2bb17be5155709168ee8fddc7397be25020d99 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Fri, 4 Mar 2016 18:13:04 +0900 Subject: [PATCH 02/15] 8151181: Add JSnap to jhsdb Reviewed-by: dsamersoff --- jdk/test/sun/tools/jhsdb/BasicLauncherTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java index 37dd7ec0131..afba30c6055 100644 --- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java +++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java @@ -143,6 +143,7 @@ public class BasicLauncherTest { launch("No deadlocks found", "jstack"); launch("compiler detected", "jmap"); launch("Java System Properties", "jinfo"); + launch("java.threads", "jsnap"); // The test throws RuntimeException on error. // IOException is thrown if LingeredApp can't start because of some bad From 570f4df3f1be0f6438a0b207c08f54109013c00e Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Tue, 15 Mar 2016 12:27:26 +0900 Subject: [PATCH 03/15] 8151709: jhsdb should show help message in SALauncher Reviewed-by: dsamersoff --- jdk/test/sun/tools/jhsdb/SAGetoptTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/test/sun/tools/jhsdb/SAGetoptTest.java b/jdk/test/sun/tools/jhsdb/SAGetoptTest.java index 60ff9fffc68..736b839e071 100644 --- a/jdk/test/sun/tools/jhsdb/SAGetoptTest.java +++ b/jdk/test/sun/tools/jhsdb/SAGetoptTest.java @@ -152,5 +152,8 @@ public class SAGetoptTest { String[] optionSet6 = {"--exe", "--core", "bla_core"}; badOptionsTest(6, optionSet6, "Argument is expected for 'exe'"); + + String[] optionSet7 = {"--exe"}; + badOptionsTest(7, optionSet7, "Argument is expected for 'exe'"); } } From d6328fbb3ed3b8352b0adaab5f1fe077d2cf2f32 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Thu, 17 Mar 2016 10:26:59 +0100 Subject: [PATCH 04/15] 8152074: Avoid lambda usage in StringConcatFactory initializer Reviewed-by: shade, forax, chegar --- .../java/lang/invoke/StringConcatFactory.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java index 5fb5277e798..853db2cbf73 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -34,11 +34,11 @@ import jdk.internal.misc.Unsafe; import java.lang.invoke.MethodHandles.Lookup; import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; +import sun.security.action.GetPropertyAction; import static jdk.internal.org.objectweb.asm.Opcodes.*; @@ -188,20 +188,14 @@ public final class StringConcatFactory { private static final ProxyClassesDumper DUMPER; static { - // Poke the privileged block once, taking everything we need: - final Object[] values = new Object[4]; - AccessController.doPrivileged((PrivilegedAction) () -> { - values[0] = System.getProperty("java.lang.invoke.stringConcat"); - values[1] = Boolean.getBoolean("java.lang.invoke.stringConcat.cache"); - values[2] = Boolean.getBoolean("java.lang.invoke.stringConcat.debug"); - values[3] = System.getProperty("java.lang.invoke.stringConcat.dumpClasses"); - return null; - }); - - final String strategy = (String) values[0]; - CACHE_ENABLE = (Boolean) values[1]; - DEBUG = (Boolean) values[2]; - final String dumpPath = (String) values[3]; + final String strategy = AccessController.doPrivileged( + new GetPropertyAction("java.lang.invoke.stringConcat")); + CACHE_ENABLE = Boolean.parseBoolean(AccessController.doPrivileged( + new GetPropertyAction("java.lang.invoke.stringConcat.cache"))); + DEBUG = Boolean.parseBoolean(AccessController.doPrivileged( + new GetPropertyAction("java.lang.invoke.stringConcat.debug"))); + final String dumpPath = AccessController.doPrivileged( + new GetPropertyAction("java.lang.invoke.stringConcat.dumpClasses")); STRATEGY = (strategy == null) ? DEFAULT_STRATEGY : Strategy.valueOf(strategy); CACHE = CACHE_ENABLE ? new ConcurrentHashMap<>() : null; From 4e7c41b940efcb757f1884b26c1bf01868c97d2f Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Mon, 21 Mar 2016 11:24:09 +0100 Subject: [PATCH 05/15] 4858370: JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command Delete global references in invoker_completeInvokeRequest() Reviewed-by: sspitsyn --- .../share/native/libjdwp/invoker.c | 48 +++ jdk/test/com/sun/jdi/OomDebugTest.java | 312 ++++++++++++++++++ 2 files changed, 360 insertions(+) create mode 100644 jdk/test/com/sun/jdi/OomDebugTest.java diff --git a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c index cd1cd2f7dc0..680a747ba0c 100644 --- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c +++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c @@ -211,6 +211,47 @@ createGlobalRefs(JNIEnv *env, InvokeRequest *request) return error; } +/* + * Delete global references from the request which got put there before a + * invoke request was carried out. See fillInvokeRequest() and invoker invoke*() + * impls. + */ +static void +deleteGlobalRefs(JNIEnv *env, InvokeRequest *request) +{ + void *cursor; + jint argIndex = 0; + jvalue *argument = request->arguments; + jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); + + if (request->clazz != NULL) { + tossGlobalRef(env, &(request->clazz)); + } + if (request->instance != NULL) { + tossGlobalRef(env, &(request->instance)); + } + /* Delete global argument references */ + while (argIndex < request->argumentCount) { + if ((argumentTag == JDWP_TAG(OBJECT)) || + (argumentTag == JDWP_TAG(ARRAY))) { + if (argument->l != NULL) { + tossGlobalRef(env, &(argument->l)); + } + } + argument++; + argIndex++; + argumentTag = nextArgumentTypeTag(&cursor); + } + /* Delete potentially saved return values */ + if ((request->invokeType == INVOKE_CONSTRUCTOR) || + (returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT)) || + (returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY))) { + if (request->returnValue.l != NULL) { + tossGlobalRef(env, &(request->returnValue.l)); + } + } +} + static jvmtiError fillInvokeRequest(JNIEnv *env, InvokeRequest *request, jbyte invokeType, jbyte options, jint id, @@ -736,6 +777,13 @@ invoker_completeInvokeRequest(jthread thread) (void)outStream_writeObjectRef(env, &out, exc); outStream_sendReply(&out); } + + /* + * At this time, there's no need to retain global references on + * arguments since the reply is processed. No one will deal with + * this request ID anymore, so we must call deleteGlobalRefs(). + */ + deleteGlobalRefs(env, request); } jboolean diff --git a/jdk/test/com/sun/jdi/OomDebugTest.java b/jdk/test/com/sun/jdi/OomDebugTest.java new file mode 100644 index 00000000000..eadb2aaa342 --- /dev/null +++ b/jdk/test/com/sun/jdi/OomDebugTest.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2016 Red Hat Inc. + * + * 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. + */ + +/** + * @test + * @bug 4858370 + * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). + * + * @author Severin Gehwolf + * + * @library .. + * @run build TestScaffold VMConnection TargetListener TargetAdapter + * @run compile -g OomDebugTest.java + * @run main OomDebugTest OomDebugTestTarget test1 + * @run main OomDebugTest OomDebugTestTarget test2 + * @run main OomDebugTest OomDebugTestTarget test3 + * @run main OomDebugTest OomDebugTestTarget test4 + * @run main OomDebugTest OomDebugTestTarget test5 + */ +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.ArrayType; +import com.sun.jdi.ClassType; +import com.sun.jdi.Field; +import com.sun.jdi.InvocationException; +import com.sun.jdi.Method; +import com.sun.jdi.ObjectReference; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.StackFrame; +import com.sun.jdi.VMOutOfMemoryException; +import com.sun.jdi.Value; +import com.sun.jdi.event.BreakpointEvent; + +/***************** Target program **********************/ + +class OomDebugTestTarget { + + OomDebugTestTarget() { + System.out.println("DEBUG: invoked constructor"); + } + static class FooCls { + @SuppressWarnings("unused") + private byte[] bytes = new byte[3000000]; + }; + + FooCls fooCls = new FooCls(); + byte[] byteArray = new byte[0]; + + void testMethod(FooCls foo) { + System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); + } + + void testPrimitive(byte[] foo) { + System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); + } + + byte[] testPrimitiveArrRetval() { + System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); + return new byte[3000000]; + } + + FooCls testFooClsRetval() { + System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); + return new FooCls(); + } + + public void entry() {} + + public static void main(String[] args){ + System.out.println("DEBUG: OomDebugTestTarget.main"); + new OomDebugTestTarget().entry(); + } +} + +/***************** Test program ************************/ + +public class OomDebugTest extends TestScaffold { + + private static final int TOTAL_TESTS = 1; + private ReferenceType targetClass; + private ObjectReference thisObject; + private int failedTests; + private final String testMethodName; + + public OomDebugTest(String[] args) { + super(args); + if (args.length != 2) { + throw new RuntimeException("Test failed unexpectedly."); + } + testMethodName = args[1]; + } + + @Override + protected void runTests() throws Exception { + try { + /* + * Get to the top of entry() + * to determine targetClass and mainThread + */ + BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); + targetClass = bpe.location().declaringType(); + + mainThread = bpe.thread(); + + StackFrame frame = mainThread.frame(0); + thisObject = frame.thisObject(); + java.lang.reflect.Method m = findTestMethod(); + m.invoke(this); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + failure(); + } catch (SecurityException e) { + e.printStackTrace(); + failure(); + } + } + + private java.lang.reflect.Method findTestMethod() + throws NoSuchMethodException, SecurityException { + return OomDebugTest.class.getDeclaredMethod(testMethodName); + } + + private void failure() { + failedTests++; + } + + /* + * Test case: Object reference as method parameter. + */ + @SuppressWarnings("unused") // called via reflection + private void test1() throws Exception { + System.out.println("DEBUG: ------------> Running " + testMethodName); + try { + Field field = targetClass.fieldByName("fooCls"); + ClassType clsType = (ClassType)field.type(); + Method constructor = getConstructorForClass(clsType); + for (int i = 0; i < 15; i++) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + ObjectReference objRef = clsType.newInstance(mainThread, + constructor, + new ArrayList(0), + ObjectReference.INVOKE_NONVIRTUAL); + invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); + } + } catch (InvocationException e) { + handleFailure(e); + } + } + + /* + * Test case: Array reference as method parameter. + */ + @SuppressWarnings("unused") // called via reflection + private void test2() throws Exception { + System.out.println("DEBUG: ------------> Running " + testMethodName); + try { + Field field = targetClass.fieldByName("byteArray"); + ArrayType arrType = (ArrayType)field.type(); + + for (int i = 0; i < 15; i++) { + ArrayReference byteArrayVal = arrType.newInstance(3000000); + invoke("testPrimitive", "([B)V", byteArrayVal); + } + } catch (VMOutOfMemoryException e) { + defaultHandleOOMFailure(e); + } + } + + /* + * Test case: Array reference as return value. + */ + @SuppressWarnings("unused") // called via reflection + private void test3() throws Exception { + System.out.println("DEBUG: ------------> Running " + testMethodName); + try { + for (int i = 0; i < 15; i++) { + invoke("testPrimitiveArrRetval", + "()[B", + Collections.EMPTY_LIST, + vm().mirrorOfVoid()); + } + } catch (InvocationException e) { + handleFailure(e); + } + } + + /* + * Test case: Object reference as return value. + */ + @SuppressWarnings("unused") // called via reflection + private void test4() throws Exception { + System.out.println("DEBUG: ------------> Running " + testMethodName); + try { + for (int i = 0; i < 15; i++) { + invoke("testFooClsRetval", + "()LOomDebugTestTarget$FooCls;", + Collections.EMPTY_LIST, + vm().mirrorOfVoid()); + } + } catch (InvocationException e) { + handleFailure(e); + } + } + + /* + * Test case: Constructor + */ + @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection + private void test5() throws Exception { + System.out.println("DEBUG: ------------> Running " + testMethodName); + try { + ClassType type = (ClassType)thisObject.type(); + for (int i = 0; i < 15; i++) { + type.newInstance(mainThread, + findMethod(targetClass, "", "()V"), + new ArrayList(0), + ObjectReference.INVOKE_NONVIRTUAL); + } + } catch (InvocationException e) { + handleFailure(e); + } + } + + private Method getConstructorForClass(ClassType clsType) { + List methods = clsType.methodsByName(""); + if (methods.size() != 1) { + throw new RuntimeException("FAIL. Expected only one, the default, constructor"); + } + return methods.get(0); + } + + private void handleFailure(InvocationException e) { + // There is no good way to see the OOME diagnostic message in the target since the + // TestScaffold might throw an exception while trying to print the stack trace. I.e + // it might get a a VMDisconnectedException before the stack trace printing finishes. + System.err.println("FAILURE: InvocationException caused by OOM"); + defaultHandleOOMFailure(e); + } + + private void defaultHandleOOMFailure(Exception e) { + e.printStackTrace(); + failure(); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + void invoke(String methodName, String methodSig, Value value) + throws Exception { + List args = new ArrayList(1); + args.add(value); + invoke(methodName, methodSig, args, value); + } + + void invoke(String methodName, + String methodSig, + @SuppressWarnings("rawtypes") List args, + Value value) throws Exception { + Method method = findMethod(targetClass, methodName, methodSig); + if ( method == null) { + failure("FAILED: Can't find method: " + + methodName + " for class = " + targetClass); + return; + } + invoke(method, args, value); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + void invoke(Method method, List args, Value value) throws Exception { + thisObject.invokeMethod(mainThread, method, args, 0); + System.out.println("DEBUG: Done invoking method via debugger."); + } + + Value fieldValue(String fieldName) { + Field field = targetClass.fieldByName(fieldName); + return thisObject.getValue(field); + } + + public static void main(String[] args) throws Exception { + System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option + OomDebugTest oomTest = new OomDebugTest(args); + oomTest.startTests(); + if (oomTest.failedTests > 0) { + throw new RuntimeException(oomTest.failedTests + + " of " + TOTAL_TESTS + " test(s) failed."); + } + System.out.println("All " + TOTAL_TESTS + " tests passed."); + } + +} From 7eef4922454a70540b73d1d2e1f62b1a7ae84ae1 Mon Sep 17 00:00:00 2001 From: Harsha Wardhana B Date: Mon, 21 Mar 2016 20:39:54 -0700 Subject: [PATCH 06/15] 8031753: JMXServiceURL should not use getLocalHost or its usage should be enhanced JMXServiceURL should not use getLocalHost or its usage should be enhanced Reviewed-by: jbachorik --- .../management/remote/JMXServiceURL.java | 109 +++++++++++++----- 1 file changed, 81 insertions(+), 28 deletions(-) diff --git a/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java b/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java index bdac521bec3..c951a1aa812 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java @@ -34,10 +34,15 @@ import java.io.InvalidObjectException; import java.io.ObjectInputStream; import java.io.Serializable; +import java.net.Inet4Address; +import java.net.Inet6Address; import java.net.InetAddress; import java.net.MalformedURLException; +import java.net.NetworkInterface; +import java.net.SocketException; import java.net.UnknownHostException; import java.util.BitSet; +import java.util.Enumeration; import java.util.Locale; import java.util.StringTokenizer; @@ -236,10 +241,13 @@ public class JMXServiceURL implements Serializable { * @param protocol the protocol part of the URL. If null, defaults * to jmxmp. * - * @param host the host part of the URL. If null, defaults to the - * local host name, as determined by - * InetAddress.getLocalHost().getHostName(). If it - * is a numeric IPv6 address, it can optionally be enclosed in + * @param host the host part of the URL. If host is null and if + * local host name can be resolved to an IP, then host defaults + * to local host name as determined by + * InetAddress.getLocalHost().getHostName(). If host is null + * and if local host name cannot be resolved to an IP, then host + * defaults to numeric IP address of one of the active network interfaces. + * If host is a numeric IPv6 address, it can optionally be enclosed in * square brackets []. * * @param port the port part of the URL. @@ -260,10 +268,13 @@ public class JMXServiceURL implements Serializable { * @param protocol the protocol part of the URL. If null, defaults * to jmxmp. * - * @param host the host part of the URL. If null, defaults to the - * local host name, as determined by - * InetAddress.getLocalHost().getHostName(). If it - * is a numeric IPv6 address, it can optionally be enclosed in + * @param host the host part of the URL. If host is null and if + * local host name can be resolved to an IP, then host defaults + * to local host name as determined by + * InetAddress.getLocalHost().getHostName(). If host is null + * and if local host name cannot be resolved to an IP, then host + * defaults to numeric IP address of one of the active network interfaces. + * If host is a numeric IPv6 address, it can optionally be enclosed in * square brackets []. * * @param port the port part of the URL. @@ -286,32 +297,45 @@ public class JMXServiceURL implements Serializable { InetAddress local; try { local = InetAddress.getLocalHost(); - } catch (UnknownHostException e) { - throw new MalformedURLException("Local host name unknown: " + - e); - } + host = local.getHostName(); - host = local.getHostName(); - - /* We might have a hostname that violates DNS naming - rules, for example that contains an `_'. While we - could be strict and throw an exception, this is rather - user-hostile. Instead we use its numerical IP address. - We can only reasonably do this for the host==null case. - If we're given an explicit host name that is illegal we - have to reject it. (Bug 5057532.) */ - try { - validateHost(host, port); - } catch (MalformedURLException e) { - if (logger.fineOn()) { + /* We might have a hostname that violates DNS naming + rules, for example that contains an `_'. While we + could be strict and throw an exception, this is rather + user-hostile. Instead we use its numerical IP address. + We can only reasonably do this for the host==null case. + If we're given an explicit host name that is illegal we + have to reject it. (Bug 5057532.) */ + try { + validateHost(host, port); + } catch (MalformedURLException e) { + if (logger.fineOn()) { logger.fine("JMXServiceURL", "Replacing illegal local host name " + host + " with numeric IP address " + "(see RFC 1034)", e); } host = local.getHostAddress(); - /* Use the numeric address, which could be either IPv4 - or IPv6. validateHost will accept either. */ + } + } catch (UnknownHostException e) { + try { + /* + If hostname cannot be resolved, we will try and use numeric + IPv4/IPv6 address. If host=null while starting agent, + we know that it will be started on all interfaces - 0.0.0.0. + Hence we will use IP address of first active non-loopback + interface + */ + host = getActiveNetworkInterfaceIP(); + if (host == null) { + throw new MalformedURLException("Unable" + + " to resolve hostname or " + + "get valid IP address"); + } + } catch (SocketException ex) { + throw new MalformedURLException("Unable" + + " to resolve hostname or get valid IP address"); + } } } @@ -340,6 +364,33 @@ public class JMXServiceURL implements Serializable { validate(); } + private String getActiveNetworkInterfaceIP() throws SocketException { + Enumeration + networkInterface = NetworkInterface.getNetworkInterfaces(); + String ipv6AddrStr = null; + while (networkInterface.hasMoreElements()) { + NetworkInterface nic = networkInterface.nextElement(); + if (nic.isUp() && !nic.isLoopback()) { + Enumeration inet = nic.getInetAddresses(); + while (inet.hasMoreElements()) { + InetAddress addr = inet.nextElement(); + if (addr instanceof Inet4Address + && !addr.isLinkLocalAddress()) { + return addr.getHostAddress(); + }else if (addr instanceof Inet6Address + && !addr.isLinkLocalAddress()) { + /* + We save last seen IPv6 address which we will return + if we do not find any interface with IPv4 address. + */ + ipv6AddrStr = addr.getHostAddress(); + } + } + } + } + return ipv6AddrStr; + } + private static final String INVALID_INSTANCE_MSG = "Trying to deserialize an invalid instance of JMXServiceURL"; private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException { @@ -540,7 +591,9 @@ public class JMXServiceURL implements Serializable { * constructor that takes a separate host parameter, the result is * the string that was specified. If that string was null, the * result is - * InetAddress.getLocalHost().getHostName().

+ * InetAddress.getLocalHost().getHostName() if local host name + * can be resolved to an IP. Else numeric IP address of an active + * network interface will be used.

* *

In either case, if the host was specified using the * [...] syntax for numeric IPv6 addresses, the From c33a6aa5ee59d3e57d627ee2de84908540a81a32 Mon Sep 17 00:00:00 2001 From: Harsha Wardhana B Date: Tue, 22 Mar 2016 01:13:06 -0700 Subject: [PATCH 07/15] 8151797: java/lang/management/ThreadMXBean/ThreadLists.java : inconsistent results Create ThreadMXBean at the beginning of test so that call-site cleaner thread will be started Reviewed-by: sla --- jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java index c596f7b9e9f..93bde6ff2d2 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java @@ -35,6 +35,11 @@ import java.util.Map; public class ThreadLists { public static void main(String args[]) { + // Bug id : JDK-8151797 + // Use a lambda expression so that call-site cleaner thread is started + Runnable printLambda = () -> {System.out.println("Starting Test");}; + printLambda.run(); + // get top-level thread group ThreadGroup top = Thread.currentThread().getThreadGroup(); ThreadGroup parent; From c5f2279354bc155b5d476ea9f6e44d24c63dcfd3 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Tue, 22 Mar 2016 19:29:25 +0100 Subject: [PATCH 08/15] 8151887: com/sun/jdi/RedefineClearBreakpoint.sh failed with timeout Take timeout factor into account Reviewed-by: dsamersoff --- jdk/test/com/sun/jdi/ShellScaffold.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/test/com/sun/jdi/ShellScaffold.sh b/jdk/test/com/sun/jdi/ShellScaffold.sh index b978ec1a504..ed5f79e58ac 100644 --- a/jdk/test/com/sun/jdi/ShellScaffold.sh +++ b/jdk/test/com/sun/jdi/ShellScaffold.sh @@ -131,6 +131,9 @@ killcmd=kill # This can be increased if timing seems to be an issue. sleep_seconds=1 +if [ -n "$TIMEOUT_FACTOR" ] ; then + sleep_seconds=$(echo $TIMEOUT_FACTOR $sleep_seconds | awk '{printf "%d\n", int($1 * $2)}') +fi echo "ShellScaffold.sh: Version" >& 2 topPid=$$ From 304d3c93fdc512eadfddd35da3070fcfd9419064 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Tue, 22 Mar 2016 19:29:27 +0100 Subject: [PATCH 09/15] 7153107: com/sun/jdi/InterruptHangTest.java fails in nightlies Increased timeouts and added timestamped logging Reviewed-by: sspitsyn --- jdk/test/com/sun/jdi/InterruptHangTest.java | 11 +++++++---- jdk/test/com/sun/jdi/TestScaffold.java | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/jdk/test/com/sun/jdi/InterruptHangTest.java b/jdk/test/com/sun/jdi/InterruptHangTest.java index fac166885d7..0e7a24ab785 100644 --- a/jdk/test/com/sun/jdi/InterruptHangTest.java +++ b/jdk/test/com/sun/jdi/InterruptHangTest.java @@ -153,14 +153,17 @@ public class InterruptHangTest extends TestScaffold { timerThread = new Thread("test timer") { public void run() { int mySteps = 0; + float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0")); + long sleepSeconds = (long)(20 * timeoutFactor); + println("Timer watching for steps every " + sleepSeconds + " seconds"); while (true) { try { - Thread.sleep(20000); + Thread.sleep(sleepSeconds * 1000); synchronized(sync) { - System.out.println("steps = " + nSteps); + println("steps = " + nSteps); if (mySteps == nSteps) { - // no step for 10 secs - failure("failure: Debuggee appears to be hung"); + // no step for a long time + failure("failure: Debuggee appears to be hung (no steps for " + sleepSeconds + "s)"); vm().exit(-1); break; } diff --git a/jdk/test/com/sun/jdi/TestScaffold.java b/jdk/test/com/sun/jdi/TestScaffold.java index f221221a1de..4e80d408901 100644 --- a/jdk/test/com/sun/jdi/TestScaffold.java +++ b/jdk/test/com/sun/jdi/TestScaffold.java @@ -64,6 +64,7 @@ abstract public class TestScaffold extends TargetAdapter { boolean vmDisconnected = false; final String[] args; protected boolean testFailed = false; + protected long startTime; static private class ArgInfo { String targetVMArgs = ""; @@ -425,6 +426,7 @@ abstract public class TestScaffold extends TargetAdapter { abstract protected void runTests() throws Exception; final public void startTests() throws Exception { + startTime = System.currentTimeMillis(); try { runTests(); } finally { @@ -433,7 +435,8 @@ abstract public class TestScaffold extends TargetAdapter { } protected void println(String str) { - System.err.println(str); + long elapsed = System.currentTimeMillis() - startTime; + System.err.println("[" + elapsed + "ms] " + str); } protected void print(String str) { From 260f238cd55fb3423fc124229fc50ee8813d11c8 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Mar 2016 21:40:20 +0300 Subject: [PATCH 10/15] 8151444: JDP not working Don't set IP_MULTICAST_IF explicitly Reviewed-by: sla, ysuenaga --- .../sun/management/jdp/JdpBroadcaster.java | 23 ------------------- .../sun/management/jdp/JdpDefaultsTest.java | 1 - jdk/test/sun/management/jdp/JdpTestCase.java | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java b/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java index cdb33ef7afa..6334bc7a06a 100644 --- a/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java +++ b/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java @@ -99,30 +99,7 @@ public final class JdpBroadcaster { throw new JdpException("Unable to bind to source address"); } channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, interf); - } else { - Enumeration nics = NetworkInterface.getNetworkInterfaces(); - boolean succeed = false; - - while (nics.hasMoreElements()) { - NetworkInterface nic = nics.nextElement(); - - if (nic.isUp() && nic.supportsMulticast()) { - try { - channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, nic); - succeed = true; - } catch (IOException ex) { - // pass - } - } - - } - - if (!succeed) { - throw new JdpException("Unable to bind to any interfaces."); - } - } - } /** diff --git a/jdk/test/sun/management/jdp/JdpDefaultsTest.java b/jdk/test/sun/management/jdp/JdpDefaultsTest.java index 2156e38c4ec..029316988a4 100644 --- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java +++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java @@ -57,7 +57,6 @@ public class JdpDefaultsTest extends DynamicLauncher { "-Dcom.sun.management.jmxremote.autodiscovery=true", "-Dcom.sun.management.jdp.pause=1", "-Dcom.sun.management.jdp.name=" + jdpName, - "-Dcom.sun.management.jdp.address=224.0.23.178", "-Djava.util.logging.SimpleFormatter.format='%1$tF %1$tT %4$-7s %5$s %n'", testName }; diff --git a/jdk/test/sun/management/jdp/JdpTestCase.java b/jdk/test/sun/management/jdp/JdpTestCase.java index fbd0d72ecb3..f3147fdf88a 100644 --- a/jdk/test/sun/management/jdp/JdpTestCase.java +++ b/jdk/test/sun/management/jdp/JdpTestCase.java @@ -122,7 +122,7 @@ public abstract class JdpTestCase { */ private void jdpPacketReceived(Map payload) throws Exception { final String instanceName = payload.get("INSTANCE_NAME"); - if (instanceName.equals(connection.instanceName)) { + if (instanceName != null && instanceName.equals(connection.instanceName)) { packetFromThisVMReceived(payload); } else { packetFromOtherVMReceived(payload); From 61a2d9272bdcc68318eef13b3878f9cc946caaf6 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 24 Mar 2016 15:59:29 -0400 Subject: [PATCH 11/15] 8152719: ignore this com/sun/jdi/InterfaceMehtodsTest.java until bug is fix Reviewed-by: ctornqvi, hseigel, sspitsyn --- jdk/test/ProblemList.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 88ed7d2bf8f..925c4bec656 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -379,6 +379,12 @@ com/sun/jdi/CatchPatternTest.sh generic-all # 8067354 com/sun/jdi/GetLocalVariables4Test.sh windows-all +# 8152586 +com/sun/jdi/InterfaceMethodsTest.java generic-all + +# 8152586 +com/sun/jdi/InvokeTest.java generic-all + ############################################################################ # jdk_util From e23a7ba5f4bdf4f0943fbcb3c4ce9be89669f287 Mon Sep 17 00:00:00 2001 From: Alexander Kulyakhtin Date: Thu, 24 Mar 2016 15:22:18 +0300 Subject: [PATCH 12/15] 8147987: Remove sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java from problemList Re-enabling a previously excluded test Reviewed-by: sspitsyn --- jdk/test/ProblemList.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 925c4bec656..8f8548ce015 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -162,9 +162,6 @@ javax/management/MBeanServer/OldMBeanServerTest.java aix-all # 8042215 javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java generic-all -# 8147985 -sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java generic-all - ############################################################################ # jdk_net From 1f5235f540231d5c73b219a9e083c3b4de13ef5f Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 30 Mar 2016 21:05:35 +0900 Subject: [PATCH 13/15] 8151674: STW phases at Concurrent GC should count in PerfCounter Reviewed-by: jmasa, sla, tschatzl --- .../sun/tools/jstat/resources/jstat_options | 124 +++++++++++++++++- .../sun/tools/jstat/gcCapacityOutput1.awk | 10 +- jdk/test/sun/tools/jstat/gcCauseOutput1.awk | 6 +- .../sun/tools/jstat/gcMetaCapacityOutput1.awk | 8 +- .../sun/tools/jstat/gcNewCapacityOutput1.awk | 9 +- .../sun/tools/jstat/gcOldCapacityOutput1.awk | 8 +- jdk/test/sun/tools/jstat/gcOldOutput1.awk | 6 +- jdk/test/sun/tools/jstat/gcOutput1.awk | 8 +- jdk/test/sun/tools/jstat/lineCounts1.awk | 16 +-- jdk/test/sun/tools/jstat/lineCounts2.awk | 8 +- jdk/test/sun/tools/jstat/lineCounts3.awk | 26 ++-- jdk/test/sun/tools/jstat/lineCounts4.awk | 30 ++--- jdk/test/sun/tools/jstat/timeStamp1.awk | 8 +- 13 files changed, 191 insertions(+), 76 deletions(-) diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options index 9bccaebd0d0..05af6b23ded 100644 --- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options +++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options @@ -254,9 +254,25 @@ option gc { scale sec format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align center + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -408,6 +424,14 @@ option gccapacity { scale raw format "0" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } } option gccause { @@ -490,9 +514,25 @@ option gccause { width 8 format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -690,6 +730,14 @@ option gcnewcapacity { scale raw format "0" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } } option gcold { @@ -764,9 +812,25 @@ option gcold { width 8 format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -830,9 +894,25 @@ option gcoldcapacity { width 8 format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -912,9 +992,25 @@ option gcmetacapacity { width 8 format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -1002,9 +1098,25 @@ option gcutil { width 8 format "0.000" } + column { + header "^CGC^" /* Concurrent Collections (STW phase) */ + data sun.gc.collector.2.invocations + align right + width 5 + scale raw + format "0" + } + column { + header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ + data sun.gc.collector.2.time/sun.os.hrt.frequency + align right + width 8 + scale sec + format "0.000" + } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency align right width 8 scale sec diff --git a/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk index ec7a737d55c..f556a1dd126 100644 --- a/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk @@ -3,19 +3,21 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC -# 4096.0 657408.0 8192.0 512.0 512.0 3072.0 6144.0 1312768.0 6144.0 6144.0 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 +# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC +# 4096.0 657408.0 8192.0 512.0 512.0 3072.0 6144.0 1312768.0 6144.0 6144.0 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0 + + BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC $/ { +/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcCauseOutput1.awk b/jdk/test/sun/tools/jstat/gcCauseOutput1.awk index 005e791043a..8495b621bce 100644 --- a/jdk/test/sun/tools/jstat/gcCauseOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcCauseOutput1.awk @@ -3,15 +3,15 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC -# 0.00 0.00 0.00 9.97 90.94 87.70 2 0.013 0 0.000 0.013 Allocation Failure No GC +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC +# 0.00 0.00 0.00 9.97 90.94 87.70 2 0.013 0 0.000 0 0.000 0.013 Allocation Failure No GC BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC $/ { headerlines++; } diff --git a/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk index 352e02d6cbc..2d08dcc29da 100644 --- a/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT -# 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0.000 0.004 +# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT +# 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0.000 0 0.000 0.004 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT $/ { +/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk index f4473dc37e4..51b4d24cec4 100644 --- a/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk @@ -3,19 +3,20 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC -# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 +# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC +# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 0 + BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC $/ { +/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk index cbf88756060..c2a3a3dcdcc 100644 --- a/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# OGCMN OGCMX OGC OC YGC FGC FGCT GCT -# 6016.0 58304.0 6016.0 6016.0 1 0 0.000 0.030 +# OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT +# 6016.0 58304.0 6016.0 6016.0 1 0 0.000 0 0.000 0.030 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ OGCMN OGCMX OGC OC YGC FGC FGCT GCT $/ { +/^ OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOldOutput1.awk b/jdk/test/sun/tools/jstat/gcOldOutput1.awk index 319f707d273..4ea47780015 100644 --- a/jdk/test/sun/tools/jstat/gcOldOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOldOutput1.awk @@ -3,7 +3,7 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# MC MU CCSC CCSU OC OU YGC FGC FGCT GCT +# MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT # 5120.0 4152.0 512.0 397.9 6144.0 200.0 1 0 0.000 0.005 @@ -11,11 +11,11 @@ BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ MC MU CCSC CCSU OC OU YGC FGC FGCT GCT $/ { +/^ MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOutput1.awk b/jdk/test/sun/tools/jstat/gcOutput1.awk index 5bd59fe0d8e..bf27f8c3317 100644 --- a/jdk/test/sun/tools/jstat/gcOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOutput1.awk @@ -3,19 +3,19 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT -# 512.0 512.0 0.0 496.0 3072.0 615.5 6144.0 280.0 5120.0 4176.0 512.0 401.0 1 0.005 0 0.000 0.005 +# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT +# 512.0 512.0 0.0 496.0 3072.0 615.5 6144.0 280.0 5120.0 4176.0 512.0 401.0 1 0.005 0 0.000 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT $/ { +/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts1.awk b/jdk/test/sun/tools/jstat/lineCounts1.awk index cc974104b99..6eeffd4f8fe 100644 --- a/jdk/test/sun/tools/jstat/lineCounts1.awk +++ b/jdk/test/sun/tools/jstat/lineCounts1.awk @@ -3,22 +3,22 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.00 93.76 28.80 1.82 77.74 68.02 1 0.005 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 -# 0.00 93.76 75.00 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.00 93.76 28.80 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# 0.00 93.76 75.00 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts2.awk b/jdk/test/sun/tools/jstat/lineCounts2.awk index ac2009d2e0b..2766c1a3ab3 100644 --- a/jdk/test/sun/tools/jstat/lineCounts2.awk +++ b/jdk/test/sun/tools/jstat/lineCounts2.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.00 93.76 28.40 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.00 93.76 28.40 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts3.awk b/jdk/test/sun/tools/jstat/lineCounts3.awk index 9b6d3ecec59..5577b417a3c 100644 --- a/jdk/test/sun/tools/jstat/lineCounts3.awk +++ b/jdk/test/sun/tools/jstat/lineCounts3.awk @@ -3,27 +3,27 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.00 93.76 26.48 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 71.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.00 93.76 26.48 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 71.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts4.awk b/jdk/test/sun/tools/jstat/lineCounts4.awk index db40ad355c6..eb20692d376 100644 --- a/jdk/test/sun/tools/jstat/lineCounts4.awk +++ b/jdk/test/sun/tools/jstat/lineCounts4.awk @@ -3,30 +3,30 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.00 96.88 66.55 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 71.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 -# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.00 96.88 79.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.00 96.88 66.55 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 71.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.00 96.88 79.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 BEGIN { headerlines=0; datalines=0; totallines=0 datalines2=0; } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { if (headerlines == 2) { datalines2++; } diff --git a/jdk/test/sun/tools/jstat/timeStamp1.awk b/jdk/test/sun/tools/jstat/timeStamp1.awk index 908f4230419..ab955eb3d8e 100644 --- a/jdk/test/sun/tools/jstat/timeStamp1.awk +++ b/jdk/test/sun/tools/jstat/timeStamp1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -#Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT GCT -# 0.3 0.00 100.00 68.74 1.95 77.73 68.02 1 0.004 0 0.000 0.004 +#Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT +# 0.3 0.00 100.00 68.74 1.95 77.73 68.02 1 0.004 0 0.000 0 0.000 0.004 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { +/^Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } From 0060da2f236791f15a5af1c7c685fb6d58e3bf4e Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 1 Apr 2016 14:29:41 -0700 Subject: [PATCH 14/15] 8153302: [BACKOUT] STW phases at Concurrent GC should count in PerfCounter Reviewed-by: jmasa, jwilhelm --- .../sun/tools/jstat/resources/jstat_options | 124 +----------------- .../sun/tools/jstat/gcCapacityOutput1.awk | 10 +- jdk/test/sun/tools/jstat/gcCauseOutput1.awk | 6 +- .../sun/tools/jstat/gcMetaCapacityOutput1.awk | 8 +- .../sun/tools/jstat/gcNewCapacityOutput1.awk | 9 +- .../sun/tools/jstat/gcOldCapacityOutput1.awk | 8 +- jdk/test/sun/tools/jstat/gcOldOutput1.awk | 6 +- jdk/test/sun/tools/jstat/gcOutput1.awk | 8 +- jdk/test/sun/tools/jstat/lineCounts1.awk | 16 +-- jdk/test/sun/tools/jstat/lineCounts2.awk | 8 +- jdk/test/sun/tools/jstat/lineCounts3.awk | 26 ++-- jdk/test/sun/tools/jstat/lineCounts4.awk | 30 ++--- jdk/test/sun/tools/jstat/timeStamp1.awk | 8 +- 13 files changed, 76 insertions(+), 191 deletions(-) diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options index 05af6b23ded..9bccaebd0d0 100644 --- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options +++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options @@ -254,25 +254,9 @@ option gc { scale sec format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align center - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -424,14 +408,6 @@ option gccapacity { scale raw format "0" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } } option gccause { @@ -514,25 +490,9 @@ option gccause { width 8 format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -730,14 +690,6 @@ option gcnewcapacity { scale raw format "0" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } } option gcold { @@ -812,25 +764,9 @@ option gcold { width 8 format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -894,25 +830,9 @@ option gcoldcapacity { width 8 format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -992,25 +912,9 @@ option gcmetacapacity { width 8 format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec @@ -1098,25 +1002,9 @@ option gcutil { width 8 format "0.000" } - column { - header "^CGC^" /* Concurrent Collections (STW phase) */ - data sun.gc.collector.2.invocations - align right - width 5 - scale raw - format "0" - } - column { - header "^CGCT^" /* Concurrent Garbage Collection Time (STW phase) */ - data sun.gc.collector.2.time/sun.os.hrt.frequency - align right - width 8 - scale sec - format "0.000" - } column { header "^GCT^" /* Total Garbage Collection Time */ - data (sun.gc.collector.0.time + sun.gc.collector.1.time + sun.gc.collector.2.time)/sun.os.hrt.frequency + data (sun.gc.collector.0.time + sun.gc.collector.1.time)/sun.os.hrt.frequency align right width 8 scale sec diff --git a/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk index f556a1dd126..ec7a737d55c 100644 --- a/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcCapacityOutput1.awk @@ -3,21 +3,19 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC -# 4096.0 657408.0 8192.0 512.0 512.0 3072.0 6144.0 1312768.0 6144.0 6144.0 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0 - - +# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC +# 4096.0 657408.0 8192.0 512.0 512.0 3072.0 6144.0 1312768.0 6144.0 6144.0 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC $/ { +/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcCauseOutput1.awk b/jdk/test/sun/tools/jstat/gcCauseOutput1.awk index 8495b621bce..005e791043a 100644 --- a/jdk/test/sun/tools/jstat/gcCauseOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcCauseOutput1.awk @@ -3,15 +3,15 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC -# 0.00 0.00 0.00 9.97 90.94 87.70 2 0.013 0 0.000 0 0.000 0.013 Allocation Failure No GC +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC +# 0.00 0.00 0.00 9.97 90.94 87.70 2 0.013 0 0.000 0.013 Allocation Failure No GC BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC $/ { headerlines++; } diff --git a/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk index 2d08dcc29da..352e02d6cbc 100644 --- a/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT -# 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0.000 0 0.000 0.004 +# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT +# 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0.000 0.004 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT $/ { +/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk index 51b4d24cec4..f4473dc37e4 100644 --- a/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk @@ -3,20 +3,19 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC -# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 0 - +# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC +# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC $/ { +/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk index c2a3a3dcdcc..cbf88756060 100644 --- a/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT -# 6016.0 58304.0 6016.0 6016.0 1 0 0.000 0 0.000 0.030 +# OGCMN OGCMX OGC OC YGC FGC FGCT GCT +# 6016.0 58304.0 6016.0 6016.0 1 0 0.000 0.030 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT $/ { +/^ OGCMN OGCMX OGC OC YGC FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOldOutput1.awk b/jdk/test/sun/tools/jstat/gcOldOutput1.awk index 4ea47780015..319f707d273 100644 --- a/jdk/test/sun/tools/jstat/gcOldOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOldOutput1.awk @@ -3,7 +3,7 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT +# MC MU CCSC CCSU OC OU YGC FGC FGCT GCT # 5120.0 4152.0 512.0 397.9 6144.0 200.0 1 0 0.000 0.005 @@ -11,11 +11,11 @@ BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT $/ { +/^ MC MU CCSC CCSU OC OU YGC FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/gcOutput1.awk b/jdk/test/sun/tools/jstat/gcOutput1.awk index bf27f8c3317..5bd59fe0d8e 100644 --- a/jdk/test/sun/tools/jstat/gcOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcOutput1.awk @@ -3,19 +3,19 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT -# 512.0 512.0 0.0 496.0 3072.0 615.5 6144.0 280.0 5120.0 4176.0 512.0 401.0 1 0.005 0 0.000 0 0.000 0.005 +# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT +# 512.0 512.0 0.0 496.0 3072.0 615.5 6144.0 280.0 5120.0 4176.0 512.0 401.0 1 0.005 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts1.awk b/jdk/test/sun/tools/jstat/lineCounts1.awk index 6eeffd4f8fe..cc974104b99 100644 --- a/jdk/test/sun/tools/jstat/lineCounts1.awk +++ b/jdk/test/sun/tools/jstat/lineCounts1.awk @@ -3,22 +3,22 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.00 93.76 28.80 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 -# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 -# 0.00 93.76 75.00 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.00 93.76 28.80 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# 0.00 93.76 73.04 1.82 77.74 68.02 1 0.005 0 0.000 0.005 +# 0.00 93.76 75.00 1.82 77.74 68.02 1 0.005 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts2.awk b/jdk/test/sun/tools/jstat/lineCounts2.awk index 2766c1a3ab3..ac2009d2e0b 100644 --- a/jdk/test/sun/tools/jstat/lineCounts2.awk +++ b/jdk/test/sun/tools/jstat/lineCounts2.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.00 93.76 28.40 1.82 77.74 68.02 1 0.005 0 0.000 0 0.000 0.005 +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.00 93.76 28.40 1.82 77.74 68.02 1 0.005 0 0.000 0.005 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts3.awk b/jdk/test/sun/tools/jstat/lineCounts3.awk index 5577b417a3c..9b6d3ecec59 100644 --- a/jdk/test/sun/tools/jstat/lineCounts3.awk +++ b/jdk/test/sun/tools/jstat/lineCounts3.awk @@ -3,27 +3,27 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.00 93.76 26.48 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 71.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 -# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0 0.000 0.006 +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.00 93.76 26.48 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 71.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 73.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 75.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 +# 0.00 93.76 77.58 1.95 77.78 68.02 1 0.006 0 0.000 0.006 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } diff --git a/jdk/test/sun/tools/jstat/lineCounts4.awk b/jdk/test/sun/tools/jstat/lineCounts4.awk index eb20692d376..db40ad355c6 100644 --- a/jdk/test/sun/tools/jstat/lineCounts4.awk +++ b/jdk/test/sun/tools/jstat/lineCounts4.awk @@ -3,30 +3,30 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.00 96.88 66.55 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 71.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 -# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.00 96.88 79.58 2.34 77.78 68.02 1 0.003 0 0.000 0 0.000 0.003 +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.00 96.88 66.55 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 71.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 73.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 75.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# 0.00 96.88 77.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 +# S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.00 96.88 79.58 2.34 77.78 68.02 1 0.003 0 0.000 0.003 BEGIN { headerlines=0; datalines=0; totallines=0 datalines2=0; } -/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^ S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { if (headerlines == 2) { datalines2++; } diff --git a/jdk/test/sun/tools/jstat/timeStamp1.awk b/jdk/test/sun/tools/jstat/timeStamp1.awk index ab955eb3d8e..908f4230419 100644 --- a/jdk/test/sun/tools/jstat/timeStamp1.awk +++ b/jdk/test/sun/tools/jstat/timeStamp1.awk @@ -3,18 +3,18 @@ # that the numerical values conform to a specific pattern, rather than # specific values. # -#Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT -# 0.3 0.00 100.00 68.74 1.95 77.73 68.02 1 0.004 0 0.000 0 0.000 0.004 +#Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT GCT +# 0.3 0.00 100.00 68.74 1.95 77.73 68.02 1 0.004 0 0.000 0.004 BEGIN { headerlines=0; datalines=0; totallines=0 } -/^Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ { +/^Timestamp S0 S1 E O M CCS YGC YGCT FGC FGCT GCT $/ { headerlines++; } -/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { +/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*([0-9]+\.[0-9]+)|-[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ { datalines++; } From 4de86a31a6fd35883c9e9aba115bf30b5ac708b4 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 6 Apr 2016 15:16:55 -0700 Subject: [PATCH 15/15] 8153673: [BACKOUT] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command Reviewed-by: jwilhelm, sspitsyn --- .../share/native/libjdwp/invoker.c | 48 --- jdk/test/com/sun/jdi/OomDebugTest.java | 312 ------------------ 2 files changed, 360 deletions(-) delete mode 100644 jdk/test/com/sun/jdi/OomDebugTest.java diff --git a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c index 680a747ba0c..cd1cd2f7dc0 100644 --- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c +++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c @@ -211,47 +211,6 @@ createGlobalRefs(JNIEnv *env, InvokeRequest *request) return error; } -/* - * Delete global references from the request which got put there before a - * invoke request was carried out. See fillInvokeRequest() and invoker invoke*() - * impls. - */ -static void -deleteGlobalRefs(JNIEnv *env, InvokeRequest *request) -{ - void *cursor; - jint argIndex = 0; - jvalue *argument = request->arguments; - jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); - - if (request->clazz != NULL) { - tossGlobalRef(env, &(request->clazz)); - } - if (request->instance != NULL) { - tossGlobalRef(env, &(request->instance)); - } - /* Delete global argument references */ - while (argIndex < request->argumentCount) { - if ((argumentTag == JDWP_TAG(OBJECT)) || - (argumentTag == JDWP_TAG(ARRAY))) { - if (argument->l != NULL) { - tossGlobalRef(env, &(argument->l)); - } - } - argument++; - argIndex++; - argumentTag = nextArgumentTypeTag(&cursor); - } - /* Delete potentially saved return values */ - if ((request->invokeType == INVOKE_CONSTRUCTOR) || - (returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT)) || - (returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY))) { - if (request->returnValue.l != NULL) { - tossGlobalRef(env, &(request->returnValue.l)); - } - } -} - static jvmtiError fillInvokeRequest(JNIEnv *env, InvokeRequest *request, jbyte invokeType, jbyte options, jint id, @@ -777,13 +736,6 @@ invoker_completeInvokeRequest(jthread thread) (void)outStream_writeObjectRef(env, &out, exc); outStream_sendReply(&out); } - - /* - * At this time, there's no need to retain global references on - * arguments since the reply is processed. No one will deal with - * this request ID anymore, so we must call deleteGlobalRefs(). - */ - deleteGlobalRefs(env, request); } jboolean diff --git a/jdk/test/com/sun/jdi/OomDebugTest.java b/jdk/test/com/sun/jdi/OomDebugTest.java deleted file mode 100644 index eadb2aaa342..00000000000 --- a/jdk/test/com/sun/jdi/OomDebugTest.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2016 Red Hat Inc. - * - * 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. - */ - -/** - * @test - * @bug 4858370 - * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). - * - * @author Severin Gehwolf - * - * @library .. - * @run build TestScaffold VMConnection TargetListener TargetAdapter - * @run compile -g OomDebugTest.java - * @run main OomDebugTest OomDebugTestTarget test1 - * @run main OomDebugTest OomDebugTestTarget test2 - * @run main OomDebugTest OomDebugTestTarget test3 - * @run main OomDebugTest OomDebugTestTarget test4 - * @run main OomDebugTest OomDebugTestTarget test5 - */ -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.sun.jdi.ArrayReference; -import com.sun.jdi.ArrayType; -import com.sun.jdi.ClassType; -import com.sun.jdi.Field; -import com.sun.jdi.InvocationException; -import com.sun.jdi.Method; -import com.sun.jdi.ObjectReference; -import com.sun.jdi.ReferenceType; -import com.sun.jdi.StackFrame; -import com.sun.jdi.VMOutOfMemoryException; -import com.sun.jdi.Value; -import com.sun.jdi.event.BreakpointEvent; - -/***************** Target program **********************/ - -class OomDebugTestTarget { - - OomDebugTestTarget() { - System.out.println("DEBUG: invoked constructor"); - } - static class FooCls { - @SuppressWarnings("unused") - private byte[] bytes = new byte[3000000]; - }; - - FooCls fooCls = new FooCls(); - byte[] byteArray = new byte[0]; - - void testMethod(FooCls foo) { - System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); - } - - void testPrimitive(byte[] foo) { - System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); - } - - byte[] testPrimitiveArrRetval() { - System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); - return new byte[3000000]; - } - - FooCls testFooClsRetval() { - System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); - return new FooCls(); - } - - public void entry() {} - - public static void main(String[] args){ - System.out.println("DEBUG: OomDebugTestTarget.main"); - new OomDebugTestTarget().entry(); - } -} - -/***************** Test program ************************/ - -public class OomDebugTest extends TestScaffold { - - private static final int TOTAL_TESTS = 1; - private ReferenceType targetClass; - private ObjectReference thisObject; - private int failedTests; - private final String testMethodName; - - public OomDebugTest(String[] args) { - super(args); - if (args.length != 2) { - throw new RuntimeException("Test failed unexpectedly."); - } - testMethodName = args[1]; - } - - @Override - protected void runTests() throws Exception { - try { - /* - * Get to the top of entry() - * to determine targetClass and mainThread - */ - BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); - targetClass = bpe.location().declaringType(); - - mainThread = bpe.thread(); - - StackFrame frame = mainThread.frame(0); - thisObject = frame.thisObject(); - java.lang.reflect.Method m = findTestMethod(); - m.invoke(this); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - failure(); - } catch (SecurityException e) { - e.printStackTrace(); - failure(); - } - } - - private java.lang.reflect.Method findTestMethod() - throws NoSuchMethodException, SecurityException { - return OomDebugTest.class.getDeclaredMethod(testMethodName); - } - - private void failure() { - failedTests++; - } - - /* - * Test case: Object reference as method parameter. - */ - @SuppressWarnings("unused") // called via reflection - private void test1() throws Exception { - System.out.println("DEBUG: ------------> Running " + testMethodName); - try { - Field field = targetClass.fieldByName("fooCls"); - ClassType clsType = (ClassType)field.type(); - Method constructor = getConstructorForClass(clsType); - for (int i = 0; i < 15; i++) { - @SuppressWarnings({ "rawtypes", "unchecked" }) - ObjectReference objRef = clsType.newInstance(mainThread, - constructor, - new ArrayList(0), - ObjectReference.INVOKE_NONVIRTUAL); - invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); - } - } catch (InvocationException e) { - handleFailure(e); - } - } - - /* - * Test case: Array reference as method parameter. - */ - @SuppressWarnings("unused") // called via reflection - private void test2() throws Exception { - System.out.println("DEBUG: ------------> Running " + testMethodName); - try { - Field field = targetClass.fieldByName("byteArray"); - ArrayType arrType = (ArrayType)field.type(); - - for (int i = 0; i < 15; i++) { - ArrayReference byteArrayVal = arrType.newInstance(3000000); - invoke("testPrimitive", "([B)V", byteArrayVal); - } - } catch (VMOutOfMemoryException e) { - defaultHandleOOMFailure(e); - } - } - - /* - * Test case: Array reference as return value. - */ - @SuppressWarnings("unused") // called via reflection - private void test3() throws Exception { - System.out.println("DEBUG: ------------> Running " + testMethodName); - try { - for (int i = 0; i < 15; i++) { - invoke("testPrimitiveArrRetval", - "()[B", - Collections.EMPTY_LIST, - vm().mirrorOfVoid()); - } - } catch (InvocationException e) { - handleFailure(e); - } - } - - /* - * Test case: Object reference as return value. - */ - @SuppressWarnings("unused") // called via reflection - private void test4() throws Exception { - System.out.println("DEBUG: ------------> Running " + testMethodName); - try { - for (int i = 0; i < 15; i++) { - invoke("testFooClsRetval", - "()LOomDebugTestTarget$FooCls;", - Collections.EMPTY_LIST, - vm().mirrorOfVoid()); - } - } catch (InvocationException e) { - handleFailure(e); - } - } - - /* - * Test case: Constructor - */ - @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection - private void test5() throws Exception { - System.out.println("DEBUG: ------------> Running " + testMethodName); - try { - ClassType type = (ClassType)thisObject.type(); - for (int i = 0; i < 15; i++) { - type.newInstance(mainThread, - findMethod(targetClass, "", "()V"), - new ArrayList(0), - ObjectReference.INVOKE_NONVIRTUAL); - } - } catch (InvocationException e) { - handleFailure(e); - } - } - - private Method getConstructorForClass(ClassType clsType) { - List methods = clsType.methodsByName(""); - if (methods.size() != 1) { - throw new RuntimeException("FAIL. Expected only one, the default, constructor"); - } - return methods.get(0); - } - - private void handleFailure(InvocationException e) { - // There is no good way to see the OOME diagnostic message in the target since the - // TestScaffold might throw an exception while trying to print the stack trace. I.e - // it might get a a VMDisconnectedException before the stack trace printing finishes. - System.err.println("FAILURE: InvocationException caused by OOM"); - defaultHandleOOMFailure(e); - } - - private void defaultHandleOOMFailure(Exception e) { - e.printStackTrace(); - failure(); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - void invoke(String methodName, String methodSig, Value value) - throws Exception { - List args = new ArrayList(1); - args.add(value); - invoke(methodName, methodSig, args, value); - } - - void invoke(String methodName, - String methodSig, - @SuppressWarnings("rawtypes") List args, - Value value) throws Exception { - Method method = findMethod(targetClass, methodName, methodSig); - if ( method == null) { - failure("FAILED: Can't find method: " - + methodName + " for class = " + targetClass); - return; - } - invoke(method, args, value); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - void invoke(Method method, List args, Value value) throws Exception { - thisObject.invokeMethod(mainThread, method, args, 0); - System.out.println("DEBUG: Done invoking method via debugger."); - } - - Value fieldValue(String fieldName) { - Field field = targetClass.fieldByName(fieldName); - return thisObject.getValue(field); - } - - public static void main(String[] args) throws Exception { - System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option - OomDebugTest oomTest = new OomDebugTest(args); - oomTest.startTests(); - if (oomTest.failedTests > 0) { - throw new RuntimeException(oomTest.failedTests - + " of " + TOTAL_TESTS + " test(s) failed."); - } - System.out.println("All " + TOTAL_TESTS + " tests passed."); - } - -}