ctornqvi@4518: /* ctornqvi@4518: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. ctornqvi@4518: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ctornqvi@4518: * ctornqvi@4518: * This code is free software; you can redistribute it and/or modify it ctornqvi@4518: * under the terms of the GNU General Public License version 2 only, as ctornqvi@4518: * published by the Free Software Foundation. ctornqvi@4518: * ctornqvi@4518: * This code is distributed in the hope that it will be useful, but WITHOUT ctornqvi@4518: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ctornqvi@4518: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ctornqvi@4518: * version 2 for more details (a copy is included in the LICENSE file that ctornqvi@4518: * accompanied this code). ctornqvi@4518: * ctornqvi@4518: * You should have received a copy of the GNU General Public License version ctornqvi@4518: * 2 along with this work; if not, write to the Free Software Foundation, ctornqvi@4518: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ctornqvi@4518: * ctornqvi@4518: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ctornqvi@4518: * or visit www.oracle.com if you need additional information or have any ctornqvi@4518: * questions. ctornqvi@4518: */ ctornqvi@4518: ctornqvi@4518: /* ctornqvi@4518: * @test ctornqvi@4518: * @bug 8004802 ctornqvi@4518: * @key nmt jcmd regression ctornqvi@4518: * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed ctornqvi@4518: * @library /testlibrary zgu@7075: * @ignore ctornqvi@4518: * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter ctornqvi@4518: */ ctornqvi@4518: ctornqvi@4518: import com.oracle.java.testlibrary.*; ctornqvi@4518: ctornqvi@4518: public class BaselineWithParameter { ctornqvi@4518: ctornqvi@4518: public static void main(String args[]) throws Exception { ctornqvi@4518: // Grab my own PID ctornqvi@4518: String pid = Integer.toString(ProcessTools.getProcessId()); ctornqvi@4518: OutputAnalyzer output; ctornqvi@4518: ctornqvi@4518: ProcessBuilder pb = new ProcessBuilder(); ctornqvi@4518: ctornqvi@4518: // Run 'jcmd VM.native_memory baseline=false' ctornqvi@4518: pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "baseline=false"}); ctornqvi@4803: pb.start().waitFor(); ctornqvi@4518: ctornqvi@4518: // Run 'jcmd VM.native_memory summary=false' ctornqvi@4518: pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary=false"}); ctornqvi@4518: output = new OutputAnalyzer(pb.start()); ctornqvi@4518: output.shouldContain("No command to execute"); ctornqvi@4518: ctornqvi@4518: } ctornqvi@4518: }