1 <?xml version="1.0" encoding="utf-8"?>
   2 <!--
   3  Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
   4  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 
   6  This code is free software; you can redistribute it and/or modify it
   7  under the terms of the GNU General Public License version 2 only, as
   8  published by the Free Software Foundation.
   9 
  10  This code is distributed in the hope that it will be useful, but WITHOUT
  11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  version 2 for more details (a copy is included in the LICENSE file that
  14  accompanied this code).
  15 
  16  You should have received a copy of the GNU General Public License version
  17  2 along with this work; if not, write to the Free Software Foundation,
  18  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19 
  20  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  or visit www.oracle.com if you need additional information or have any
  22  questions.
  23 -->
  24 
  25 <!DOCTYPE types SYSTEM "trace.dtd">
  26 <!--
  27 Content types (complex) should create constant pool data in the recording.
  28 Currently at least, there is _NO_ verification that whatever
  29 writer you have is actually writing correctly. So BE CAREFUL!
  30 Declared with the 'content_type' tag.
  31 <type> is the ID type (u8), i.e the integer type that resolves this.
  32 <content-type> is where it gets interesting. 'builtin_type' means we're
  33 defining how we resolve one of the trace built-in types (Class, Thread etc),
  34 jvm_type means defining a new one for our own use.
  35 Example: (GcMode)
  36 <content_type id="GCMode" hr_name="GC mode" type="U8" jvm_type="GCMODE">
  37   <value type="STRING" field="name" description="Description"/>
  38 </content_type>
  39 This creates a content type CONTENT_TYPE_GCMODE
  40 The field type referencing it is u8, and the constant pool struct has one field, the name.
  41 Before we can use it we need also define a primary field data type:
  42 <primary_type symbol="GCMODE" datatype="U8" contenttype="NONE"
  43               type="u8" sizeop="sizeof(u8)"/>
  44 Now we can use the content + data type in declaring event fields.
  45  -->
  46 
  47  <types>
  48   <content_types>
  49     <content_type id="Thread" hr_name="Thread"
  50                   type="U8" builtin_type="THREAD">
  51       <value type="STRING" field="osName" label="OS Thread Name"/>
  52       <value type="LONG" field="osThreadId" label="OS Thread Id"/>
  53       <value type="STRING" field="javaName" label="Java Thread Name"/>
  54       <value type="LONG" field="javaThreadId" label="Java Thread Id"/>
  55       <value type="THREADGROUP" field="group" label="Java Thread Group"/>
  56     </content_type>
  57 
  58     <content_type id="ThreadGroup" hr_name="Thread Group"
  59                   type="U8" jvm_type="THREADGROUP">
  60       <value type="THREADGROUP" field="parent" label="Parent"/>
  61       <value type="STRING" field="name" label="Name"/>
  62     </content_type>
  63 
  64     <content_type id="Class" hr_name="Java Class"
  65                   type="U8" builtin_type="CLASS">
  66       <value type="CLASSLOADER" field="classLoader" label="Class Loader"/>
  67       <value type="SYMBOL" field="name" label="Name"/>
  68       <value type="INTEGER" field="modifiers" label="Access Modifiers"/>
  69     </content_type>
  70 
  71     <content_type id="ClassLoader" hr_name="Java Class Loader"
  72                   type="U8" jvm_type="CLASSLOADER">
  73       <value type="CLASS" field="type" label="Type"/>
  74       <value type="SYMBOL" field="name" label="Name"/>
  75     </content_type>
  76 
  77     <content_type id="Method" hr_name="Java Method"
  78                   type="U8" jvm_type="METHOD">
  79       <value type="CLASS" field="type" label="Type"/>
  80       <value type="SYMBOL" field="name" label="Name"/>
  81       <value type="SYMBOL" field="descriptor" label="Descriptor"/>
  82       <value type="INTEGER" field="modifiers" label="Access Modifiers"/>
  83       <value type="BOOLEAN" field="hidden" label="Hidden"/>
  84     </content_type>
  85 
  86     <content_type id="Symbol" hr_name="Symbol"
  87                   type="U8" jvm_type="SYMBOL">
  88       <value type="STRING" field="string" label="String"/>
  89     </content_type>
  90 
  91     <content_type id="ThreadState" hr_name="Java Thread State"
  92                   type="U8" jvm_type="THREADSTATE">
  93       <value type="STRING" field="name" label="Name"/>
  94     </content_type>
  95 
  96     <content_type id="GCName" hr_name="GC Name"
  97                   type="U8" jvm_type="GCNAME">
  98       <value type="STRING" field="name" label="Name" />
  99     </content_type>
 100 
 101     <content_type id="GCCause" hr_name="GC Cause"
 102                   type="U8" jvm_type="GCCAUSE">
 103       <value type="STRING" field="cause" label="Cause" />
 104     </content_type>
 105 
 106     <content_type id="GCWhen" hr_name="GC When"
 107                   type="U8" jvm_type="GCWHEN">
 108       <value type="STRING" field="when" label="When" />
 109     </content_type>
 110 
 111     <content_type id="G1HeapRegionType" hr_name="G1 Heap Region Type"
 112                   type="U8" jvm_type="G1HEAPREGIONTYPE">
 113       <value type="STRING" field="type" label="Type" />
 114     </content_type>
 115     
 116     <content_type id="G1YCType" hr_name="G1 YC Type"
 117                   type="U8" jvm_type="G1YCTYPE">
 118       <value type="STRING" field="type" label="Type" />
 119     </content_type>
 120 
 121     <content_type id="GCThresholdUpdater" hr_name="GC Threshold Updater"
 122                   type="U8" jvm_type="GCTHRESHOLDUPDATER">
 123       <value type="STRING" field="updater" label="Updater" />
 124     </content_type>
 125 
 126     <content_type id="ReferenceType" hr_name="Reference Type"
 127                   type="U8" jvm_type="REFERENCETYPE">
 128       <value type="STRING" field="type" label="Type" />
 129     </content_type>
 130 
 131     <content_type id="MetadataType" hr_name="Metadata Type"
 132                   type="U8" jvm_type="METADATATYPE">
 133       <value type="STRING" field="type" label="Type" />
 134     </content_type>
 135 
 136     <content_type id="MetaspaceObjectType" hr_name="Metaspace Object Type"
 137                   type="U8" jvm_type="METASPACEOBJTYPE">
 138       <value type="STRING" field="type" label="Type" />
 139     </content_type>
 140 
 141     <content_type id="NarrowOopMode" hr_name="Narrow Oop Mode"
 142                   type="U8" jvm_type="NARROWOOPMODE">
 143       <value type="STRING" field="mode" label="Mode" />
 144     </content_type>
 145 
 146     <content_type id="VMOperationType" hr_name="VM Operation Type"
 147                   type="U8" jvm_type="VMOPERATIONTYPE">
 148       <value type="STRING" field="type" label="Type" />
 149     </content_type>
 150 
 151     <content_type id="CompilerPhaseType" hr_name="Compiler Phase Type"
 152                   type="U8" jvm_type="COMPILERPHASETYPE">
 153       <value type="STRING" field="phase" label="Phase" />
 154     </content_type>
 155 
 156     <content_type id="FlagValueOrigin" hr_name="Flag Value Origin"
 157                   type="U8" jvm_type="FLAGVALUEORIGIN">
 158       <value type="STRING" field="origin" label="Origin" />
 159     </content_type>
 160 
 161     <content_type id="CodeBlobType" hr_name="Code Blob Type"
 162                   type="U8" jvm_type="CODEBLOBTYPE">
 163       <value type="STRING" field="type" label="Type" />
 164     </content_type>
 165 
 166     <content_type id="InflateCause" hr_name="Inflation Cause"
 167                   type="U8" jvm_type="INFLATECAUSE">
 168       <value type="STRING" field="cause" label="Cause" />
 169     </content_type>
 170 
 171      <content_type id="StackTrace" hr_name="Stacktrace"
 172                   type="U8" builtin_type="STACKTRACE">
 173       <value type="BOOLEAN" field="truncated" label="Truncated"/>
 174       <structarray type="StackFrame" field="frames" label="Stack Frames"/>
 175     </content_type>
 176 
 177     <content_type id="FrameType" hr_name="Frame type"
 178                   type="U8" jvm_type="FRAMETYPE">
 179       <value type="STRING" field="description" label="Description"/>
 180     </content_type>
 181 
 182     <content_type id="OldObjectRootSystem" hr_name="GC Root System" type="U8" jvm_type="OLDOBJECTROOTSYSTEM">
 183       <value type="STRING" field="system" label="System"/>
 184     </content_type>
 185 
 186     <content_type id="OldObjectRootType" hr_name="GC Root Type" type="U8" jvm_type="OLDOBJECTROOTTYPE">
 187       <value type="STRING" field="type" label="Type"/>
 188     </content_type>
 189 
 190     <content_type id="OldObjectGcRoot" hr_name="GC Root" type="U8" jvm_type="OLDOBJECTGCROOT">
 191       <value type="STRING" field="description" label="Root Description" description="Root information"/>
 192       <value type="OLDOBJECTROOTSYSTEM" field="system" label="System" description="The subsystem of origin for the root"/>
 193       <value type="OLDOBJECTROOTTYPE" field="type" label="Type" description="The root type"/>
 194     </content_type>
 195 
 196     <content_type id="OldObjectArray" hr_name="Old Object Array" type="U8" jvm_type="OLDOBJECTARRAY">
 197       <value type="INTEGER" field="size" label="Array Size" description="Size of array"/>
 198       <value type="INTEGER" field="index" label="Index" description="Index in the array"/>
 199     </content_type>
 200 
 201     <content_type id="OldObjectField" hr_name="Old Object Field" type="U8" jvm_type="OLDOBJECTFIELD">
 202       <value type="STRING" field="name" label="Field" description="Name of field"/>
 203       <value type="SHORT" field="modifiers" label="Field Modifiers" description="Field modifiers"/>
 204     </content_type>
 205 
 206     <content_type id="OldObject" hr_name="Old Object" type="U8" jvm_type="OLDOBJECT">
 207       <value type="ADDRESS" field="address" label="Memory Address"/>
 208       <value type="CLASS" field="type" label="Java Class"/>
 209       <value type="STRING" field="description" label="Object Description" description="Object description"/>
 210       <value type="REFERENCE" field="referrer" label="Referrer Object"  description="Object referencing this object"/>
 211     </content_type>
 212 
 213     <content_type id="Reference" hr_name="Reference" type="U8" jvm_type="REFERENCE">
 214       <value type="OLDOBJECTARRAY" field="array" label="Array Information" description="Array or null if it is not an array"/>
 215       <value type="OLDOBJECTFIELD" field="field" label="Field Information" description="Field or null if it is an array"/>
 216       <value type="OLDOBJECT" field="object" label="Object" description="Object holder for this reference"/>
 217       <value type="INTEGER" field="skip" label="Skip value" description="The object is this many hops away"/>
 218     </content_type>
 219 
 220     <struct_type id="StackFrame">
 221       <value type="METHOD" field="method" label="Java Method"/>
 222       <value type="INTEGER" field="lineNumber" label="Line Number"/>
 223       <value type="INTEGER" field="bytecodeIndex" label="Bytecode Index"/>
 224       <value type="FRAMETYPE" field="type" label="Frame Type"/>
 225     </struct_type>
 226 
 227   </content_types>
 228 
 229 
 230   <primary_types>
 231     <!--
 232       - primary_type takes these attributes:
 233       -   symbol      INTEGER, LONG etc
 234       -   datatype    The trace datatype, see enum DataType
 235       -   contenttype Either resolved content type or the semantic meaning
 236       -   type        The actual type as used in structures etc
 237       -   sizeop      A function/macro that can be applied on a single
 238       -               struct value of type "type" and yield the factual byte
 239       -               size we need to write.  The % is replaced by the value
 240       -->
 241 
 242     <!-- SIGNED 64bit -->
 243     <primary_type symbol="LONG" datatype="LONG" contenttype="NONE"
 244                   type="s8" sizeop="sizeof(s8)"/>
 245 
 246     <!-- UNSIGNED 64bit -->
 247     <primary_type symbol="ULONG" datatype="U8" contenttype="NONE"
 248                   type="u8" sizeop="sizeof(u8)"/>
 249 
 250     <!-- SIGNED 32bit -->
 251     <primary_type symbol="INTEGER" datatype="INT" contenttype="NONE"
 252                   type="s4" sizeop="sizeof(s4)"/>
 253 
 254     <!-- UNSIGNED 32bit -->
 255     <primary_type symbol="UINT" datatype="U4" contenttype="NONE"
 256                   type="unsigned" sizeop="sizeof(unsigned)"/>
 257 
 258     <!-- UNSIGNED 16bit -->
 259     <primary_type symbol="USHORT" datatype="U2" contenttype="NONE"
 260                   type="u2" sizeop="sizeof(u2)"/>
 261 
 262     <!--  SIGNED 16bit -->
 263     <primary_type symbol="SHORT" datatype="SHORT" contenttype="NONE"
 264                   type="s2" sizeop="sizeof(s2)"/>
 265 
 266     <!--  SIGNED 8bit -->
 267     <primary_type symbol="BYTE" datatype="BYTE" contenttype="NONE"
 268                   type="s1" sizeop="sizeof(s1)"/>
 269 
 270     <!--  UNSIGNED 8bit -->
 271     <primary_type symbol="UBYTE" datatype="U1" contenttype="NONE"
 272                   type="u1" sizeop="sizeof(u1)"/>
 273 
 274     <!--  float 32bit -->
 275     <primary_type symbol="FLOAT" datatype="FLOAT" contenttype="NONE"
 276                   type="float" sizeop="sizeof(float)"/>
 277 
 278     <!--  float 64bit -->
 279     <primary_type symbol="DOUBLE" datatype="DOUBLE" contenttype="NONE"
 280                   type="double" sizeop="sizeof(double)"/>
 281 
 282     <!-- boolean type (1-byte) -->
 283     <primary_type symbol="BOOLEAN" datatype="BOOLEAN" contenttype="NONE"
 284                   type="bool" sizeop="1"/>
 285 
 286     <!-- 32-bit unsigned integer, SEMANTIC value BYTES -->
 287     <primary_type symbol="BYTES" datatype="U8" contenttype="BYTES"
 288                   type="u8" sizeop="sizeof(u8)"/>
 289 
 290     <primary_type symbol="IOBYTES" datatype="U8" contenttype="BYTES"
 291                   type="u8" sizeop="sizeof(u8)"/>
 292 
 293     <!-- 64-bit unsigned integer, SEMANTIC value BYTES -->
 294     <primary_type symbol="BYTES64" datatype="U8" contenttype="BYTES"
 295                   type="u8" sizeop="sizeof(u8)"/>
 296 
 297     <!-- 64-bit unsigned integer, SEMANTIC value ABSOLUTE MILLISECONDS -->
 298     <primary_type symbol="EPOCHMILLIS" datatype="LONG" contenttype="EPOCHMILLIS"
 299                   type="s8" sizeop="sizeof(s8)"/>
 300 
 301     <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE MILLISECONDS -->
 302     <primary_type symbol="MILLIS" datatype="LONG" contenttype="MILLIS"
 303                   type="s8" sizeop="sizeof(s8)"/>
 304 
 305     <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE NANOSECONDS -->
 306     <primary_type symbol="NANOS" datatype="LONG" contenttype="NANOS"
 307                   type="s8" sizeop="sizeof(s8)"/>
 308 
 309     <!-- 64-bit signed integer, SEMANTIC value TICKS -->
 310     <primary_type symbol="TICKS" datatype="LONG" contenttype="TICKS"
 311                   type="Ticks" sizeop="sizeof(s8)"/>
 312 
 313     <!-- 64-bit signed integer, SEMANTIC value TICKS duration -->
 314     <primary_type symbol="TICKSPAN" datatype="LONG" contenttype="TICKS"
 315                   type="Tickspan" sizeop="sizeof(s8)"/>
 316 
 317     <!-- 64-bit unsigned integer, SEMANTIC value ADDRESS (mem loc) -->
 318     <primary_type symbol="ADDRESS" datatype="U8" contenttype="ADDRESS"
 319                   type="u8" sizeop="sizeof(u8)"/>
 320 
 321     <!-- 32-bit float, SEMANTIC value PERCENTAGE (0.0-1.0) -->
 322     <primary_type symbol="PERCENTAGE" datatype="FLOAT" contenttype="PERCENTAGE"
 323                   type="float" sizeop="sizeof(float)"/>
 324 
 325     <!-- STRING is a virtual type - depending on encoding
 326          it will have polymorphic content -->
 327     <primary_type symbol="STRING" datatype="STRING" contenttype="NONE"
 328                   type="const char*" sizeop="sizeof_utf(%)"/>
 329 
 330     <!-- Symbol* constant. Note that this may currently ONLY be used by
 331           classes, methods fields.  This restriction might be lifted. -->
 332     <primary_type symbol="SYMBOL" datatype="U8" contenttype="SYMBOL"
 333                   type="const Symbol*" sizeop="sizeof(u8)"/>
 334 
 335     <!-- A Klass *. The actual class is marked as "used" and will
 336          eventually be written into the recording constant pool -->
 337     <primary_type symbol="CLASS" datatype="U8" contenttype="CLASS"
 338                   type="const Klass*" sizeop="sizeof(u8)"/>
 339 
 340     <primary_type symbol="CLASSLOADER" datatype="U8" contenttype="CLASSLOADER"
 341               type="const ClassLoaderData*" sizeop="sizeof(u8)"/>
 342 
 343     <!-- A Method *. The method is marked as "used" and will eventually be
 344          written into the recording constant pool. -->
 345     <primary_type symbol="METHOD" datatype="U8" contenttype="METHOD"
 346                   type="const Method*" sizeop="sizeof(u8)"/>
 347     <!--  The type for stacktraces in the recording. Should not be used by
 348           events explicitly -->
 349     <primary_type symbol="STACKTRACE" datatype="U8" contenttype="STACKTRACE"
 350                   type="u8" sizeop="sizeof(u8)"/>
 351 
 352     <!-- Thread ID -->
 353     <primary_type symbol="THREAD" datatype="U8" contenttype="THREAD"
 354                   type="u8" sizeop="sizeof(u8)"/>
 355     <!-- Threadgroup. Only for thread constant pool -->
 356     <primary_type symbol="THREADGROUP" datatype="U8" contenttype="THREADGROUP"
 357                   type="u8" sizeop="sizeof(u8)"/>
 358     <!-- FRAMETYPE enum -->
 359     <primary_type symbol="FRAMETYPE" datatype="U8" contenttype="FRAMETYPE"
 360                   type="u8" sizeop="sizeof(u8)"/>
 361 
 362     <!-- THREADSTATE enum -->
 363     <primary_type symbol="THREADSTATE" datatype="U8" contenttype="THREADSTATE"
 364                   type="u8" sizeop="sizeof(u8)"/>
 365 
 366     <!-- GCName -->
 367     <primary_type symbol="GCNAME" datatype="U8" contenttype="GCNAME"
 368                   type="u8" sizeop="sizeof(u8)" />
 369 
 370     <!-- GCCAUSE -->
 371     <primary_type symbol="GCCAUSE" datatype="U8" contenttype="GCCAUSE"
 372                   type="u8" sizeop="sizeof(u8)" />
 373 
 374     <!-- GCWHEN -->
 375     <primary_type symbol="GCWHEN" datatype="U8" contenttype="GCWHEN"
 376                   type="u8" sizeop="sizeof(u8)" />
 377 
 378     <!-- G1HEAPREGIONTYPE -->
 379     <primary_type symbol="G1HEAPREGIONTYPE" datatype="U8" contenttype="G1HEAPREGIONTYPE"
 380                   type="u8" sizeop="sizeof(u8)" />
 381 
 382     <!-- G1YCType -->
 383     <primary_type symbol="G1YCTYPE" datatype="U8" contenttype="G1YCTYPE"
 384                   type="u8" sizeop="sizeof(u8)" />
 385 
 386     <!-- GCTHRESHOLDUPDATER -->
 387     <primary_type symbol="GCTHRESHOLDUPDATER" datatype="U8" contenttype="GCTHRESHOLDUPDATER"
 388                   type="u8" sizeop="sizeof(u8)" />
 389 
 390     <!-- REFERENCETYPE -->
 391     <primary_type symbol="REFERENCETYPE" datatype="U8" contenttype="REFERENCETYPE"
 392                   type="u8" sizeop="sizeof(u8)" />
 393 
 394     <!-- METADATATYPE -->
 395     <primary_type symbol="METADATATYPE" datatype="U8" contenttype="METADATATYPE"
 396                   type="u8" sizeop="sizeof(u8)" />
 397 
 398     <!-- METADATAOBJTYPE -->
 399     <primary_type symbol="METASPACEOBJTYPE" datatype="U8" contenttype="METASPACEOBJTYPE"
 400                   type="u8" sizeop="sizeof(u8)" />
 401 
 402     <!-- NARROWOOPMODE -->
 403     <primary_type symbol="NARROWOOPMODE" datatype="U8" contenttype="NARROWOOPMODE"
 404                   type="u8" sizeop="sizeof(u8)" />
 405 
 406     <!-- COMPILERPHASETYPE -->
 407     <primary_type symbol="COMPILERPHASETYPE" datatype="U8" contenttype="COMPILERPHASETYPE"
 408                   type="u8" sizeop="sizeof(u8)" />
 409 
 410     <!-- VMOPERATIONTYPE -->
 411     <primary_type symbol="VMOPERATIONTYPE" datatype="U8" contenttype="VMOPERATIONTYPE"
 412                   type="u8" sizeop="sizeof(u8)" />
 413                   
 414     <!-- FLAGVALUEORIGIN -->
 415     <primary_type symbol="FLAGVALUEORIGIN" datatype="U8" contenttype="FLAGVALUEORIGIN"
 416                   type="u8" sizeop="sizeof(u8)" />
 417                   
 418     <!-- CODEBLOBTYPE -->
 419     <primary_type symbol="CODEBLOBTYPE" datatype="U8" contenttype="CODEBLOBTYPE"
 420                   type="u8" sizeop="sizeof(u8)" />
 421 
 422     <!-- INFLATECAUSE -->
 423     <primary_type symbol="INFLATECAUSE" datatype="U8" contenttype="INFLATECAUSE"
 424                   type="u8" sizeop="sizeof(u8)" />
 425 
 426    <!-- THESE TYPES MAY NOT BE USED IN NORMAL EVENTS -->
 427     <primary_type symbol="OLDOBJECTROOTSYSTEM" datatype="U8" contenttype="OLDOBJECTROOTSYSTEM" type="u8" sizeop="sizeof(u8)"/>
 428     <primary_type symbol="OLDOBJECTROOTTYPE" datatype="U8" contenttype="OLDOBJECTROOTTYPE" type="u8" sizeop="sizeof(u8)"/>
 429     <primary_type symbol="OLDOBJECTGCROOT" datatype="U8" contenttype="OLDOBJECTGCROOT" type="u8" sizeop="sizeof(u8)"/>
 430     <primary_type symbol="OLDOBJECTARRAY" datatype="U8" contenttype="OLDOBJECTARRAY" type="u8" sizeop="sizeof(u8)"/>
 431     <primary_type symbol="OLDOBJECTFIELD" datatype="U8" contenttype="OLDOBJECTFIELD" type="u8" sizeop="sizeof(u8)"/>
 432     <primary_type symbol="OLDOBJECT" datatype="U8" contenttype="OLDOBJECT" type="u8" sizeop="sizeof(u8)"/>
 433     <primary_type symbol="REFERENCE" datatype="U8" contenttype="REFERENCE" type="u8" sizeop="sizeof(u8)"/>
 434 
 435   </primary_types>
 436 </types>