1 <?xml version="1.0"?>
2 <!--
3 Copyright (c) 2002, 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
165
166 <xsl:template name="eventCapabilitiesTest">
167 <xsl:text>
168
169 // Check Event Capabilities
170 const bool JvmtiUtil::has_event_capability(jvmtiEvent event_type, const jvmtiCapabilities* capabilities_ptr) {
171 switch (event_type) {
172 </xsl:text>
173 <xsl:for-each select="//eventsection/event">
174 <xsl:variable name="capa" select="capabilities/required"/>
175 <xsl:if test="count($capa)">
176 <xsl:text> case </xsl:text>
177 <xsl:value-of select="@const"/>
178 <xsl:text>:
179 return capabilities_ptr-></xsl:text>
180 <xsl:value-of select="$capa/@id"/>
181 <xsl:text> != 0;
182 </xsl:text>
183 </xsl:if>
184 </xsl:for-each>
185 <xsl:text> }
186 // if it does not have a capability it is required
187 return JNI_TRUE;
188 }
189
190 </xsl:text>
191 </xsl:template>
192
193 <xsl:template match="functionsection">
194 <xsl:if test="$trace='Trace'">
195
196 <!-- all this just to return the highest function number -->
197 <xsl:variable name="maxFunction">
198 <xsl:for-each select="category/function">
199 <xsl:variable name="mynum" select="@num"/>
200 <xsl:if test="count(../../category/function[@num > $mynum]) = 0">
201 <xsl:value-of select="@num"/>
202 </xsl:if>
203 </xsl:for-each>
204 </xsl:variable>
205
1215 <xsl:text>ConstantValues, </xsl:text>
1216 <xsl:value-of select="$name"/>
1217 <xsl:text>)</xsl:text>
1218 </xsl:otherwise>
1219 </xsl:choose>
1220 </xsl:otherwise>
1221 </xsl:choose>
1222 </xsl:template>
1223
1224 <xsl:template match="jint" mode="traceInFormat">
1225 <xsl:param name="name"/>
1226 <xsl:text> </xsl:text>
1227 <xsl:value-of select="$name"/>
1228 <xsl:text>=" INT32_FORMAT "</xsl:text>
1229 </xsl:template>
1230
1231 <xsl:template match="jlocation" mode="traceInFormat">
1232 <xsl:param name="name"/>
1233 <xsl:text> </xsl:text>
1234 <xsl:value-of select="$name"/>
1235 <xsl:text>=" INT64_FORMAT "</xsl:text>
1236 </xsl:template>
1237
1238 <xsl:template match="jlong" mode="traceInFormat">
1239 <xsl:param name="name"/>
1240 <xsl:text> </xsl:text>
1241 <xsl:value-of select="$name"/>
1242 <xsl:text>=" INT64_FORMAT "</xsl:text>
1243 </xsl:template>
1244
1245 <xsl:template match="size_t" mode="traceInFormat">
1246 <xsl:param name="name"/>
1247 <xsl:text> </xsl:text>
1248 <xsl:value-of select="$name"/>
1249 <xsl:text>=" SIZE_FORMAT_HEX "</xsl:text>
1250 </xsl:template>
1251
1252 <xsl:template match="jfloat|jdouble" mode="traceInFormat">
1253 <xsl:param name="name"/>
1254 <xsl:text> </xsl:text>
1255 <xsl:value-of select="$name"/>
1256 <xsl:text>=%f</xsl:text>
1257 </xsl:template>
1258
1259 <xsl:template match="char" mode="traceInFormat">
1260 <xsl:param name="name"/>
1261 <xsl:text> </xsl:text>
1262 <xsl:value-of select="$name"/>
|
1 <?xml version="1.0"?>
2 <!--
3 Copyright (c) 2002, 2017, 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
165
166 <xsl:template name="eventCapabilitiesTest">
167 <xsl:text>
168
169 // Check Event Capabilities
170 const bool JvmtiUtil::has_event_capability(jvmtiEvent event_type, const jvmtiCapabilities* capabilities_ptr) {
171 switch (event_type) {
172 </xsl:text>
173 <xsl:for-each select="//eventsection/event">
174 <xsl:variable name="capa" select="capabilities/required"/>
175 <xsl:if test="count($capa)">
176 <xsl:text> case </xsl:text>
177 <xsl:value-of select="@const"/>
178 <xsl:text>:
179 return capabilities_ptr-></xsl:text>
180 <xsl:value-of select="$capa/@id"/>
181 <xsl:text> != 0;
182 </xsl:text>
183 </xsl:if>
184 </xsl:for-each>
185 <xsl:text> default: break; }
186 // if it does not have a capability it is required
187 return JNI_TRUE;
188 }
189
190 </xsl:text>
191 </xsl:template>
192
193 <xsl:template match="functionsection">
194 <xsl:if test="$trace='Trace'">
195
196 <!-- all this just to return the highest function number -->
197 <xsl:variable name="maxFunction">
198 <xsl:for-each select="category/function">
199 <xsl:variable name="mynum" select="@num"/>
200 <xsl:if test="count(../../category/function[@num > $mynum]) = 0">
201 <xsl:value-of select="@num"/>
202 </xsl:if>
203 </xsl:for-each>
204 </xsl:variable>
205
1215 <xsl:text>ConstantValues, </xsl:text>
1216 <xsl:value-of select="$name"/>
1217 <xsl:text>)</xsl:text>
1218 </xsl:otherwise>
1219 </xsl:choose>
1220 </xsl:otherwise>
1221 </xsl:choose>
1222 </xsl:template>
1223
1224 <xsl:template match="jint" mode="traceInFormat">
1225 <xsl:param name="name"/>
1226 <xsl:text> </xsl:text>
1227 <xsl:value-of select="$name"/>
1228 <xsl:text>=" INT32_FORMAT "</xsl:text>
1229 </xsl:template>
1230
1231 <xsl:template match="jlocation" mode="traceInFormat">
1232 <xsl:param name="name"/>
1233 <xsl:text> </xsl:text>
1234 <xsl:value-of select="$name"/>
1235 <xsl:text>=" JLONG_FORMAT "</xsl:text>
1236 </xsl:template>
1237
1238 <xsl:template match="jlong" mode="traceInFormat">
1239 <xsl:param name="name"/>
1240 <xsl:text> </xsl:text>
1241 <xsl:value-of select="$name"/>
1242 <xsl:text>=" JLONG_FORMAT "</xsl:text>
1243 </xsl:template>
1244
1245 <xsl:template match="size_t" mode="traceInFormat">
1246 <xsl:param name="name"/>
1247 <xsl:text> </xsl:text>
1248 <xsl:value-of select="$name"/>
1249 <xsl:text>=" SIZE_FORMAT_HEX "</xsl:text>
1250 </xsl:template>
1251
1252 <xsl:template match="jfloat|jdouble" mode="traceInFormat">
1253 <xsl:param name="name"/>
1254 <xsl:text> </xsl:text>
1255 <xsl:value-of select="$name"/>
1256 <xsl:text>=%f</xsl:text>
1257 </xsl:template>
1258
1259 <xsl:template match="char" mode="traceInFormat">
1260 <xsl:param name="name"/>
1261 <xsl:text> </xsl:text>
1262 <xsl:value-of select="$name"/>
|