4141N/A<?
xml version="1.0" encoding="utf-8"?>
4141N/A Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4141N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4141N/A This code is free software; you can redistribute it and/or modify it 4141N/A under the terms of the GNU General Public License version 2 only, as 4141N/A published by the Free Software Foundation. 4141N/A This code is distributed in the hope that it will be useful, but WITHOUT 4141N/A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4141N/A FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4141N/A version 2 for more details (a copy is included in the LICENSE file that 4141N/A You should have received a copy of the GNU General Public License version 4141N/A 2 along with this work; if not, write to the Free Software Foundation, 4141N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4141N/A Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4141N/AContent types (complex) should create constant pool data 4141N/ACurrently at least, there is _NO_ verification that whatever 4141N/Awriter you have is actually writing correctly. So BE CAREFUL! 4141N/ADeclared with the 'content_type' tag. 4141N/A<type> is the ID type, i.e the integer type that resolves this. Most often 4141N/AU4 or U8, but for example really small number constants, like GCTYPE uses U1. 4141N/A<content-type> is where it gets interesting. 'builtin_type' means we're 4141N/Adefining how we resolve one of the trace built-in types (Class, Thread etc), 4141N/Ajvm_type means defining a new one for our own use. 4141N/A<content_type id="GCMode" hr_name="GC mode" type="U1" jvm_type="GCMODE"> 4141N/A <value type="UTF8" field="desc" description="Description"/> 4141N/AThis creates a content type CONTENT_TYPE_GCMODE 4141N/AThe field type referencing it is u1 (U1), and the constant pool struct has one field, the name. 4141N/ABefore we can use it we need also define a primary field data type: 4141N/A<primary_type symbol="GCMODE" datatype="U1" contenttype="NONE" 4141N/A type="u8" sizeop="sizeof(u1)"/> 4141N/ANow we can use the content + data type in declaring event fields. 4141N/ARemember however, that for us to be able to resolve the value later we must also add 4141N/Acreating the constant pool data in VM_JFRCheckpoint::write_checkpoint 4141N/A w->be_uint(CONTENT_TYPE_GCMODE); 4141N/A w->be_uint(MM_GC_MODE_UNINITIALIZED); 4141N/A for (i = 0; i < MM_GC_MODE_UNINITIALIZED; i++) { 4141N/A w->write_utf8(gcModeGetName(i)); 4141N/A <
content_type id="Thread" hr_name="Thread" 4141N/A type="U4" builtin_type="OSTHREAD">
4141N/A <
value type="UTF8" field="name" label="Thread name"/>
4141N/A <
content_type id="VMThread" hr_name="VM Thread" 4141N/A type="U8" jvm_type="VMTHREAD">
4141N/A <
value type="OSTHREAD" field="thread" label="VM Thread"/>
4141N/A <!-- The first argument ("JavaThread") is misleading, it's really a 4141N/A being "JavaThread" so it shouldn't be changed. 4141N/A <
content_type id="JavaThread" hr_name="Java thread" 4141N/A type="U8" builtin_type="JAVALANGTHREAD">
4141N/A <
value type="OSTHREAD" field="thread" label="OS Thread ID"/>
4141N/A <
value type="BYTES64" field="allocInsideTla" 4141N/A label="Allocated bytes inside TLAs"/>
4141N/A <
value type="BYTES64" field="allocOutsideTla" 4141N/A label="Allocated bytes outside TLAs"/>
4141N/A <
value type="THREADGROUP" field="group" label="Java Thread Group"/>
4141N/A <
content_type id="ThreadGroup" hr_name="Thread group" 4141N/A type="U4" jvm_type="THREADGROUP">
4141N/A <
value type="THREADGROUP" field="parent" label="Parent"/>
4141N/A <
value type="UTF8" field="name" label="Name"/>
4141N/A <
content_type id="StackTrace" hr_name="Stacktrace" 4141N/A type="U8" builtin_type="STACKTRACE">
4415N/A <
value type="BOOLEAN" field="truncated" label="Truncated"/>
4141N/A <
structarray type="StackFrame" field="frames" label="Stack frames"/>
4141N/A <
content_type id="Class" hr_name="Java class" 4141N/A type="U8" builtin_type="CLASS">
4141N/A <
value type="CLASS" field="loaderClass" label="ClassLoader"/>
4141N/A <
value type="SYMBOL" field="name" label="Name"/>
4141N/A <
value type="SHORT" field="modifiers" label="Access modifiers"/>
4141N/A <
content_type id="Method" hr_name="Java method" 4141N/A type="U8" jvm_type="METHOD">
4141N/A <
value type="CLASS" field="class" label="Class"/>
4141N/A <
value type="SYMBOL" field="name" label="Name"/>
4141N/A <
value type="SYMBOL" field="signature" label="Signature"/>
4141N/A <
value type="SHORT" field="modifiers" label="Access modifiers"/>
4141N/A <
content_type id="UTFConstant" hr_name="UTF constant" 4141N/A type="U8" jvm_type="SYMBOL">
4141N/A <
value type="UTF8" field="utf8" label="UTF8 data"/>
4141N/A <
content_type id="ThreadState" hr_name="Java Thread State" 4141N/A type="U2" jvm_type="THREADSTATE">
4141N/A <
value type="UTF8" field="name" label="Name"/>
4141N/A <
content_type id="FrameType" hr_name="Frame type" 4141N/A type="U1" jvm_type="FRAMETYPE">
4141N/A <
value type="UTF8" field="desc" label="Description"/>
4141N/A <
struct_type id="StackFrame">
4141N/A <
value type="METHOD" field="method" label="Java Method"/>
4141N/A <
value type="INTEGER" field="line" label="Line number"/>
4141N/A <
value type="FRAMETYPE" field="type" label="Frame type"/>
4141N/A <
content_type id="GCName" hr_name="GC Name" 4141N/A type="U1" jvm_type="GCNAME">
4141N/A <
value type="UTF8" field="name" label="name" />
4141N/A <
content_type id="GCCause" hr_name="GC Cause" 4141N/A type="U2" jvm_type="GCCAUSE">
4141N/A <
value type="UTF8" field="cause" label="cause" />
4141N/A <
content_type id="GCWhen" hr_name="GC When" 4141N/A type="U1" jvm_type="GCWHEN">
4141N/A <
value type="UTF8" field="when" label="when" />
4141N/A <
content_type id="G1YCType" hr_name="G1 YC Type" 4141N/A type="U1" jvm_type="G1YCTYPE">
4141N/A <
value type="UTF8" field="type" label="type" />
4141N/A <
content_type id="ReferenceType" hr_name="Reference Type" 4141N/A type="U1" jvm_type="REFERENCETYPE">
4141N/A <
value type="UTF8" field="type" label="type" />
4141N/A <
content_type id="NARROW_OOP_MODE" hr_name="Narrow Oop Mode" 4141N/A type="U1" jvm_type="NARROWOOPMODE">
4141N/A <
value type="UTF8" field="mode" label="mode" />
4141N/A <
content_type id="VMOperationType" hr_name="VM Operation Type" 4141N/A type="U2" jvm_type="VMOPERATIONTYPE">
4141N/A <
value type="UTF8" field="type" label="type" />
4141N/A <
content_type id="CompilerPhaseType" hr_name="Compiler Phase Type" 4141N/A type="U1" jvm_type="COMPILERPHASETYPE">
4141N/A <
value type="UTF8" field="phase" label="phase" />
4141N/A - primary_type takes these attributes: 4141N/A - datatype The trace datatype, see enum DataType 4141N/A - contenttype Either resolved content type or the semantic meaning 4141N/A - type The actual type as used in structures etc 4141N/A - struct value of type "type" and yield the factual byte 4141N/A - size we need to write. The % is replaced by the value 4141N/A <
primary_type symbol="LONG" datatype="LONG" contenttype="NONE" 4141N/A type="s8" sizeop="sizeof(s8)"/>
4141N/A <
primary_type symbol="ULONG" datatype="U8" contenttype="NONE" 4141N/A type="u8" sizeop="sizeof(u8)"/>
4141N/A <
primary_type symbol="INTEGER" datatype="INT" contenttype="NONE" 4141N/A type="s4" sizeop="sizeof(s4)"/>
4141N/A <
primary_type symbol="UINT" datatype="U4" contenttype="NONE" 4141N/A type="unsigned" sizeop="sizeof(unsigned)"/>
4141N/A <
primary_type symbol="USHORT" datatype="U2" contenttype="NONE" 4141N/A type="u2" sizeop="sizeof(u2)"/>
4141N/A <
primary_type symbol="SHORT" datatype="SHORT" contenttype="NONE" 4141N/A type="s2" sizeop="sizeof(s2)"/>
4141N/A <
primary_type symbol="BYTE" datatype="BYTE" contenttype="NONE" 4141N/A type="s1" sizeop="sizeof(s1)"/>
4141N/A <
primary_type symbol="UBYTE" datatype="U1" contenttype="NONE" 4141N/A type="u1" sizeop="sizeof(u1)"/>
4141N/A <
primary_type symbol="FLOAT" datatype="FLOAT" contenttype="NONE" 4141N/A type="float" sizeop="sizeof(float)"/>
4141N/A <
primary_type symbol="DOUBLE" datatype="DOUBLE" contenttype="NONE" 4141N/A type="double" sizeop="sizeof(double)"/>
4141N/A <!-- boolean type (1-byte) --> 4141N/A <
primary_type symbol="BOOLEAN" datatype="BOOLEAN" contenttype="NONE" 4141N/A <!-- 32-bit unsigned integer, SEMANTIC value BYTES --> 4141N/A <
primary_type symbol="BYTES" datatype="U4" contenttype="BYTES" 4141N/A type="u4" sizeop="sizeof(u4)"/>
4141N/A <
primary_type symbol="IOBYTES" datatype="U4" contenttype="BYTES" 4141N/A type="u4" sizeop="sizeof(u4)"/>
4141N/A <!-- 64-bit unsigned integer, SEMANTIC value BYTES --> 4141N/A <
primary_type symbol="BYTES64" datatype="U8" contenttype="BYTES" 4141N/A type="u8" sizeop="sizeof(u8)"/>
4141N/A <!-- 64-bit unsigned integer, SEMANTIC value ABSOLUTE MILLISECONDS --> 4141N/A <
primary_type symbol="EPOCHMILLIS" datatype="LONG" contenttype="EPOCHMILLIS" 4141N/A type="s8" sizeop="sizeof(s8)"/>
4141N/A <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE MILLISECONDS --> 4141N/A <
primary_type symbol="MILLIS" datatype="LONG" contenttype="MILLIS" 4141N/A type="s8" sizeop="sizeof(s8)"/>
4141N/A <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE NANOSECONDS --> 4141N/A <
primary_type symbol="NANOS" datatype="LONG" contenttype="NANOS" 4141N/A type="s8" sizeop="sizeof(s8)"/>
4177N/A <!-- 64-bit signed integer, SEMANTIC value ABSOLUTE TICKS --> 4141N/A <
primary_type symbol="TICKS" datatype="LONG" contenttype="TICKS" 4141N/A type="s8" sizeop="sizeof(s8)"/>
4177N/A <!-- 64-bit signed integer, SEMANTIC value RELATIVE TICKS --> 4177N/A <
primary_type symbol="RELATIVE_TICKS" datatype="LONG" contenttype="TICKS" 4177N/A type="s8" sizeop="sizeof(s8)"/>
4141N/A <!-- 64-bit unsigned integer, SEMANTIC value ADDRESS (mem loc) --> 4141N/A <
primary_type symbol="ADDRESS" datatype="U8" contenttype="ADDRESS" 4141N/A type="u8" sizeop="sizeof(u8)"/>
4141N/A <!-- 32-bit float, SEMANTIC value PERCENTAGE (0.0-1.0) --> 4141N/A <
primary_type symbol="PERCENT" datatype="FLOAT" contenttype="PERCENTAGE" 4141N/A type="float" sizeop="sizeof(float)"/>
4141N/A <!-- UTF-encoded string, max length 64k --> 4141N/A <
primary_type symbol="UTF8" datatype="UTF8" contenttype="NONE" 4141N/A type="const char *" sizeop="sizeof_utf(%)"/>
4141N/A <!-- Symbol* constant. Note that this may currently ONLY be used by 4141N/A classes, methods fields. This restriction might be lifted. --> 4141N/A <
primary_type symbol="SYMBOL" datatype="U8" contenttype="SYMBOL" 4141N/A type="Symbol *" sizeop="sizeof(u8)"/>
4141N/A <!-- A klassOop *. The actual class is marked as "used" and will 4141N/A eventually be written into the recording constant pool --> 4141N/A <
primary_type symbol="CLASS" datatype="U8" contenttype="CLASS" 4141N/A type="klassOop" sizeop="sizeof(u8)"/>
4141N/A <!-- A methodOop *. The method is marked as "used" and will eventually be 4141N/A written into the recording constant pool. --> 4141N/A <
primary_type symbol="METHOD" datatype="U8" contenttype="METHOD" 4141N/A type="methodOop" sizeop="sizeof(u8)"/>
4141N/A <!-- The type for stacktraces in the recording. Shoudl not be used by 4141N/A <
primary_type symbol="STACKTRACE" datatype="U8" contenttype="STACKTRACE" 4141N/A type="u8" sizeop="sizeof(u8)"/>
4141N/A <
primary_type symbol="OSTHREAD" datatype="U4" contenttype="OSTHREAD" 4141N/A type="u4" sizeop="sizeof(u4)"/>
4141N/A <!-- VM Thread ID Note: changed from U2 to U8 for hotspot --> 4141N/A <
primary_type symbol="VMTHREAD" datatype="U8" contenttype="VMTHREAD" 4141N/A type="u8" sizeop="sizeof(u8)"/>
4141N/A <
primary_type symbol="JAVALANGTHREAD" datatype="LONG" 4141N/A contenttype="JAVALANGTHREAD" type="s8" 4141N/A <!-- Threadgroup THIS TYPE MAY NOT BE USED IN NORMAL EVENTS (ATM). Only 4141N/A for thread constant pool // KK TODO: u8 should be ObjectP --> 4141N/A <
primary_type symbol="THREADGROUP" datatype="U4" contenttype="THREADGROUP" 4141N/A <
primary_type symbol="FRAMETYPE" datatype="U1" contenttype="FRAMETYPE" 4141N/A type="u1" sizeop="sizeof(u1)"/>
4141N/A <
primary_type symbol="THREADSTATE" datatype="U2" contenttype="THREADSTATE" 4141N/A type="u2" sizeop="sizeof(u2)"/>
4141N/A <
primary_type symbol="GCNAME" datatype="U1" contenttype="GCNAME" 4141N/A type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="GCCAUSE" datatype="U2" contenttype="GCCAUSE" 4141N/A type="u2" sizeop="sizeof(u2)" />
4141N/A <
primary_type symbol="GCWHEN" datatype="U1" contenttype="GCWHEN" 4141N/A type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="G1YCTYPE" datatype="U1" contenttype="G1YCTYPE" 4141N/A type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="REFERENCETYPE" datatype="U1" 4141N/A contenttype="REFERENCETYPE" type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="NARROWOOPMODE" datatype="U1" 4141N/A contenttype="NARROWOOPMODE" type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="COMPILERPHASETYPE" datatype="U1" 4141N/A contenttype="COMPILERPHASETYPE" type="u1" sizeop="sizeof(u1)" />
4141N/A <
primary_type symbol="VMOPERATIONTYPE" datatype="U2" contenttype="VMOPERATIONTYPE" 4141N/A type="u2" sizeop="sizeof(u2)" />