2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * Redistribution and use in source and binary forms, with or without 0N/A * modification, are permitted provided that the following conditions 0N/A * - Redistributions of source code must retain the above copyright 0N/A * notice, this list of conditions and the following disclaimer. 0N/A * - Redistributions in binary form must reproduce the above copyright 0N/A * notice, this list of conditions and the following disclaimer in the 0N/A * documentation and/or other materials provided with the distribution. 2362N/A * - Neither the name of Oracle nor the names of its 0N/A * contributors may be used to endorse or promote products derived 0N/A * from this software without specific prior written permission. 0N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 0N/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 0N/A * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 0N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 0N/A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 0N/A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 0N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 0N/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 0N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 0N/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 0N/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0N/A/* Hprof binary format enums and spec. */ 0N/A/* Need to #define or typedef HprofId before including this file. 0N/A * hprof used ObjectIndex or 4 bytes, but it can be 4 or 8 byte type. 0N/A/* -------------------------------------------------------------------- */ 0N/A/* -------------------------------------------------------------------- */ 0N/A/* -------------------------------------------------------------------- */ 0N/A * hprof binary format: (result either written to a file or sent over 0N/A * WARNING: This format is still under development, and is subject to 0N/A * change without notice. 0N/A * header "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated) 0N/A * u4 size of identifiers. Identifiers are used to represent 0N/A * UTF8 strings, objects, stack traces, etc. They usually 0N/A * have the same size as host pointers. For example, on 0N/A * Solaris and Win32, the size is 4. 0N/A * u4 low word number of milliseconds since 0:00 GMT, 1/1/70 0N/A * [record]* a sequence of records. 0N/A * u1 a TAG denoting the type of the record 0N/A * u4 number of *microseconds* since the time stamp in the 0N/A * header. (wraps around in a little more than an hour) 0N/A * u4 number of bytes *remaining* in the record. Note that 0N/A * this number excludes the tag and the length field itself. 0N/A * [u1]* BODY of the record (a sequence of bytes) 0N/A * The following TAGs are supported: 0N/A *---------------------------------------------------------- 0N/A * HPROF_UTF8 a UTF8-encoded name 0N/A * [u1]* UTF8 characters (no trailing zero) 0N/A * HPROF_LOAD_CLASS a newly loaded class 0N/A * u4 class serial number (> 0) 0N/A * id class object ID 0N/A * u4 stack trace serial number 0N/A * HPROF_UNLOAD_CLASS an unloading class 0N/A * u4 class serial_number 0N/A * HPROF_FRAME a Java stack frame 0N/A * id method signature ID 0N/A * id source file name ID 0N/A * u4 class serial number 0N/A * i4 line number. >0: normal 0N/A * -2: compiled method 0N/A * HPROF_TRACE a Java stack trace 0N/A * u4 stack trace serial number 0N/A * u4 thread serial number 0N/A * u4 number of frames 0N/A * [id]* stack frame IDs 0N/A * HPROF_ALLOC_SITES a set of heap allocation sites, obtained after GC 0N/A * u2 flags 0x0001: incremental vs. complete 0N/A * 0x0002: sorted by allocation vs. live 0N/A * 0x0004: whether to force a GC 0N/A * u4 total live bytes 0N/A * u4 total live instances 0N/A * u8 total bytes allocated 0N/A * u8 total instances allocated 0N/A * u4 number of sites that follow 0N/A * [u1 is_array: 0: normal object 0N/A * u4 class serial number (may be zero during startup) 0N/A * u4 stack trace serial number 0N/A * u4 number of bytes alive 0N/A * u4 number of instances alive 0N/A * u4 number of bytes allocated 0N/A * u4]* number of instance allocated 0N/A * HPROF_START_THREAD a newly started thread. 0N/A * u4 thread serial number (> 0) 0N/A * id thread object ID 0N/A * u4 stack trace serial number 0N/A * id thread group name ID 0N/A * id thread group parent name ID 0N/A * HPROF_END_THREAD a terminating thread. 0N/A * u4 thread serial number 0N/A * HPROF_HEAP_SUMMARY heap summary 0N/A * u4 total live bytes 0N/A * u4 total live instances 0N/A * u8 total bytes allocated 0N/A * u8 total instances allocated 0N/A * HPROF_HEAP_DUMP or HPROF_HEAP_DUMP_SEGMENT denote a heap dump 0N/A * [heap dump sub-records]* 0N/A * There are four kinds of heap dump sub-records: 0N/A * u1 sub-record type 0N/A * HPROF_GC_ROOT_UNKNOWN unknown root 0N/A * HPROF_GC_ROOT_THREAD_OBJ thread object 0N/A * id thread object ID (may be 0 for a 0N/A * thread newly attached through JNI) 0N/A * u4 thread sequence number 0N/A * u4 stack trace sequence number 0N/A * HPROF_GC_ROOT_JNI_GLOBAL JNI global ref root 0N/A * id JNI global ref ID 0N/A * HPROF_GC_ROOT_JNI_LOCAL JNI local ref 0N/A * u4 thread serial number 0N/A * u4 frame # in stack trace (-1 for empty) 0N/A * HPROF_GC_ROOT_JAVA_FRAME Java stack frame 0N/A * u4 thread serial number 0N/A * u4 frame # in stack trace (-1 for empty) 0N/A * HPROF_GC_ROOT_NATIVE_STACK Native stack 0N/A * u4 thread serial number 0N/A * HPROF_GC_ROOT_STICKY_CLASS System class 0N/A * HPROF_GC_ROOT_THREAD_BLOCK Reference from thread block 0N/A * u4 thread serial number 0N/A * HPROF_GC_ROOT_MONITOR_USED Busy monitor 0N/A * HPROF_GC_CLASS_DUMP dump of a class object 0N/A * id class object ID 0N/A * u4 stack trace serial number 0N/A * id super class object ID 0N/A * id class loader object ID 0N/A * id signers object ID 0N/A * id protection domain object ID 0N/A * u4 instance size (in bytes) 0N/A * u2 size of constant pool 0N/A * [u2, constant pool index, 0N/A * u2 number of static fields 0N/A * [id, static field name, 0N/A * u2 number of inst. fields (not inc. super) 0N/A * [id, instance field name, 0N/A * HPROF_GC_INSTANCE_DUMP dump of a normal object 0N/A * u4 stack trace serial number 0N/A * id class object ID 0N/A * u4 number of bytes that follow 0N/A * [vl]* instance field values (class, followed 0N/A * by super, super's super ...) 0N/A * HPROF_GC_OBJ_ARRAY_DUMP dump of an object array 0N/A * id array object ID 0N/A * u4 stack trace serial number 0N/A * u4 number of elements 0N/A * HPROF_GC_PRIM_ARRAY_DUMP dump of a primitive array 0N/A * id array object ID 0N/A * u4 stack trace serial number 0N/A * u4 number of elements 0N/A * HPROF_HEAP_DUMP_END terminates series of heap dump segments 0N/A * HPROF_CPU_SAMPLES a set of sample traces of running threads 0N/A * u4 total number of samples 0N/A * u4]* stack trace serial number 0N/A * HPROF_CONTROL_SETTINGS the settings of on/off switches 0N/A * u2 stack trace depth 0N/A * Heap dump constants