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