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 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="PACKAGE" field="package" label="Package"/> 69 <value type="INTEGER" field="modifiers" label="Access Modifiers"/> 70 </content_type> 71 72 <content_type id="ClassLoader" hr_name="Java Class Loader" 73 type="U8" jvm_type="CLASSLOADER"> 74 <value type="CLASS" field="type" label="Type"/> 75 <value type="SYMBOL" field="name" label="Name"/> 76 </content_type> 77 78 <content_type id="Method" hr_name="Java Method" 79 type="U8" jvm_type="METHOD"> 80 <value type="CLASS" field="type" label="Type"/> 81 <value type="SYMBOL" field="name" label="Name"/> 82 <value type="SYMBOL" field="descriptor" label="Descriptor"/> 83 <value type="INTEGER" field="modifiers" label="Access Modifiers"/> 84 <value type="BOOLEAN" field="hidden" label="Hidden"/> 85 </content_type> 86 87 <content_type id="Symbol" hr_name="Symbol" 88 type="U8" jvm_type="SYMBOL"> 89 <value type="STRING" field="string" label="String"/> 90 </content_type> 91 92 <content_type id="ThreadState" hr_name="Java Thread State" 93 type="U8" jvm_type="THREADSTATE"> 94 <value type="STRING" field="name" label="Name"/> 95 </content_type> 96 97 <content_type id="GCName" hr_name="GC Name" 98 type="U8" jvm_type="GCNAME"> 99 <value type="STRING" field="name" label="Name" /> 100 </content_type> 101 102 <content_type id="GCCause" hr_name="GC Cause" 103 type="U8" jvm_type="GCCAUSE"> 104 <value type="STRING" field="cause" label="Cause" /> 105 </content_type> 106 107 <content_type id="GCWhen" hr_name="GC When" 108 type="U8" jvm_type="GCWHEN"> 109 <value type="STRING" field="when" label="When" /> 110 </content_type> 111 112 <content_type id="G1HeapRegionType" hr_name="G1 Heap Region Type" 113 type="U8" jvm_type="G1HEAPREGIONTYPE"> 114 <value type="STRING" field="type" label="Type" /> 115 </content_type> 116 117 <content_type id="G1YCType" hr_name="G1 YC Type" 118 type="U8" jvm_type="G1YCTYPE"> 119 <value type="STRING" field="type" label="Type" /> 120 </content_type> 121 122 <content_type id="GCThresholdUpdater" hr_name="GC Threshold Updater" 123 type="U8" jvm_type="GCTHRESHOLDUPDATER"> 124 <value type="STRING" field="updater" label="Updater" /> 125 </content_type> 126 127 <content_type id="ReferenceType" hr_name="Reference Type" 128 type="U8" jvm_type="REFERENCETYPE"> 129 <value type="STRING" field="type" label="Type" /> 130 </content_type> 131 132 <content_type id="MetadataType" hr_name="Metadata Type" 133 type="U8" jvm_type="METADATATYPE"> 134 <value type="STRING" field="type" label="Type" /> 135 </content_type> 136 137 <content_type id="MetaspaceObjectType" hr_name="Metaspace Object Type" 138 type="U8" jvm_type="METASPACEOBJTYPE"> 139 <value type="STRING" field="type" label="Type" /> 140 </content_type> 141 142 <content_type id="NarrowOopMode" hr_name="Narrow Oop Mode" 143 type="U8" jvm_type="NARROWOOPMODE"> 144 <value type="STRING" field="mode" label="Mode" /> 145 </content_type> 146 147 <content_type id="VMOperationType" hr_name="VM Operation Type" 148 type="U8" jvm_type="VMOPERATIONTYPE"> 149 <value type="STRING" field="type" label="Type" /> 150 </content_type> 151 152 <content_type id="CompilerPhaseType" hr_name="Compiler Phase Type" 153 type="U8" jvm_type="COMPILERPHASETYPE"> 154 <value type="STRING" field="phase" label="Phase" /> 155 </content_type> 156 157 <content_type id="FlagValueOrigin" hr_name="Flag Value Origin" 158 type="U8" jvm_type="FLAGVALUEORIGIN"> 159 <value type="STRING" field="origin" label="Origin" /> 160 </content_type> 161 162 <content_type id="CodeBlobType" hr_name="Code Blob Type" 163 type="U8" jvm_type="CODEBLOBTYPE"> 164 <value type="STRING" field="type" label="Type" /> 165 </content_type> 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 --> 263 <primary_type symbol="ULONG" datatype="U8" contenttype="NONE" 264 type="u8" sizeop="sizeof(u8)"/> 265 266 <!-- SIGNED 32bit --> 267 <primary_type symbol="INTEGER" datatype="INT" contenttype="NONE" 268 type="s4" sizeop="sizeof(s4)"/> 269 270 <!-- UNSIGNED 32bit --> 271 <primary_type symbol="UINT" datatype="U4" contenttype="NONE" 272 type="unsigned" sizeop="sizeof(unsigned)"/> 273 274 <!-- UNSIGNED 16bit --> 275 <primary_type symbol="USHORT" datatype="U2" contenttype="NONE" 276 type="u2" sizeop="sizeof(u2)"/> 277 278 <!-- SIGNED 16bit --> 279 <primary_type symbol="SHORT" datatype="SHORT" contenttype="NONE" 280 type="s2" sizeop="sizeof(s2)"/> 281 282 <!-- SIGNED 8bit --> 283 <primary_type symbol="BYTE" datatype="BYTE" contenttype="NONE" 284 type="s1" sizeop="sizeof(s1)"/> 285 286 <!-- UNSIGNED 8bit --> 287 <primary_type symbol="UBYTE" datatype="U1" contenttype="NONE" 288 type="u1" sizeop="sizeof(u1)"/> 289 290 <!-- float 32bit --> 291 <primary_type symbol="FLOAT" datatype="FLOAT" contenttype="NONE" 292 type="float" sizeop="sizeof(float)"/> 293 294 <!-- float 64bit --> 295 <primary_type symbol="DOUBLE" datatype="DOUBLE" contenttype="NONE" 296 type="double" sizeop="sizeof(double)"/> 297 298 <!-- boolean type (1-byte) --> 299 <primary_type symbol="BOOLEAN" datatype="BOOLEAN" contenttype="NONE" 300 type="bool" sizeop="1"/> 301 302 <!-- 32-bit unsigned integer, SEMANTIC value BYTES --> 303 <primary_type symbol="BYTES" datatype="U8" contenttype="BYTES" 304 type="u8" sizeop="sizeof(u8)"/> 305 306 <primary_type symbol="IOBYTES" datatype="U8" contenttype="BYTES" 307 type="u8" sizeop="sizeof(u8)"/> 308 309 <!-- 64-bit unsigned integer, SEMANTIC value BYTES --> 310 <primary_type symbol="BYTES64" datatype="U8" contenttype="BYTES" 311 type="u8" sizeop="sizeof(u8)"/> 312 313 <!-- 64-bit unsigned integer, SEMANTIC value ABSOLUTE MILLISECONDS --> 314 <primary_type symbol="EPOCHMILLIS" datatype="LONG" contenttype="EPOCHMILLIS" 315 type="s8" sizeop="sizeof(s8)"/> 316 317 <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE MILLISECONDS --> 318 <primary_type symbol="MILLIS" datatype="LONG" contenttype="MILLIS" 319 type="s8" sizeop="sizeof(s8)"/> 320 321 <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE NANOSECONDS --> 322 <primary_type symbol="NANOS" datatype="LONG" contenttype="NANOS" 323 type="s8" sizeop="sizeof(s8)"/> 324 325 <!-- 64-bit signed integer, SEMANTIC value TICKS --> 326 <primary_type symbol="TICKS" datatype="LONG" contenttype="TICKS" 327 type="Ticks" sizeop="sizeof(s8)"/> 328 329 <!-- 64-bit signed integer, SEMANTIC value TICKS duration --> 330 <primary_type symbol="TICKSPAN" datatype="LONG" contenttype="TICKS" 331 type="Tickspan" sizeop="sizeof(s8)"/> 332 333 <!-- 64-bit unsigned integer, SEMANTIC value ADDRESS (mem loc) --> 334 <primary_type symbol="ADDRESS" datatype="U8" contenttype="ADDRESS" 335 type="u8" sizeop="sizeof(u8)"/> 336 337 <!-- 32-bit float, SEMANTIC value PERCENTAGE (0.0-1.0) --> 338 <primary_type symbol="PERCENTAGE" datatype="FLOAT" contenttype="PERCENTAGE" 339 type="float" sizeop="sizeof(float)"/> 340 341 <!-- STRING is a virtual type - depending on encoding 342 it will have polymorphic content --> 343 <primary_type symbol="STRING" datatype="STRING" contenttype="NONE" 344 type="const char*" sizeop="sizeof_utf(%)"/> 345 346 <!-- Symbol* constant. Note that this may currently ONLY be used by 347 classes, methods fields. This restriction might be lifted. --> 348 <primary_type symbol="SYMBOL" datatype="U8" contenttype="SYMBOL" 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 400 <!-- G1HEAPREGIONTYPE --> 401 <primary_type symbol="G1HEAPREGIONTYPE" datatype="U8" contenttype="G1HEAPREGIONTYPE" 402 type="u8" sizeop="sizeof(u8)" /> 403 404 <!-- G1YCType --> 405 <primary_type symbol="G1YCTYPE" datatype="U8" contenttype="G1YCTYPE" 406 type="u8" sizeop="sizeof(u8)" /> 407 408 <!-- GCTHRESHOLDUPDATER --> 409 <primary_type symbol="GCTHRESHOLDUPDATER" datatype="U8" contenttype="GCTHRESHOLDUPDATER" 410 type="u8" sizeop="sizeof(u8)" /> 411 412 <!-- REFERENCETYPE --> 413 <primary_type symbol="REFERENCETYPE" datatype="U8" contenttype="REFERENCETYPE" 414 type="u8" sizeop="sizeof(u8)" /> 415 416 <!-- METADATATYPE --> 417 <primary_type symbol="METADATATYPE" datatype="U8" contenttype="METADATATYPE" 418 type="u8" sizeop="sizeof(u8)" /> 419 420 <!-- METADATAOBJTYPE --> 421 <primary_type symbol="METASPACEOBJTYPE" datatype="U8" contenttype="METASPACEOBJTYPE" 422 type="u8" sizeop="sizeof(u8)" /> 423 424 <!-- NARROWOOPMODE --> 425 <primary_type symbol="NARROWOOPMODE" datatype="U8" contenttype="NARROWOOPMODE" 426 type="u8" sizeop="sizeof(u8)" /> 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>