Path: blob/master/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java
41161 views
/*1* Copyright (c) 2004, 2020, 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*22*/2324package sun.jvm.hotspot.runtime;2526import java.util.*;27import sun.jvm.hotspot.debugger.*;28import sun.jvm.hotspot.oops.*;29import sun.jvm.hotspot.types.*;30import sun.jvm.hotspot.utilities.Observable;31import sun.jvm.hotspot.utilities.Observer;3233public class PerfDataPrologue extends VMObject {34private static JIntField magicField;35private static JByteField byteOrderField;36private static JByteField majorVersionField;37private static JByteField minorVersionField;38private static JByteField accessibleField;39private static JIntField usedField;40private static JIntField overflowField;41private static JLongField modTimeStampField;42private static JIntField entryOffsetField;43private static JIntField numEntriesField;4445static {46VM.registerVMInitializedObserver(new Observer() {47public void update(Observable o, Object data) {48initialize(VM.getVM().getTypeDataBase());49}50});51}5253private static synchronized void initialize(TypeDataBase db) {54Type type = db.lookupType("PerfDataPrologue");55magicField = type.getJIntField("magic");56byteOrderField = type.getJByteField("byte_order");57majorVersionField = type.getJByteField("major_version");58minorVersionField = type.getJByteField("minor_version");59accessibleField = type.getJByteField("accessible");60usedField = type.getJIntField("used");61overflowField = type.getJIntField("overflow");62modTimeStampField = type.getJLongField("mod_time_stamp");63entryOffsetField = type.getJIntField("entry_offset");64numEntriesField = type.getJIntField("num_entries");65}6667public PerfDataPrologue(Address addr) {68super(addr);69}7071// Accessors72public int magic() {73return (int) magicField.getValue(addr);74}7576public byte byteOrder() {77return (byte) byteOrderField.getValue(addr);78}7980public byte majorVersion() {81return (byte) majorVersionField.getValue(addr);82}8384public boolean accessible() {85return ((byte) accessibleField.getValue(addr)) != (byte)0;86}8788public int used() {89return (int) usedField.getValue(addr);90}9192public int overflow() {93return (int) overflowField.getValue(addr);94}9596public long modTimeStamp() {97return (long) modTimeStampField.getValue(addr);98}99100public int entryOffset() {101return (int) entryOffsetField.getValue(addr);102}103104public int numEntries() {105return (int) numEntriesField.getValue(addr);106}107}108109110