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
duke@435 | 1 | <?xml version="1.0"?> |
duke@435 | 2 | <!-- |
duke@435 | 3 | Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 4 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 5 | |
duke@435 | 6 | This code is free software; you can redistribute it and/or modify it |
duke@435 | 7 | under the terms of the GNU General Public License version 2 only, as |
duke@435 | 8 | published by the Free Software Foundation. |
duke@435 | 9 | |
duke@435 | 10 | This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 13 | version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 14 | accompanied this code). |
duke@435 | 15 | |
duke@435 | 16 | You should have received a copy of the GNU General Public License version |
duke@435 | 17 | 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 19 | |
duke@435 | 20 | Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 21 | CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 22 | have any questions. |
duke@435 | 23 | |
duke@435 | 24 | --> |
duke@435 | 25 | |
duke@435 | 26 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
duke@435 | 27 | |
duke@435 | 28 | <xsl:import href="jvmtiLib.xsl"/> |
duke@435 | 29 | |
duke@435 | 30 | <xsl:output method="text" indent="no" omit-xml-declaration="yes"/> |
duke@435 | 31 | |
duke@435 | 32 | <xsl:template match="/"> |
duke@435 | 33 | <xsl:apply-templates select="specification"/> |
duke@435 | 34 | </xsl:template> |
duke@435 | 35 | |
duke@435 | 36 | <xsl:template match="specification"> |
duke@435 | 37 | <xsl:call-template name="sourceHeader"/> |
duke@435 | 38 | <xsl:text> |
duke@435 | 39 | # include "incls/_precompiled.incl" |
duke@435 | 40 | # include "incls/_jvmtiEnv.cpp.incl" |
duke@435 | 41 | |
duke@435 | 42 | // end file prefix - do not modify or remove this line |
duke@435 | 43 | </xsl:text> |
duke@435 | 44 | <xsl:apply-templates select="functionsection"/> |
duke@435 | 45 | </xsl:template> |
duke@435 | 46 | |
duke@435 | 47 | <xsl:template match="functionsection"> |
duke@435 | 48 | <xsl:apply-templates select="category"/> |
duke@435 | 49 | </xsl:template> |
duke@435 | 50 | |
duke@435 | 51 | <xsl:template match="category"> |
duke@435 | 52 | <xsl:text> |
duke@435 | 53 | // |
duke@435 | 54 | // </xsl:text><xsl:value-of select="@label"/><xsl:text> functions |
duke@435 | 55 | // |
duke@435 | 56 | </xsl:text> |
duke@435 | 57 | <xsl:apply-templates select="function[not(contains(@impl,'unimpl'))]"/> |
duke@435 | 58 | </xsl:template> |
duke@435 | 59 | |
duke@435 | 60 | <xsl:template match="function"> |
duke@435 | 61 | <xsl:apply-templates select="parameters" mode="advice"/> |
duke@435 | 62 | <xsl:text> |
duke@435 | 63 | jvmtiError |
duke@435 | 64 | JvmtiEnv::</xsl:text> |
duke@435 | 65 | <xsl:if test="count(@hide)=1"> |
duke@435 | 66 | <xsl:value-of select="@hide"/> |
duke@435 | 67 | </xsl:if> |
duke@435 | 68 | <xsl:value-of select="@id"/> |
duke@435 | 69 | <xsl:text>(</xsl:text> |
duke@435 | 70 | <xsl:apply-templates select="parameters" mode="HotSpotSig"/> |
duke@435 | 71 | <xsl:text>) {</xsl:text> |
duke@435 | 72 | <xsl:for-each select="parameters/param/jclass"> |
duke@435 | 73 | <xsl:if test="count(@method|@field)=0"> |
duke@435 | 74 | <xsl:text> |
duke@435 | 75 | if (java_lang_Class::is_primitive(k_mirror)) { |
duke@435 | 76 | // DO PRIMITIVE CLASS PROCESSING |
duke@435 | 77 | return JVMTI_ERROR_MUST_POSSESS_CAPABILITY; |
duke@435 | 78 | } |
duke@435 | 79 | klassOop k_oop = java_lang_Class::as_klassOop(k_mirror); |
duke@435 | 80 | if (k_oop == NULL) { |
duke@435 | 81 | return JVMTI_ERROR_INVALID_CLASS; |
duke@435 | 82 | }</xsl:text> |
duke@435 | 83 | </xsl:if> |
duke@435 | 84 | </xsl:for-each> |
duke@435 | 85 | <xsl:text> |
duke@435 | 86 | return JVMTI_ERROR_MUST_POSSESS_CAPABILITY; |
duke@435 | 87 | } /* end </xsl:text> |
duke@435 | 88 | <xsl:if test="count(@hide)=1"> |
duke@435 | 89 | <xsl:value-of select="@hide"/> |
duke@435 | 90 | </xsl:if> |
duke@435 | 91 | <xsl:value-of select="@id"/> |
duke@435 | 92 | <xsl:text> */ |
duke@435 | 93 | |
duke@435 | 94 | </xsl:text> |
duke@435 | 95 | </xsl:template> |
duke@435 | 96 | |
duke@435 | 97 | |
duke@435 | 98 | <!-- ======== ADVICE ======== --> |
duke@435 | 99 | |
duke@435 | 100 | <xsl:template match="parameters" mode="advice"> |
duke@435 | 101 | <xsl:apply-templates select="param" mode="advice"/> |
duke@435 | 102 | </xsl:template> |
duke@435 | 103 | |
duke@435 | 104 | <xsl:template match="param" mode="advice"> |
duke@435 | 105 | <xsl:apply-templates select="child::*[position()=1]" mode="advice"> |
duke@435 | 106 | <xsl:with-param name="name" select="@id"/> |
duke@435 | 107 | </xsl:apply-templates> |
duke@435 | 108 | </xsl:template> |
duke@435 | 109 | |
duke@435 | 110 | <xsl:template match="jthread" mode="advice"> |
duke@435 | 111 | <xsl:param name="name"/> |
duke@435 | 112 | <xsl:choose> |
duke@435 | 113 | <xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))"> |
duke@435 | 114 | <xsl:text> |
duke@435 | 115 | // Threads_lock NOT held, java_thread not protected by lock |
duke@435 | 116 | // java_thread - pre-checked</xsl:text> |
duke@435 | 117 | </xsl:when> |
duke@435 | 118 | <xsl:otherwise> |
duke@435 | 119 | <xsl:text> |
duke@435 | 120 | // Threads_lock NOT held |
duke@435 | 121 | // </xsl:text> |
duke@435 | 122 | <xsl:value-of select="$name"/> |
duke@435 | 123 | <xsl:text> - NOT pre-checked</xsl:text> |
duke@435 | 124 | </xsl:otherwise> |
duke@435 | 125 | </xsl:choose> |
duke@435 | 126 | </xsl:template> |
duke@435 | 127 | |
duke@435 | 128 | <xsl:template match="jrawMonitorID" mode="advice"> |
duke@435 | 129 | <xsl:param name="name"/> |
duke@435 | 130 | <xsl:text> |
duke@435 | 131 | // rmonitor - pre-checked for validity</xsl:text> |
duke@435 | 132 | </xsl:template> |
duke@435 | 133 | |
duke@435 | 134 | <xsl:template match="jframeID" mode="advice"> |
duke@435 | 135 | <xsl:param name="name"/> |
duke@435 | 136 | <xsl:text> |
duke@435 | 137 | // java_thread - unchecked |
duke@435 | 138 | // depth - pre-checked as non-negative</xsl:text> |
duke@435 | 139 | </xsl:template> |
duke@435 | 140 | |
duke@435 | 141 | <xsl:template match="jmethodID" mode="advice"> |
duke@435 | 142 | <xsl:param name="name"/> |
duke@435 | 143 | <xsl:text> |
duke@435 | 144 | // method_oop - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text> |
duke@435 | 145 | </xsl:template> |
duke@435 | 146 | |
duke@435 | 147 | <xsl:template match="jfieldID" mode="advice"> |
duke@435 | 148 | <xsl:param name="name"/> |
duke@435 | 149 | </xsl:template> |
duke@435 | 150 | |
duke@435 | 151 | <xsl:template match="jclass" mode="advice"> |
duke@435 | 152 | <xsl:param name="name"/> |
duke@435 | 153 | <!-- |
duke@435 | 154 | classes passed as part of a class/method or class/field pair are used |
duke@435 | 155 | by the wrapper to get the internal type but are not needed by nor |
duke@435 | 156 | passed to the implementation layer. |
duke@435 | 157 | --> |
duke@435 | 158 | <xsl:if test="count(@method|@field)=0"> |
duke@435 | 159 | <xsl:text> |
duke@435 | 160 | // k_mirror - may be primitive, this must be checked</xsl:text> |
duke@435 | 161 | </xsl:if> |
duke@435 | 162 | </xsl:template> |
duke@435 | 163 | |
duke@435 | 164 | <xsl:template match="nullok" mode="advice"> |
duke@435 | 165 | </xsl:template> |
duke@435 | 166 | |
duke@435 | 167 | <xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice"> |
duke@435 | 168 | <xsl:param name="name"/> |
duke@435 | 169 | <xsl:choose> |
duke@435 | 170 | <xsl:when test="count(nullok)=0"> |
duke@435 | 171 | <xsl:text> |
duke@435 | 172 | // </xsl:text> |
duke@435 | 173 | <xsl:value-of select="$name"/> |
duke@435 | 174 | <xsl:text> - pre-checked for NULL</xsl:text> |
duke@435 | 175 | </xsl:when> |
duke@435 | 176 | <xsl:otherwise> |
duke@435 | 177 | <xsl:text> |
duke@435 | 178 | // </xsl:text> |
duke@435 | 179 | <xsl:value-of select="$name"/> |
duke@435 | 180 | <xsl:text> - NULL is a valid value, must be checked</xsl:text> |
duke@435 | 181 | </xsl:otherwise> |
duke@435 | 182 | </xsl:choose> |
duke@435 | 183 | </xsl:template> |
duke@435 | 184 | |
duke@435 | 185 | <xsl:template match="jint" mode="advice"> |
duke@435 | 186 | <xsl:param name="name"/> |
duke@435 | 187 | <xsl:if test="count(@min)=1"> |
duke@435 | 188 | <xsl:text> |
duke@435 | 189 | // </xsl:text> |
duke@435 | 190 | <xsl:value-of select="$name"/> |
duke@435 | 191 | <xsl:text> - pre-checked to be greater than or equal to </xsl:text> |
duke@435 | 192 | <xsl:value-of select="@min"/> |
duke@435 | 193 | </xsl:if> |
duke@435 | 194 | </xsl:template> |
duke@435 | 195 | |
duke@435 | 196 | <xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice"> |
duke@435 | 197 | <xsl:param name="name"/> |
duke@435 | 198 | </xsl:template> |
duke@435 | 199 | |
duke@435 | 200 | </xsl:stylesheet> |