src/share/vm/trace/traceEventClasses.xsl

Print this page
rev 7560 : 8066814: Reduce accessibility in TraceEvent
Reviewed-by:


  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 #include "utilities/macros.hpp"
  43 #include "utilities/ticks.hpp"
  44 #if INCLUDE_TRACE
  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 // !INCLUDE_TRACE
  52 
  53 class TraceEvent {
  54 public:
  55   TraceEvent() {}
  56   void set_starttime(const Ticks&amp; time) {}
  57   void set_endtime(const Ticks&amp; time) {}
  58   bool should_commit() const { return false; }
  59   static bool is_enabled() { return false; }
  60   void commit() const {}

  61 };
  62 
  63   <xsl:apply-templates select="trace/events/struct" mode="empty"/>
  64   <xsl:apply-templates select="trace/events/event" mode="empty"/>
  65 
  66 #endif // INCLUDE_TRACE
  67 #endif // TRACEFILES_TRACEEVENTCLASSES_HPP
  68 </xsl:template>
  69 
  70 <xsl:template match="struct" mode="trace">
  71 struct TraceStruct<xsl:value-of select="@id"/>
  72 {
  73 private:
  74 <xsl:apply-templates select="value" mode="write-fields"/>
  75 public:
  76 <xsl:apply-templates select="value" mode="write-setters"/>
  77 
  78   void writeStruct(TraceStream&amp; ts) {
  79 <xsl:apply-templates select="value" mode="write-data"/>
  80   }




  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 #include "utilities/macros.hpp"
  43 #include "utilities/ticks.hpp"
  44 #if INCLUDE_TRACE
  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 // !INCLUDE_TRACE
  52 
  53 class TraceEvent {
  54 public:
  55   TraceEvent() {}
  56   void set_starttime(const Ticks&amp; ignore) {}
  57   void set_endtime(const Ticks&amp; ignore) {}
  58   bool should_commit() const { return false; }
  59   static bool is_enabled() { return false; }
  60   void commit() {}
  61   void cancel() {}
  62 };
  63 
  64   <xsl:apply-templates select="trace/events/struct" mode="empty"/>
  65   <xsl:apply-templates select="trace/events/event" mode="empty"/>
  66 
  67 #endif // INCLUDE_TRACE
  68 #endif // TRACEFILES_TRACEEVENTCLASSES_HPP
  69 </xsl:template>
  70 
  71 <xsl:template match="struct" mode="trace">
  72 struct TraceStruct<xsl:value-of select="@id"/>
  73 {
  74 private:
  75 <xsl:apply-templates select="value" mode="write-fields"/>
  76 public:
  77 <xsl:apply-templates select="value" mode="write-setters"/>
  78 
  79   void writeStruct(TraceStream&amp; ts) {
  80 <xsl:apply-templates select="value" mode="write-data"/>
  81   }