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 -->
24
25 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
26 <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
27 <xsl:import href="xsl_util.xsl"/>
28
29 <xsl:template match="/">
30 <xsl:call-template name="file-header"/>
31
32 #ifndef TRACEFILES_TRACEEVENTCLASSES_HPP
33 #define TRACEFILES_TRACEEVENTCLASSES_HPP
34
35 // On purpose outside the INCLUDE_TRACE
36 // Some parts of traceEvent.hpp are used outside of
37 // INCLUDE_TRACE
38
39 #include "memory/resourceArea.hpp"
40 #include "tracefiles/traceTypes.hpp"
41 #include "trace/traceEvent.hpp"
42
43 #if INCLUDE_TRACE
44
45 #include "trace/traceStream.hpp"
46 #include "utilities/ostream.hpp"
47
48 <xsl:apply-templates select="trace/events/struct" mode="trace"/>
49 <xsl:apply-templates select="trace/events/event" mode="trace"/>
50
51 #else
52
53 class TraceEvent {
54 public:
55 TraceEvent() {}
56 void set_starttime(jlong time) const {}
57 void set_endtime(jlong time) const {}
58 bool should_commit() const { return false; }
59 void commit() const {}
113 static const bool hasStackTrace = <xsl:value-of select="@has_stacktrace"/>;
114 static const bool isInstant = <xsl:value-of select="@is_instant"/>;
115 static const bool isRequestable = <xsl:value-of select="@is_requestable"/>;
116 static const TraceEventId eventId = <xsl:value-of select="concat('Trace', @id, 'Event')"/>;
117
118 private:
119 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-fields"/>
120
121 public:
122 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-setters"/>
123
124 bool should_write(void) {
125 return true;
126 }
127 <xsl:text>
128
129 </xsl:text>
130 <xsl:value-of select="concat(' Event', @id, '(EventStartTime timing=TIMED) : TraceEvent<Event', @id, '>(timing) {}', $newline)"/>
131 void writeEvent(void) {
132 ResourceMark rm;
133 TraceStream ts(*tty);
134 ts.print("<xsl:value-of select="@label"/>: [");
135 <xsl:apply-templates select="value|structvalue" mode="write-data"/>
136 ts.print("]\n");
137 }
138 };
139
140 </xsl:template>
141
142 <xsl:template match="value|transition_value|relation" mode="write-empty-setters">
143 <xsl:param name="cls"/>
144 <xsl:variable name="type" select="@type"/>
145 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
146 <xsl:value-of select="concat(' void set_', @field, '(', $wt, ' value) { }')"/>
147 <xsl:if test="position() != last()">
148 <xsl:text>
149 </xsl:text>
150 </xsl:if>
151 </xsl:template>
152
|
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 -->
24
25 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
26 <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
27 <xsl:import href="xsl_util.xsl"/>
28
29 <xsl:template match="/">
30 <xsl:call-template name="file-header"/>
31
32 #ifndef TRACEFILES_TRACEEVENTCLASSES_HPP
33 #define TRACEFILES_TRACEEVENTCLASSES_HPP
34
35 // On purpose outside the INCLUDE_TRACE
36 // Some parts of traceEvent.hpp are used outside of
37 // INCLUDE_TRACE
38
39 #include "memory/resourceArea.hpp"
40 #include "runtime/handles.hpp"
41 #include "tracefiles/traceTypes.hpp"
42 #include "trace/traceEvent.hpp"
43
44 #if INCLUDE_TRACE
45
46 #include "trace/traceStream.hpp"
47 #include "utilities/ostream.hpp"
48
49 <xsl:apply-templates select="trace/events/struct" mode="trace"/>
50 <xsl:apply-templates select="trace/events/event" mode="trace"/>
51
52 #else
53
54 class TraceEvent {
55 public:
56 TraceEvent() {}
57 void set_starttime(jlong time) const {}
58 void set_endtime(jlong time) const {}
59 bool should_commit() const { return false; }
60 void commit() const {}
114 static const bool hasStackTrace = <xsl:value-of select="@has_stacktrace"/>;
115 static const bool isInstant = <xsl:value-of select="@is_instant"/>;
116 static const bool isRequestable = <xsl:value-of select="@is_requestable"/>;
117 static const TraceEventId eventId = <xsl:value-of select="concat('Trace', @id, 'Event')"/>;
118
119 private:
120 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-fields"/>
121
122 public:
123 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-setters"/>
124
125 bool should_write(void) {
126 return true;
127 }
128 <xsl:text>
129
130 </xsl:text>
131 <xsl:value-of select="concat(' Event', @id, '(EventStartTime timing=TIMED) : TraceEvent<Event', @id, '>(timing) {}', $newline)"/>
132 void writeEvent(void) {
133 ResourceMark rm;
134 HandleMark hm;
135 TraceStream ts(*tty);
136 ts.print("<xsl:value-of select="@label"/>: [");
137 <xsl:apply-templates select="value|structvalue" mode="write-data"/>
138 ts.print("]\n");
139 }
140 };
141
142 </xsl:template>
143
144 <xsl:template match="value|transition_value|relation" mode="write-empty-setters">
145 <xsl:param name="cls"/>
146 <xsl:variable name="type" select="@type"/>
147 <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
148 <xsl:value-of select="concat(' void set_', @field, '(', $wt, ' value) { }')"/>
149 <xsl:if test="position() != last()">
150 <xsl:text>
151 </xsl:text>
152 </xsl:if>
153 </xsl:template>
154
|