Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/demo/jvmti/hprof/StackMapTableTest.java
38840 views
/*1* Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/222324/* @test25* @bug 6266289 6299047 6855180 685555126* @summary Test jvmti hprof and java_crw_demo with StackMapTable attributes27*28* @compile ../DemoRun.java29* @compile -source 7 -g:lines HelloWorld.java30* @build StackMapTableTest31* @run main StackMapTableTest HelloWorld32*/3334import java.util.*;3536public class StackMapTableTest {3738public static void main(String args[]) throws Exception {39DemoRun hprof;40List<String> options = new LinkedList<String>();4142options.add("cpu=samples,file=stackmaptable0.txt");43options.add("cpu=times,file=stackmaptable1.txt");44options.add("heap=sites,file=stackmaptable2.txt");45options.add("file=stackmaptable3.txt");4647for(String option: options) {48/* Run JVMTI hprof agent with various options */49hprof = new DemoRun("hprof", option);50hprof.runit(args[0]);5152/* Make sure patterns in output look ok */53if (hprof.output_contains("ERROR")) {54throw new RuntimeException("Test failed with " + option55+ " - ERROR seen in output");56}57}5859/* Must be a pass. */60System.out.println("Test passed - cleanly terminated");61}62}636465