hotspot/test/runtime/NMT/PrintNMTStatistics.java
changeset 25948 9b33776f4f07
parent 22193 530963406a44
child 25960 729cd80956ae
child 26147 8f797b3ef01e
equal deleted inserted replaced
25947:8f94ddc3729a 25948:9b33776f4f07
     1 /*
     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    26  * @key nmt regression
    26  * @key nmt regression
    27  * @bug 8005936
    27  * @bug 8005936
    28  * @summary Make sure PrintNMTStatistics works on normal JVM exit
    28  * @summary Make sure PrintNMTStatistics works on normal JVM exit
    29  * @library /testlibrary /testlibrary/whitebox
    29  * @library /testlibrary /testlibrary/whitebox
    30  * @build PrintNMTStatistics
    30  * @build PrintNMTStatistics
       
    31  * @ignore
    31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
    32  * @run main ClassFileInstaller sun.hotspot.WhiteBox
    32  * @run main PrintNMTStatistics
    33  * @run main PrintNMTStatistics
    33  */
    34  */
    34 
    35 
    35 import com.oracle.java.testlibrary.*;
    36 import com.oracle.java.testlibrary.*;
    43   public static void main(String args[]) throws Exception {
    44   public static void main(String args[]) throws Exception {
    44 
    45 
    45     // We start a new java process running with an argument and use WB API to ensure
    46     // We start a new java process running with an argument and use WB API to ensure
    46     // we have data for NMT on VM exit
    47     // we have data for NMT on VM exit
    47     if (args.length > 0) {
    48     if (args.length > 0) {
    48       // Use WB API to ensure that all data has been merged before we continue
       
    49       if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
       
    50         throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
       
    51       }
       
    52       return;
    49       return;
    53     }
    50     }
    54 
    51 
    55     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    52     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    56         "-XX:+UnlockDiagnosticVMOptions",
    53         "-XX:+UnlockDiagnosticVMOptions",