4141N/A<?
xml version="1.0" encoding="utf-8"?>
4141N/A Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4141N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4141N/A This code is free software; you can redistribute it and/or modify it 4141N/A under the terms of the GNU General Public License version 2 only, as 4141N/A published by the Free Software Foundation. 4141N/A This code is distributed in the hope that it will be useful, but WITHOUT 4141N/A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4141N/A FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4141N/A version 2 for more details (a copy is included in the LICENSE file that 4141N/A You should have received a copy of the GNU General Public License version 4141N/A 2 along with this work; if not, write to the Free Software Foundation, 4141N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4141N/A Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4141N/A<
xsl:
output method="text" indent="no" omit-
xml-
declaration="yes"/>
4141N/A <
xsl:
call-
template name="file-header"/>
4141N/A#ifndef TRACEFILES_TRACEEVENTCLASSES_HPP
4141N/A#define TRACEFILES_TRACEEVENTCLASSES_HPP
4141N/A// On purpose outside the INCLUDE_TRACE
4141N/A void set_starttime(jlong time) const {}
4141N/A void set_endtime(jlong time) const {}
4141N/A bool should_commit() const { return false; }
4141N/A<
xsl:
template match="struct" mode="trace">
4141N/Astruct TraceStruct<
xsl:
value-
of select="@id"/>
4141N/A<
xsl:
apply-
templates select="value" mode="write-fields"/>
4141N/A<
xsl:
apply-
templates select="value" mode="write-setters"/>
4141N/A void writeStruct(TraceStream& ts) {
4141N/A<
xsl:
apply-
templates select="value" mode="write-data"/>
4141N/A<
xsl:
template match="struct" mode="empty">
4141N/Astruct TraceStruct<
xsl:
value-
of select="@id"/>
4141N/A<
xsl:
apply-
templates select="value" mode="write-empty-setters"/>
4141N/A<
xsl:
template match="event" mode="empty">
4141N/A <
xsl:
value-
of select="concat('class Event', @id, ' : public TraceEvent')"/>
4141N/A<
xsl:
value-
of select="concat(' Event', @id, '(bool ignore=true) {}')"/>
4141N/A<
xsl:
apply-
templates select="value|structvalue|transition_value|relation" mode="write-empty-setters"/>
4141N/A<
xsl:
template match="event" mode="trace">
4141N/A <
xsl:
value-
of select="concat('class Event', @id, ' : public TraceEvent<Event', @id, '>')"/>
4141N/A static const bool hasThread = <
xsl:
value-
of select="@has_thread"/>;
4141N/A static const bool hasStackTrace = <
xsl:
value-
of select="@has_stacktrace"/>;
4141N/A static const bool isInstant = <
xsl:
value-
of select="@is_instant"/>;
4141N/A static const bool isRequestable = <
xsl:
value-
of select="@is_requestable"/>;
4141N/A static const TraceEventId eventId = <
xsl:
value-
of select="concat('Trace', @id, 'Event')"/>;
4141N/A<
xsl:
apply-
templates select="value|structvalue|transition_value|relation" mode="write-fields"/>
4501N/A void writeEventContent(void) {
4501N/A<
xsl:
apply-
templates select="value|structvalue" mode="write-data"/>
4141N/A<
xsl:
apply-
templates select="value|structvalue|transition_value|relation" mode="write-setters"/>
4141N/A <
xsl:
value-
of select="concat(' Event', @id, '(EventStartTime timing=TIMED) : TraceEvent<Event', @id, '>(timing) {}', $newline)"/>
4141N/A<
xsl:
template match="value|transition_value|relation" mode="write-empty-setters">
4141N/A <
xsl:
variable name="type" select="@type"/>
4141N/A <
xsl:
variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
4141N/A <
xsl:
value-
of select="concat(' void set_', @field, '(', $wt, ' value) { }')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="structvalue" mode="write-empty-setters">
4141N/A <
xsl:
value-
of select="concat(' void set_', @field, '(const TraceStruct', @type, '& value) { }')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="value[@type='TICKS']" mode="write-setters">
4141N/A <
xsl:
value-
of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/>
4141N/A <
xsl:
value-
of select="concat('void set_', @field, '(jlong ignore) {}')"/>
4177N/A<
xsl:
template match="value[@type='RELATIVE_TICKS']" mode="write-setters">
4177N/A <
xsl:
value-
of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/>
4177N/A <
xsl:
value-
of select="concat('void set_', @field, '(jlong ignore) {}')"/>
4141N/A<
xsl:
template match="value" mode="write-fields">
4141N/A <
xsl:
variable name="type" select="@type"/>
4141N/A <
xsl:
variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
4141N/A <
xsl:
value-
of select="concat(' ', $wt, ' _', @field, ';')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="structvalue" mode="write-fields">
4141N/A <
xsl:
value-
of select="concat(' TraceStruct', @type, ' _', @field, ';')"/>
4141N/A<
xsl:
template match="value|transition_value|relation" mode="write-setters">
4141N/A <
xsl:
variable name="type" select="@type"/>
4141N/A <
xsl:
variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
4141N/A <
xsl:
value-
of select="concat(' void set_', @field, '(', $wt, ' value) { this->_', @field, ' = value; }')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="structvalue" mode="write-setters">
4141N/A <
xsl:
value-
of select="concat(' void set_', @field, '(const TraceStruct', @type, '& value) { this->_', @field, ' = value; }')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="value" mode="write-data">
4141N/A <
xsl:
variable name="type" select="@type"/>
4141N/A <
xsl:
variable name="wt" select="//primary_type[@symbol=$type]/@writetype"/>
4141N/A <
xsl:
value-
of select="concat(' ts.print_val("', @label, '", _', @field, ');')"/>
4141N/A <
xsl:
if test="position() != last()">
4141N/A<
xsl:
template match="structvalue" mode="write-data">
4141N/A <
xsl:
value-
of select="concat(' _', @field, '.writeStruct(ts);')"/>
4141N/A <
xsl:
if test="position() != last()">