< prev index next >

src/hotspot/share/trace/tracetypes.xml

Print this page
rev 49619 : JEP 328 : Flight Recorder open source preview
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <!--
   3  Copyright (c) 2012, 2016, 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 <!--
  28 
  29 Content types (complex) should create constant pool data
  30 in the recording.
  31 Currently at least, there is _NO_ verification that whatever
  32 writer you have is actually writing correctly. So BE CAREFUL!
  33 
  34 Declared with the 'content_type' tag.
  35 
  36 <type> is the ID type, i.e the integer type that resolves this. Most often
  37 U4 or U8, but for example really small number constants, like GCTYPE uses U1.
  38 
  39 <content-type> is where it gets interesting. 'builtin_type' means we're
  40 defining how we resolve one of the trace built-in types (Class, Thread etc),
  41 jvm_type means defining a new one for our own use.
  42 
  43 Example: (GcMode)
  44 
  45 <content_type id="GCMode" hr_name="GC mode" type="U1" jvm_type="GCMODE">
  46   <value type="STRING" field="desc" description="Description"/>
  47 </content_type>
  48 
  49 This creates a content type CONTENT_TYPE_GCMODE
  50 The field type referencing it is u1 (U1), and the constant pool struct has one field, the name.
  51 
  52 Before we can use it we need also define a primary field data type:
  53 
  54 <primary_type symbol="GCMODE" datatype="U1" contenttype="NONE"
  55               type="u8" sizeop="sizeof(u1)"/>
  56 
  57 Now we can use the content + data type in declaring event fields.
  58  -->
  59 
  60  <types>
  61   <content_types>
  62     <content_type id="Thread" hr_name="Thread"
  63                   type="U8" builtin_type="THREAD">
  64       <value type="STRING" field="osName" label="OS Thread Name"/>
  65       <value type="LONG" field="osThreadId" label="OS Thread Id"/>
  66       <value type="STRING" field="javaName" label="Java Thread Name"/>
  67       <value type="LONG" field="javaThreadId" label="Java Thread Id"/>
  68       <value type="THREADGROUP" field="group" label="Java Thread Group"/>
  69     </content_type>
  70 
  71     <content_type id="ThreadGroup" hr_name="Thread Group"
  72                   type="U8" jvm_type="THREADGROUP">
  73       <value type="THREADGROUP" field="parent" label="Parent"/>
  74       <value type="STRING" field="name" label="Name"/>
  75     </content_type>
  76 


 179 
 180     <content_type id="InflateCause" hr_name="Inflation Cause"
 181                   type="U8" jvm_type="INFLATECAUSE">
 182       <value type="STRING" field="cause" label="Cause" />
 183     </content_type>
 184 
 185     <content_type id="Module" hr_name="Module"
 186                   type="U8" jvm_type="MODULE">
 187       <value type="SYMBOL" field="name" label="Name"/>
 188       <value type="SYMBOL" field="version" label="Version"/>
 189       <value type="SYMBOL" field="location" label="Location"/>
 190       <value type="CLASSLOADER" field="classLoader" label="Class Loader"/>
 191     </content_type>
 192 
 193     <content_type id="Package" hr_name="Package"
 194                   type="U8" jvm_type="PACKAGE">
 195       <value type="SYMBOL" field="name" label="Name"/>
 196       <value type="MODULE" field="module" label="Module"/>
 197       <value type="BOOLEAN" field="exported" label="Exported"/>
 198     </content_type>

























































 199   </content_types>
 200 
 201 
 202   <primary_types>
 203     <!--
 204       - primary_type takes these attributes:
 205       -   symbol      INTEGER, LONG etc
 206       -   datatype    The trace datatype, see enum DataType
 207       -   contenttype Either resolved content type or the semantic meaning
 208       -   type        The actual type as used in structures etc
 209       -   sizeop      A function/macro that can be applied on a single
 210       -               struct value of type "type" and yield the factual byte
 211       -               size we need to write.  The % is replaced by the value
 212       -->
 213 
 214     <!-- SIGNED 64bit -->
 215     <primary_type symbol="LONG" datatype="LONG" contenttype="NONE"
 216                   type="s8" sizeop="sizeof(s8)"/>
 217 
 218     <!-- UNSIGNED 64bit -->


 305                   type="const Symbol*" sizeop="sizeof(u8)"/>
 306 
 307     <!-- A Klass *. The actual class is marked as "used" and will
 308          eventually be written into the recording constant pool -->
 309     <primary_type symbol="CLASS" datatype="U8" contenttype="CLASS"
 310                   type="const Klass*" sizeop="sizeof(u8)"/>
 311 
 312     <primary_type symbol="CLASSLOADER" datatype="U8" contenttype="CLASSLOADER"
 313               type="const ClassLoaderData*" sizeop="sizeof(u8)"/>
 314 
 315     <primary_type symbol="MODULE" datatype="U8" contenttype="MODULE"
 316                   type="const ModuleEntry*" sizeop="sizeof(u8)"/>
 317 
 318     <primary_type symbol="PACKAGE" datatype="U8" contenttype="PACKAGE"
 319                   type="const PackageEntry*" sizeop="sizeof(u8)"/>
 320 
 321     <!-- A Method *. The method is marked as "used" and will eventually be
 322          written into the recording constant pool. -->
 323     <primary_type symbol="METHOD" datatype="U8" contenttype="METHOD"
 324                   type="const Method*" sizeop="sizeof(u8)"/>
 325 
 326     <!--  The type for stacktraces in the recording. Shoudl not be used by
 327           events explicitly -->
 328     <primary_type symbol="STACKTRACE" datatype="U8" contenttype="STACKTRACE"
 329                   type="u8" sizeop="sizeof(u8)"/>
 330 
 331     <!-- Thread ID -->
 332     <primary_type symbol="THREAD" datatype="U8" contenttype="THREAD"
 333                   type="u8" sizeop="sizeof(u8)"/>
 334 
 335     <!-- Threadgroup THIS TYPE MAY NOT BE USED IN NORMAL EVENTS (ATM). Only
 336           for thread constant pool // KK TODO: u8 should be ObjectP -->
 337     <primary_type symbol="THREADGROUP" datatype="U8" contenttype="THREADGROUP"
 338                   type="u8" sizeop="sizeof(u8)"/>
 339 
 340     <!-- FRAMETYPE enum -->
 341     <primary_type symbol="FRAMETYPE" datatype="U8" contenttype="FRAMETYPE"
 342                   type="u8" sizeop="sizeof(u8)"/>
 343 
 344     <!-- THREADSTATE enum -->
 345     <primary_type symbol="THREADSTATE" datatype="U8" contenttype="THREADSTATE"
 346                   type="u8" sizeop="sizeof(u8)"/>
 347 
 348     <!-- GCName -->
 349     <primary_type symbol="GCNAME" datatype="U8" contenttype="GCNAME"
 350                   type="u8" sizeop="sizeof(u8)" />
 351 
 352     <!-- GCCAUSE -->
 353     <primary_type symbol="GCCAUSE" datatype="U8" contenttype="GCCAUSE"
 354                   type="u8" sizeop="sizeof(u8)" />
 355 
 356     <!-- GCWHEN -->
 357     <primary_type symbol="GCWHEN" datatype="U8" contenttype="GCWHEN"
 358                   type="u8" sizeop="sizeof(u8)" />
 359 


 387 
 388     <!-- COMPILERPHASETYPE -->
 389     <primary_type symbol="COMPILERPHASETYPE" datatype="U8" contenttype="COMPILERPHASETYPE"
 390                   type="u8" sizeop="sizeof(u8)" />
 391 
 392     <!-- VMOPERATIONTYPE -->
 393     <primary_type symbol="VMOPERATIONTYPE" datatype="U8" contenttype="VMOPERATIONTYPE"
 394                   type="u8" sizeop="sizeof(u8)" />
 395                   
 396     <!-- FLAGVALUEORIGIN -->
 397     <primary_type symbol="FLAGVALUEORIGIN" datatype="U8" contenttype="FLAGVALUEORIGIN"
 398                   type="u8" sizeop="sizeof(u8)" />
 399                   
 400     <!-- CODEBLOBTYPE -->
 401     <primary_type symbol="CODEBLOBTYPE" datatype="U8" contenttype="CODEBLOBTYPE"
 402                   type="u8" sizeop="sizeof(u8)" />
 403 
 404     <!-- INFLATECAUSE -->
 405     <primary_type symbol="INFLATECAUSE" datatype="U8" contenttype="INFLATECAUSE"
 406                   type="u8" sizeop="sizeof(u8)" />










 407   </primary_types>
 408 </types>
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <!--
   3  Copyright (c) 2012, 2018, 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 


 166 
 167     <content_type id="InflateCause" hr_name="Inflation Cause"
 168                   type="U8" jvm_type="INFLATECAUSE">
 169       <value type="STRING" field="cause" label="Cause" />
 170     </content_type>
 171 
 172     <content_type id="Module" hr_name="Module"
 173                   type="U8" jvm_type="MODULE">
 174       <value type="SYMBOL" field="name" label="Name"/>
 175       <value type="SYMBOL" field="version" label="Version"/>
 176       <value type="SYMBOL" field="location" label="Location"/>
 177       <value type="CLASSLOADER" field="classLoader" label="Class Loader"/>
 178     </content_type>
 179 
 180     <content_type id="Package" hr_name="Package"
 181                   type="U8" jvm_type="PACKAGE">
 182       <value type="SYMBOL" field="name" label="Name"/>
 183       <value type="MODULE" field="module" label="Module"/>
 184       <value type="BOOLEAN" field="exported" label="Exported"/>
 185     </content_type>
 186 
 187      <content_type id="StackTrace" hr_name="Stacktrace"
 188                   type="U8" builtin_type="STACKTRACE">
 189       <value type="BOOLEAN" field="truncated" label="Truncated"/>
 190       <structarray type="StackFrame" field="frames" label="Stack Frames"/>
 191     </content_type>
 192 
 193     <content_type id="FrameType" hr_name="Frame type"
 194                   type="U8" jvm_type="FRAMETYPE">
 195       <value type="STRING" field="description" label="Description"/>
 196     </content_type>
 197 
 198     <content_type id="OldObjectRootSystem" hr_name="GC Root System" type="U8" jvm_type="OLDOBJECTROOTSYSTEM">
 199       <value type="STRING" field="system" label="System"/>
 200     </content_type>
 201 
 202     <content_type id="OldObjectRootType" hr_name="GC Root Type" type="U8" jvm_type="OLDOBJECTROOTTYPE">
 203       <value type="STRING" field="type" label="Type"/>
 204     </content_type>
 205 
 206     <content_type id="OldObjectGcRoot" hr_name="GC Root" type="U8" jvm_type="OLDOBJECTGCROOT">
 207       <value type="STRING" field="description" label="Root Description" description="Root information"/>
 208       <value type="OLDOBJECTROOTSYSTEM" field="system" label="System" description="The subsystem of origin for the root"/>
 209       <value type="OLDOBJECTROOTTYPE" field="type" label="Type" description="The root type"/>
 210     </content_type>
 211 
 212     <content_type id="OldObjectArray" hr_name="Old Object Array" type="U8" jvm_type="OLDOBJECTARRAY">
 213       <value type="INTEGER" field="size" label="Array Size" description="Size of array"/>
 214       <value type="INTEGER" field="index" label="Index" description="Index in the array"/>
 215     </content_type>
 216 
 217     <content_type id="OldObjectField" hr_name="Old Object Field" type="U8" jvm_type="OLDOBJECTFIELD">
 218       <value type="STRING" field="name" label="Field" description="Name of field"/>
 219       <value type="SHORT" field="modifiers" label="Field Modifiers" description="Field modifiers"/>
 220     </content_type>
 221 
 222     <content_type id="OldObject" hr_name="Old Object" type="U8" jvm_type="OLDOBJECT">
 223       <value type="ADDRESS" field="address" label="Memory Address"/>
 224       <value type="CLASS" field="type" label="Java Class"/>
 225       <value type="STRING" field="description" label="Object Description" description="Object description"/>
 226       <value type="REFERENCE" field="referrer" label="Referrer Object"  description="Object referencing this object"/>
 227     </content_type>
 228 
 229     <content_type id="Reference" hr_name="Reference" type="U8" jvm_type="REFERENCE">
 230       <value type="OLDOBJECTARRAY" field="array" label="Array Information" description="Array or null if it is not an array"/>
 231       <value type="OLDOBJECTFIELD" field="field" label="Field Information" description="Field or null if it is an array"/>
 232       <value type="OLDOBJECT" field="object" label="Object" description="Object holder for this reference"/>
 233       <value type="INTEGER" field="skip" label="Skip value" description="The object is this many hops away"/>
 234     </content_type>
 235 
 236     <struct_type id="StackFrame">
 237       <value type="METHOD" field="method" label="Java Method"/>
 238       <value type="INTEGER" field="lineNumber" label="Line Number"/>
 239       <value type="INTEGER" field="bytecodeIndex" label="Bytecode Index"/>
 240       <value type="FRAMETYPE" field="type" label="Frame Type"/>
 241     </struct_type>
 242 
 243   </content_types>
 244 
 245 
 246   <primary_types>
 247     <!--
 248       - primary_type takes these attributes:
 249       -   symbol      INTEGER, LONG etc
 250       -   datatype    The trace datatype, see enum DataType
 251       -   contenttype Either resolved content type or the semantic meaning
 252       -   type        The actual type as used in structures etc
 253       -   sizeop      A function/macro that can be applied on a single
 254       -               struct value of type "type" and yield the factual byte
 255       -               size we need to write.  The % is replaced by the value
 256       -->
 257 
 258     <!-- SIGNED 64bit -->
 259     <primary_type symbol="LONG" datatype="LONG" contenttype="NONE"
 260                   type="s8" sizeop="sizeof(s8)"/>
 261 
 262     <!-- UNSIGNED 64bit -->


 349                   type="const Symbol*" sizeop="sizeof(u8)"/>
 350 
 351     <!-- A Klass *. The actual class is marked as "used" and will
 352          eventually be written into the recording constant pool -->
 353     <primary_type symbol="CLASS" datatype="U8" contenttype="CLASS"
 354                   type="const Klass*" sizeop="sizeof(u8)"/>
 355 
 356     <primary_type symbol="CLASSLOADER" datatype="U8" contenttype="CLASSLOADER"
 357               type="const ClassLoaderData*" sizeop="sizeof(u8)"/>
 358 
 359     <primary_type symbol="MODULE" datatype="U8" contenttype="MODULE"
 360                   type="const ModuleEntry*" sizeop="sizeof(u8)"/>
 361 
 362     <primary_type symbol="PACKAGE" datatype="U8" contenttype="PACKAGE"
 363                   type="const PackageEntry*" sizeop="sizeof(u8)"/>
 364 
 365     <!-- A Method *. The method is marked as "used" and will eventually be
 366          written into the recording constant pool. -->
 367     <primary_type symbol="METHOD" datatype="U8" contenttype="METHOD"
 368                   type="const Method*" sizeop="sizeof(u8)"/>
 369     <!--  The type for stacktraces in the recording. Should not be used by

 370           events explicitly -->
 371     <primary_type symbol="STACKTRACE" datatype="U8" contenttype="STACKTRACE"
 372                   type="u8" sizeop="sizeof(u8)"/>
 373 
 374     <!-- Thread ID -->
 375     <primary_type symbol="THREAD" datatype="U8" contenttype="THREAD"
 376                   type="u8" sizeop="sizeof(u8)"/>
 377     <!-- Threadgroup. Only for thread constant pool -->


 378     <primary_type symbol="THREADGROUP" datatype="U8" contenttype="THREADGROUP"
 379                   type="u8" sizeop="sizeof(u8)"/>

 380     <!-- FRAMETYPE enum -->
 381     <primary_type symbol="FRAMETYPE" datatype="U8" contenttype="FRAMETYPE"
 382                   type="u8" sizeop="sizeof(u8)"/>
 383 
 384     <!-- THREADSTATE enum -->
 385     <primary_type symbol="THREADSTATE" datatype="U8" contenttype="THREADSTATE"
 386                   type="u8" sizeop="sizeof(u8)"/>
 387 
 388     <!-- GCName -->
 389     <primary_type symbol="GCNAME" datatype="U8" contenttype="GCNAME"
 390                   type="u8" sizeop="sizeof(u8)" />
 391 
 392     <!-- GCCAUSE -->
 393     <primary_type symbol="GCCAUSE" datatype="U8" contenttype="GCCAUSE"
 394                   type="u8" sizeop="sizeof(u8)" />
 395 
 396     <!-- GCWHEN -->
 397     <primary_type symbol="GCWHEN" datatype="U8" contenttype="GCWHEN"
 398                   type="u8" sizeop="sizeof(u8)" />
 399 


 427 
 428     <!-- COMPILERPHASETYPE -->
 429     <primary_type symbol="COMPILERPHASETYPE" datatype="U8" contenttype="COMPILERPHASETYPE"
 430                   type="u8" sizeop="sizeof(u8)" />
 431 
 432     <!-- VMOPERATIONTYPE -->
 433     <primary_type symbol="VMOPERATIONTYPE" datatype="U8" contenttype="VMOPERATIONTYPE"
 434                   type="u8" sizeop="sizeof(u8)" />
 435                   
 436     <!-- FLAGVALUEORIGIN -->
 437     <primary_type symbol="FLAGVALUEORIGIN" datatype="U8" contenttype="FLAGVALUEORIGIN"
 438                   type="u8" sizeop="sizeof(u8)" />
 439                   
 440     <!-- CODEBLOBTYPE -->
 441     <primary_type symbol="CODEBLOBTYPE" datatype="U8" contenttype="CODEBLOBTYPE"
 442                   type="u8" sizeop="sizeof(u8)" />
 443 
 444     <!-- INFLATECAUSE -->
 445     <primary_type symbol="INFLATECAUSE" datatype="U8" contenttype="INFLATECAUSE"
 446                   type="u8" sizeop="sizeof(u8)" />
 447 
 448    <!-- THESE TYPES MAY NOT BE USED IN NORMAL EVENTS -->
 449     <primary_type symbol="OLDOBJECTROOTSYSTEM" datatype="U8" contenttype="OLDOBJECTROOTSYSTEM" type="u8" sizeop="sizeof(u8)"/>
 450     <primary_type symbol="OLDOBJECTROOTTYPE" datatype="U8" contenttype="OLDOBJECTROOTTYPE" type="u8" sizeop="sizeof(u8)"/>
 451     <primary_type symbol="OLDOBJECTGCROOT" datatype="U8" contenttype="OLDOBJECTGCROOT" type="u8" sizeop="sizeof(u8)"/>
 452     <primary_type symbol="OLDOBJECTARRAY" datatype="U8" contenttype="OLDOBJECTARRAY" type="u8" sizeop="sizeof(u8)"/>
 453     <primary_type symbol="OLDOBJECTFIELD" datatype="U8" contenttype="OLDOBJECTFIELD" type="u8" sizeop="sizeof(u8)"/>
 454     <primary_type symbol="OLDOBJECT" datatype="U8" contenttype="OLDOBJECT" type="u8" sizeop="sizeof(u8)"/>
 455     <primary_type symbol="REFERENCE" datatype="U8" contenttype="REFERENCE" type="u8" sizeop="sizeof(u8)"/>
 456 
 457   </primary_types>
 458 </types>
< prev index next >