perfMemory.hpp revision 434
5612N/A * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. 5612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5612N/A * This code is free software; you can redistribute it and/or modify it 5612N/A * under the terms of the GNU General Public License version 2 only, as 5612N/A * published by the Free Software Foundation. 5612N/A * This code is distributed in the hope that it will be useful, but WITHOUT 5612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5612N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5612N/A * version 2 for more details (a copy is included in the LICENSE file that 5612N/A * You should have received a copy of the GNU General Public License version 5612N/A * 2 along with this work; if not, write to the Free Software Foundation, 5612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5612N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 5612N/A * CA 95054 USA or visit www.sun.com if you need additional information or 5612N/A * PerfData Version Constants 5612N/A * - Major Version - change whenever the structure of PerfDataEntry changes 5612N/A * - Minor Version - change whenever the data within the PerfDataEntry 5612N/A * structure changes. for example, new unit or variability 4103N/A * values are added or new PerfData subtypes are added. 4103N/A/* Byte order of the PerfData memory region. The byte order is exposed in 5615N/A * the PerfData memory region as the data in the memory region may have 5612N/A * been generated by a little endian JVM implementation. Tracking the byte 5615N/A * order in the PerfData memory region allows Java applications to adapt 4103N/A * to the native byte order for monitoring purposes. This indicator is 5615N/A * also useful when a snapshot of the PerfData memory region is shipped 4103N/A * to a machine with a native byte order different from that of the 4103N/A * The PerfDataPrologue structure is known by the PerfDataBuffer Java class 4103N/A * libraries that read the PerfData memory region. The size and the position 5615N/A * of the fields must be changed along with their counterparts in the 5615N/A * PerfDataBuffer Java class. The first four bytes of this structure 5615N/A * should never change, or compatibility problems between the monitoring 4103N/A * applications and Hotspot VMs will result. The reserved fields are 4103N/A * available for future enhancements. 4103N/A/* The PerfDataEntry structure defines the fixed portion of an entry 4103N/A * in the PerfData memory region. The PerfDataBuffer Java libraries 4103N/A * are aware of this structure and need to be changed when this 5612N/A // 'B','Z','J','I','S','C','D','F','V','L','[' 5615N/A body of PerfData memory entry is variable length 4103N/A jbyte[name_length] data_name; // name of the data item 4103N/A jbyte[pad_length] data_pad; // alignment of data item 4103N/A j<data_type>[data_length] data_item; // array of appropriate types. 4103N/A // data_length is > 1 only when the 4103N/A// Prefix of performance data file. 5615N/A// UINT_CHARS contains the number of characters holding a process id 5615N/A// (i.e. pid). pid is defined as unsigned "int" so the maximum possible pid value 5615N/A// would be 2^32 - 1 (4294967295) which can be represented as a 10 characters 5615N/A/* the PerfMemory class manages creation, destruction, 5615N/A * and allocation of the PerfData region. static char*
end() {
return _end; }
// methods for attaching to and detaching from the PerfData // memory segment of another JVM process on the same system. // filename of backing store or NULL if none. // returns the complete file path of hsperfdata. // the caller is expected to free the allocated memory.