Path: blob/master/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java
41152 views
/*1* Copyright (c) 2017, 2019, 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*/2223import java.util.HashMap;24import java.util.List;25import java.util.Map;26import jdk.test.lib.apps.LingeredApp;27import jtreg.SkippedException;2829/**30* @test31* @bug 819153832* @summary Test clhsdb 'vmstructsdump' command33* @requires vm.hasSA34* @library /test/lib35* @run main/othervm ClhsdbVmStructsDump36*/3738public class ClhsdbVmStructsDump {3940public static void main(String[] args) throws Exception {41System.out.println("Starting ClhsdbVmStructsDump test");4243LingeredApp theApp = null;44try {45ClhsdbLauncher test = new ClhsdbLauncher();46theApp = LingeredApp.startApp();47System.out.println("Started LingeredApp with pid " + theApp.getPid());4849List<String> cmds = List.of("vmstructsdump");5051Map<String, List<String>> expStrMap = new HashMap<>();52expStrMap.put("vmstructsdump", List.of(53"field ConstantPool _pool_holder InstanceKlass*",54"field InstanceKlass _methods Array<Method*>*",55"field InstanceKlass _constants ConstantPool*",56"field Klass _name Symbol*",57"type ClassLoaderData* null",58"type DictionaryEntry KlassHashtableEntry",59"field JavaThread _osthread OSThread*",60"type TenuredGeneration CardGeneration",61"field JVMState _bci",62"type Universe null",63"type ConstantPoolCache MetaspaceObj"));64test.run(theApp.getPid(), cmds, expStrMap, null);65} catch (SkippedException se) {66throw se;67} catch (Exception ex) {68throw new RuntimeException("Test ERROR " + ex, ex);69} finally {70LingeredApp.stopApp(theApp);71}72System.out.println("Test PASSED");73}74}757677