jdk/src/share/demo/jvmti/hprof/hprof_b_spec.h
author goetz
Thu, 21 Nov 2013 18:29:34 -0800
changeset 22852 1063026e8cee
parent 5506 202f599c92aa
permissions -rw-r--r--
8028471: PPC64 (part 215): opto: Extend ImplicitNullCheck optimization. Summary: Fixed Implicit NULL check optimization for AIX, where the page at address '0' is only write-protected. Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#ifndef HPROF_B_SPEC_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#define HPROF_B_SPEC_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/* Hprof binary format enums and spec. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/* Need to #define or typedef HprofId before including this file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *    hprof used ObjectIndex or 4 bytes, but it can be 4 or 8 byte type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
/* -------------------------------------------------------------------- */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
/* -------------------------------------------------------------------- */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
/* -------------------------------------------------------------------- */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * hprof binary format: (result either written to a file or sent over
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * the network).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * WARNING: This format is still under development, and is subject to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * change without notice.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *  header    "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *  u4        size of identifiers. Identifiers are used to represent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *            UTF8 strings, objects, stack traces, etc. They usually
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *            have the same size as host pointers. For example, on
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *            Solaris and Win32, the size is 4.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * u4         high word
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * u4         low word    number of milliseconds since 0:00 GMT, 1/1/70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * [record]*  a sequence of records.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * Record format:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * u1         a TAG denoting the type of the record
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * u4         number of *microseconds* since the time stamp in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *            header. (wraps around in a little more than an hour)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * u4         number of bytes *remaining* in the record. Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *            this number excludes the tag and the length field itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * [u1]*      BODY of the record (a sequence of bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * The following TAGs are supported:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * TAG           BODY       notes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *----------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * HPROF_UTF8               a UTF8-encoded name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *               id         name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 *               [u1]*      UTF8 characters (no trailing zero)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * HPROF_LOAD_CLASS         a newly loaded class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 *                u4        class serial number (> 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 *                id        class object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *                u4        stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *                id        class name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * HPROF_UNLOAD_CLASS       an unloading class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 *                u4        class serial_number
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * HPROF_FRAME              a Java stack frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 *                id        stack frame ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 *                id        method name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 *                id        method signature ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *                id        source file name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 *                u4        class serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 *                i4        line number. >0: normal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 *                                       -1: unknown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 *                                       -2: compiled method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 *                                       -3: native method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * HPROF_TRACE              a Java stack trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 *               u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 *               u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 *               u4         number of frames
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 *               [id]*      stack frame IDs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * HPROF_ALLOC_SITES        a set of heap allocation sites, obtained after GC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *               u2         flags 0x0001: incremental vs. complete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *                                0x0002: sorted by allocation vs. live
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 *                                0x0004: whether to force a GC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *               u4         cutoff ratio
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 *               u4         total live bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 *               u4         total live instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 *               u8         total bytes allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 *               u8         total instances allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 *               u4         number of sites that follow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 *               [u1        is_array: 0:  normal object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 *                                    2:  object array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 *                                    4:  boolean array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 *                                    5:  char array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 *                                    6:  float array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 *                                    7:  double array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 *                                    8:  byte array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *                                    9:  short array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 *                                    10: int array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 *                                    11: long array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 *                u4        class serial number (may be zero during startup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 *                u4        stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 *                u4        number of bytes alive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 *                u4        number of instances alive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 *                u4        number of bytes allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 *                u4]*      number of instance allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * HPROF_START_THREAD       a newly started thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 *               u4         thread serial number (> 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *               id         thread object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 *               u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 *               id         thread name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 *               id         thread group name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 *               id         thread group parent name ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * HPROF_END_THREAD         a terminating thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 *               u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 * HPROF_HEAP_SUMMARY       heap summary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 *               u4         total live bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 *               u4         total live instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 *               u8         total bytes allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
 *               u8         total instances allocated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 * HPROF_HEAP_DUMP or HPROF_HEAP_DUMP_SEGMENT          denote a heap dump
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 *               [heap dump sub-records]*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 *                          There are four kinds of heap dump sub-records:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 *               u1         sub-record type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
 *               HPROF_GC_ROOT_UNKNOWN         unknown root
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
 *               HPROF_GC_ROOT_THREAD_OBJ      thread object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 *                          id         thread object ID  (may be 0 for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
 *                                     thread newly attached through JNI)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 *                          u4         thread sequence number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 *                          u4         stack trace sequence number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 *               HPROF_GC_ROOT_JNI_GLOBAL      JNI global ref root
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 *                          id         JNI global ref ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 *               HPROF_GC_ROOT_JNI_LOCAL       JNI local ref
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 *                          u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 *                          u4         frame # in stack trace (-1 for empty)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 *               HPROF_GC_ROOT_JAVA_FRAME      Java stack frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 *                          u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 *                          u4         frame # in stack trace (-1 for empty)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 *               HPROF_GC_ROOT_NATIVE_STACK    Native stack
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 *                          u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 *               HPROF_GC_ROOT_STICKY_CLASS    System class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 *               HPROF_GC_ROOT_THREAD_BLOCK    Reference from thread block
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 *                          u4         thread serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 *               HPROF_GC_ROOT_MONITOR_USED    Busy monitor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 *               HPROF_GC_CLASS_DUMP           dump of a class object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 *                          id         class object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 *                          u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 *                          id         super class object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 *                          id         class loader object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 *                          id         signers object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 *                          id         protection domain object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 *                          id         reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 *                          id         reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 *                          u4         instance size (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 *                          u2         size of constant pool
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 *                          [u2,       constant pool index,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 *                           ty,       type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 *                                     2:  object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 *                                     4:  boolean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 *                                     5:  char
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 *                                     6:  float
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *                                     7:  double
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 *                                     8:  byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 *                                     9:  short
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 *                                     10: int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 *                                     11: long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
 *                           vl]*      and value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 *                          u2         number of static fields
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 *                          [id,       static field name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 *                           ty,       type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 *                           vl]*      and value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 *                          u2         number of inst. fields (not inc. super)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 *                          [id,       instance field name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 *                           ty]*      type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
 *               HPROF_GC_INSTANCE_DUMP        dump of a normal object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
 *                          id         object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
 *                          u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
 *                          id         class object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
 *                          u4         number of bytes that follow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 *                          [vl]*      instance field values (class, followed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
 *                                     by super, super's super ...)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
 *               HPROF_GC_OBJ_ARRAY_DUMP       dump of an object array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
 *                          id         array object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
 *                          u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
 *                          u4         number of elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 *                          id         array class ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 *                          [id]*      elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
 *               HPROF_GC_PRIM_ARRAY_DUMP      dump of a primitive array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
 *                          id         array object ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
 *                          u4         stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
 *                          u4         number of elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
 *                          u1         element type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
 *                                     4:  boolean array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
 *                                     5:  char array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
 *                                     6:  float array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
 *                                     7:  double array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
 *                                     8:  byte array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
 *                                     9:  short array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
 *                                     10: int array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
 *                                     11: long array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
 *                          [u1]*      elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
 * HPROF_HEAP_DUMP_END      terminates series of heap dump segments
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
 * HPROF_CPU_SAMPLES        a set of sample traces of running threads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
 *                u4        total number of samples
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
 *                u4        # of traces
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
 *               [u4        # of samples
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
 *                u4]*      stack trace serial number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
 * HPROF_CONTROL_SETTINGS   the settings of on/off switches
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
 *                u4        0x00000001: alloc traces on/off
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
 *                          0x00000002: cpu sampling on/off
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
 *                u2        stack trace depth
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
typedef enum HprofTag {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    HPROF_UTF8                    = 0x01,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    HPROF_LOAD_CLASS              = 0x02,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    HPROF_UNLOAD_CLASS            = 0x03,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    HPROF_FRAME                   = 0x04,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    HPROF_TRACE                   = 0x05,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    HPROF_ALLOC_SITES             = 0x06,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    HPROF_HEAP_SUMMARY            = 0x07,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    HPROF_START_THREAD            = 0x0A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    HPROF_END_THREAD              = 0x0B,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    HPROF_HEAP_DUMP               = 0x0C,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    HPROF_HEAP_DUMP_SEGMENT       = 0x1C, /* 1.0.2 only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    HPROF_HEAP_DUMP_END           = 0x2C, /* 1.0.2 only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    HPROF_CPU_SAMPLES             = 0x0D,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    HPROF_CONTROL_SETTINGS        = 0x0E
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
} HprofTag;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
 * Heap dump constants
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
typedef enum HprofGcTag {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    HPROF_GC_ROOT_UNKNOWN       = 0xFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    HPROF_GC_ROOT_JNI_GLOBAL    = 0x01,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    HPROF_GC_ROOT_JNI_LOCAL     = 0x02,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    HPROF_GC_ROOT_JAVA_FRAME    = 0x03,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    HPROF_GC_ROOT_NATIVE_STACK  = 0x04,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    HPROF_GC_ROOT_STICKY_CLASS  = 0x05,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    HPROF_GC_ROOT_THREAD_BLOCK  = 0x06,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    HPROF_GC_ROOT_MONITOR_USED  = 0x07,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    HPROF_GC_ROOT_THREAD_OBJ    = 0x08,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    HPROF_GC_CLASS_DUMP         = 0x20,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    HPROF_GC_INSTANCE_DUMP      = 0x21,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    HPROF_GC_OBJ_ARRAY_DUMP     = 0x22,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    HPROF_GC_PRIM_ARRAY_DUMP    = 0x23
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
} HprofGcTag;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
enum HprofType {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        HPROF_ARRAY_OBJECT      = 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        HPROF_NORMAL_OBJECT     = 2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        HPROF_BOOLEAN           = 4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        HPROF_CHAR              = 5,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        HPROF_FLOAT             = 6,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        HPROF_DOUBLE            = 7,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        HPROF_BYTE              = 8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        HPROF_SHORT             = 9,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        HPROF_INT               = 10,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        HPROF_LONG              = 11
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
typedef unsigned char HprofType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
#define HPROF_TYPE_SIZES                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    {                                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        /*Object?*/     sizeof(HprofId),        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        /*Object?*/     sizeof(HprofId),        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        /*Array*/       sizeof(HprofId),        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        /*Object?*/     sizeof(HprofId),        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        /*jboolean*/    1,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        /*jchar*/       2,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        /*jfloat*/      4,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        /*jdouble*/     8,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        /*jbyte*/       1,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        /*jshort*/      2,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        /*jint*/        4,                      \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
        /*jlong*/       8                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
#define HPROF_TYPE_IS_PRIMITIVE(ty)  ((ty)>=HPROF_BOOLEAN)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
#endif