Fri, 10 Jul 2009 11:10:00 -0700
6857194: Add hotspot perf counters to aid class loading performance measurement
Summary: Add new jvmstat counters to measure detailed class loading time
Reviewed-by: acorn, kamg
1 <?xml version="1.0"?>
2 <!--
3 Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved.
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
20 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 CA 95054 USA or visit www.sun.com if you need additional information or
22 have any questions.
24 -->
26 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
28 <xsl:import href="jvmtiLib.xsl"/>
30 <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
32 <xsl:template match="/">
33 <xsl:apply-templates select="specification"/>
34 </xsl:template>
36 <xsl:template match="specification">
37 <xsl:call-template name="sourceHeader"/>
38 <xsl:text>
39 # include "incls/_precompiled.incl"
40 # include "incls/_jvmtiEnv.cpp.incl"
42 // end file prefix - do not modify or remove this line
43 </xsl:text>
44 <xsl:apply-templates select="functionsection"/>
45 </xsl:template>
47 <xsl:template match="functionsection">
48 <xsl:apply-templates select="category"/>
49 </xsl:template>
51 <xsl:template match="category">
52 <xsl:text>
53 //
54 // </xsl:text><xsl:value-of select="@label"/><xsl:text> functions
55 //
56 </xsl:text>
57 <xsl:apply-templates select="function[not(contains(@impl,'unimpl'))]"/>
58 </xsl:template>
60 <xsl:template match="function">
61 <xsl:apply-templates select="parameters" mode="advice"/>
62 <xsl:text>
63 jvmtiError
64 JvmtiEnv::</xsl:text>
65 <xsl:if test="count(@hide)=1">
66 <xsl:value-of select="@hide"/>
67 </xsl:if>
68 <xsl:value-of select="@id"/>
69 <xsl:text>(</xsl:text>
70 <xsl:apply-templates select="parameters" mode="HotSpotSig"/>
71 <xsl:text>) {</xsl:text>
72 <xsl:for-each select="parameters/param/jclass">
73 <xsl:if test="count(@method|@field)=0">
74 <xsl:text>
75 if (java_lang_Class::is_primitive(k_mirror)) {
76 // DO PRIMITIVE CLASS PROCESSING
77 return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
78 }
79 klassOop k_oop = java_lang_Class::as_klassOop(k_mirror);
80 if (k_oop == NULL) {
81 return JVMTI_ERROR_INVALID_CLASS;
82 }</xsl:text>
83 </xsl:if>
84 </xsl:for-each>
85 <xsl:text>
86 return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
87 } /* end </xsl:text>
88 <xsl:if test="count(@hide)=1">
89 <xsl:value-of select="@hide"/>
90 </xsl:if>
91 <xsl:value-of select="@id"/>
92 <xsl:text> */
94 </xsl:text>
95 </xsl:template>
98 <!-- ======== ADVICE ======== -->
100 <xsl:template match="parameters" mode="advice">
101 <xsl:apply-templates select="param" mode="advice"/>
102 </xsl:template>
104 <xsl:template match="param" mode="advice">
105 <xsl:apply-templates select="child::*[position()=1]" mode="advice">
106 <xsl:with-param name="name" select="@id"/>
107 </xsl:apply-templates>
108 </xsl:template>
110 <xsl:template match="jthread" mode="advice">
111 <xsl:param name="name"/>
112 <xsl:choose>
113 <xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
114 <xsl:text>
115 // Threads_lock NOT held, java_thread not protected by lock
116 // java_thread - pre-checked</xsl:text>
117 </xsl:when>
118 <xsl:otherwise>
119 <xsl:text>
120 // Threads_lock NOT held
121 // </xsl:text>
122 <xsl:value-of select="$name"/>
123 <xsl:text> - NOT pre-checked</xsl:text>
124 </xsl:otherwise>
125 </xsl:choose>
126 </xsl:template>
128 <xsl:template match="jrawMonitorID" mode="advice">
129 <xsl:param name="name"/>
130 <xsl:text>
131 // rmonitor - pre-checked for validity</xsl:text>
132 </xsl:template>
134 <xsl:template match="jframeID" mode="advice">
135 <xsl:param name="name"/>
136 <xsl:text>
137 // java_thread - unchecked
138 // depth - pre-checked as non-negative</xsl:text>
139 </xsl:template>
141 <xsl:template match="jmethodID" mode="advice">
142 <xsl:param name="name"/>
143 <xsl:text>
144 // method_oop - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>
145 </xsl:template>
147 <xsl:template match="jfieldID" mode="advice">
148 <xsl:param name="name"/>
149 </xsl:template>
151 <xsl:template match="jclass" mode="advice">
152 <xsl:param name="name"/>
153 <!--
154 classes passed as part of a class/method or class/field pair are used
155 by the wrapper to get the internal type but are not needed by nor
156 passed to the implementation layer.
157 -->
158 <xsl:if test="count(@method|@field)=0">
159 <xsl:text>
160 // k_mirror - may be primitive, this must be checked</xsl:text>
161 </xsl:if>
162 </xsl:template>
164 <xsl:template match="nullok" mode="advice">
165 </xsl:template>
167 <xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice">
168 <xsl:param name="name"/>
169 <xsl:choose>
170 <xsl:when test="count(nullok)=0">
171 <xsl:text>
172 // </xsl:text>
173 <xsl:value-of select="$name"/>
174 <xsl:text> - pre-checked for NULL</xsl:text>
175 </xsl:when>
176 <xsl:otherwise>
177 <xsl:text>
178 // </xsl:text>
179 <xsl:value-of select="$name"/>
180 <xsl:text> - NULL is a valid value, must be checked</xsl:text>
181 </xsl:otherwise>
182 </xsl:choose>
183 </xsl:template>
185 <xsl:template match="jint" mode="advice">
186 <xsl:param name="name"/>
187 <xsl:if test="count(@min)=1">
188 <xsl:text>
189 // </xsl:text>
190 <xsl:value-of select="$name"/>
191 <xsl:text> - pre-checked to be greater than or equal to </xsl:text>
192 <xsl:value-of select="@min"/>
193 </xsl:if>
194 </xsl:template>
196 <xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice">
197 <xsl:param name="name"/>
198 </xsl:template>
200 </xsl:stylesheet>