comparison src/share/vm/trace/traceEventClasses.xsl @ 13400:86e6d691f2e1

8028128: Add a type safe alternative for working with counter based data Reviewed-by: dholmes, egahlin
author mgronlun
date Sat, 23 Nov 2013 12:25:13 +0100
parents 042cf42c72bd
children 82d3e7b5277a
comparison
equal deleted inserted replaced
13399:260ac69dc096 13400:86e6d691f2e1
38 38
39 #include "memory/resourceArea.hpp" 39 #include "memory/resourceArea.hpp"
40 #include "tracefiles/traceTypes.hpp" 40 #include "tracefiles/traceTypes.hpp"
41 #include "trace/traceEvent.hpp" 41 #include "trace/traceEvent.hpp"
42 #include "utilities/macros.hpp" 42 #include "utilities/macros.hpp"
43 #include "utilities/ticks.hpp"
43 44
44 #if INCLUDE_TRACE 45 #if INCLUDE_TRACE
45 46
46 47
47 #include "trace/traceStream.hpp" 48 #include "trace/traceStream.hpp"
53 #else 54 #else
54 55
55 class TraceEvent { 56 class TraceEvent {
56 public: 57 public:
57 TraceEvent() {} 58 TraceEvent() {}
58 void set_starttime(jlong time) const {} 59 void set_starttime(const Ticks& time) {}
59 void set_endtime(jlong time) const {} 60 void set_endtime(const Ticks& time) {}
60 bool should_commit() const { return false; } 61 bool should_commit() const { return false; }
61 void commit() const {} 62 void commit() const {}
62 }; 63 };
63 64
64 <xsl:apply-templates select="trace/events/struct" mode="empty"/> 65 <xsl:apply-templates select="trace/events/struct" mode="empty"/>
168 <xsl:text> 169 <xsl:text>
169 </xsl:text> 170 </xsl:text>
170 </xsl:if> 171 </xsl:if>
171 </xsl:template> 172 </xsl:template>
172 173
173
174 <xsl:template match="value[@type='TICKS']" mode="write-setters"> 174 <xsl:template match="value[@type='TICKS']" mode="write-setters">
175 #if INCLUDE_TRACE 175 #if INCLUDE_TRACE
176 <xsl:value-of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/> 176 <xsl:value-of select="concat(' void set_', @field, '(const Ticks&amp; time) { _', @field, ' = time; }')"/>
177 #else 177 #else
178 <xsl:value-of select="concat('void set_', @field, '(jlong ignore) {}')"/> 178 <xsl:value-of select="concat(' void set_', @field, '(const Ticks&amp; ignore) {}')"/>
179 #endif 179 #endif
180 </xsl:template> 180 </xsl:template>
181 181
182 <xsl:template match="value[@type='RELATIVE_TICKS']" mode="write-setters"> 182 <xsl:template match="value[@type='TICKSPAN']" mode="write-setters">
183 #if INCLUDE_TRACE 183 #if INCLUDE_TRACE
184 <xsl:value-of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/> 184 <xsl:value-of select="concat(' void set_', @field, '(const Tickspan&amp; time) { _', @field, ' = time; }')"/>
185 #else 185 #else
186 <xsl:value-of select="concat('void set_', @field, '(jlong ignore) {}')"/> 186 <xsl:value-of select="concat(' void set_', @field, '(const Tickspan&amp; ignore) {}')"/>
187 #endif 187 #endif
188 </xsl:template> 188 </xsl:template>
189
189 190
190 <xsl:template match="value" mode="write-fields"> 191 <xsl:template match="value" mode="write-fields">
191 <xsl:variable name="type" select="@type"/> 192 <xsl:variable name="type" select="@type"/>
192 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/> 193 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
193 <xsl:value-of select="concat(' ', $wt, ' _', @field, ';')"/> 194 <xsl:value-of select="concat(' ', $wt, ' _', @field, ';')"/>
224 </xsl:template> 225 </xsl:template>
225 226
226 <xsl:template match="value" mode="write-data"> 227 <xsl:template match="value" mode="write-data">
227 <xsl:variable name="type" select="@type"/> 228 <xsl:variable name="type" select="@type"/>
228 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@writetype"/> 229 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@writetype"/>
229 <xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, ');')"/> 230 <xsl:choose>
231 <xsl:when test="@type='TICKSPAN'">
232 <xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, '.value());')"/>
233 </xsl:when>
234 <xsl:when test="@type='TICKS'">
235 <xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, '.value());')"/>
236 </xsl:when>
237 <xsl:otherwise>
238 <xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, ');')"/>
239 </xsl:otherwise>
240 </xsl:choose>
230 <xsl:if test="position() != last()"> 241 <xsl:if test="position() != last()">
231 <xsl:text> 242 <xsl:text>
232 ts.print(", "); 243 ts.print(", ");
233 </xsl:text> 244 </xsl:text>
234 </xsl:if> 245 </xsl:if>