src/share/vm/trace/traceEventClasses.xsl

Print this page
rev 13113 : 8182651: Add TRACE_ONLY conditional macro to support more fine-grained INCLUDE_TRACE programming
Reviewed-by:
   1 <?xml version="1.0" encoding="utf-8"?>
   2 <!--
   3  Copyright (c) 2012, 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 -->
  24 
  25 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  26 <xsl:import href="xsl_util.xsl"/>
  27 <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
  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 "tracefiles/traceTypes.hpp"
  40 #include "trace/traceEvent.hpp"
  41 #include "utilities/macros.hpp"
  42 #include "utilities/ticks.hpp"
  43 #if INCLUDE_TRACE

  44 #include "trace/traceStream.hpp"
  45 #include "utilities/ostream.hpp"
  46 
  47   <xsl:apply-templates select="trace/events/struct" mode="trace"/>
  48   <xsl:apply-templates select="trace/events/event" mode="trace"/>
  49 
  50 #else // !INCLUDE_TRACE
  51 
  52 class TraceEvent {
  53 public:
  54   TraceEvent() {}
  55   void set_starttime(const Ticks&amp; ignore) {}
  56   void set_endtime(const Ticks&amp; ignore) {}
  57   bool should_commit() const { return false; }
  58   static bool is_enabled() { return false; }
  59   void commit() {}
  60   void cancel() {}
  61 };
  62 
  63   <xsl:apply-templates select="trace/events/struct" mode="empty"/>


   1 <?xml version="1.0" encoding="utf-8"?>
   2 <!--
   3  Copyright (c) 2012, 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 -->
  24 
  25 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  26 <xsl:import href="xsl_util.xsl"/>
  27 <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
  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 "utilities/macros.hpp"

  40 #if INCLUDE_TRACE
  41 #include "trace/traceEvent.hpp"
  42 #include "trace/traceStream.hpp"
  43 #include "utilities/ostream.hpp"
  44 
  45   <xsl:apply-templates select="trace/events/struct" mode="trace"/>
  46   <xsl:apply-templates select="trace/events/event" mode="trace"/>
  47 
  48 #else // !INCLUDE_TRACE
  49 
  50 class TraceEvent {
  51 public:
  52   TraceEvent() {}
  53   void set_starttime(const Ticks&amp; ignore) {}
  54   void set_endtime(const Ticks&amp; ignore) {}
  55   bool should_commit() const { return false; }
  56   static bool is_enabled() { return false; }
  57   void commit() {}
  58   void cancel() {}
  59 };
  60 
  61   <xsl:apply-templates select="trace/events/struct" mode="empty"/>