changeset 4696:725d82a60081

Merge
author collins
date Wed, 15 May 2013 08:37:36 -0700
parents 4071984ef4ea feb41fc13635
children ec4e3a5cc748 275bd93474dc
files
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/globals.hpp	Wed Mar 27 09:49:51 2013 -0700
+++ b/src/share/vm/runtime/globals.hpp	Wed May 15 08:37:36 2013 -0700
@@ -3634,7 +3634,9 @@
           "Include GC cause in GC logging")                                 \
                                                                             \
   product(bool, EnableTracing, false,                                       \
-                  "Enable event-based tracing")
+                  "Enable event-based tracing")                             \
+  product(bool, UseLockedTracing, false,                                    \
+          "Use locked-tracing when doing event-based tracing")
 
 /*
  *  Macros for factoring of globals
--- a/src/share/vm/trace/traceEventClasses.xsl	Wed Mar 27 09:49:51 2013 -0700
+++ b/src/share/vm/trace/traceEventClasses.xsl	Wed May 15 08:37:36 2013 -0700
@@ -119,6 +119,13 @@
  private:
 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-fields"/>
 
+  void writeEventContent(void) {
+    TraceStream ts(*tty);
+    ts.print("<xsl:value-of select="@label"/>: [");
+<xsl:apply-templates select="value|structvalue" mode="write-data"/>
+    ts.print("]\n");
+  }
+
  public:
 <xsl:apply-templates select="value|structvalue|transition_value|relation" mode="write-setters"/>
 
@@ -132,11 +139,14 @@
   void writeEvent(void) {
     ResourceMark rm;
     HandleMark hm;
-    TraceStream ts(*tty);
-    ts.print("<xsl:value-of select="@label"/>: [");
-<xsl:apply-templates select="value|structvalue" mode="write-data"/>
-    ts.print("]\n");
+    if (UseLockedTracing) {
+      ttyLocker lock;
+      writeEventContent();
+    } else {
+      writeEventContent();
+    }
   }
+
 };
 
 </xsl:template>