changeset 4603:ad278ee734e4

8010514: G1: Concurrent mode failure tracing event Reviewed-by: jwilhelm, johnc
author kevinw
date Sun, 14 Apr 2013 22:26:06 +0100
parents 0c00fe85302b
children 87f5d2977493
files src/share/vm/gc_implementation/g1/concurrentMark.hpp src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp src/share/vm/gc_implementation/shared/gcTrace.cpp src/share/vm/gc_implementation/shared/gcTrace.hpp src/share/vm/gc_implementation/shared/gcTraceSend.cpp
diffstat 5 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Sun Apr 14 14:16:12 2013 -0400
+++ b/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Sun Apr 14 22:26:06 2013 +0100
@@ -546,8 +546,6 @@
   void clear_has_overflown()     { _has_overflown = false; }
   bool restart_for_overflow()    { return _restart_for_overflow; }
 
-  bool has_aborted()             { return _has_aborted; }
-
   // Methods to enter the two overflow sync barriers
   void enter_first_sync_barrier(int task_num);
   void enter_second_sync_barrier(int task_num);
@@ -795,6 +793,8 @@
   // Called to abort the marking cycle after a Full GC takes palce.
   void abort();
 
+  bool has_aborted()      { return _has_aborted; }
+
   // This prints the global/local fingers. It is used for debugging.
   NOT_PRODUCT(void print_finger();)
 
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Sun Apr 14 14:16:12 2013 -0400
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Sun Apr 14 22:26:06 2013 +0100
@@ -2518,6 +2518,9 @@
   if (_concurrent_cycle_started) {
     _gc_timer_cm->register_gc_end(os::elapsed_counter());
 
+    if (_cm->has_aborted()) {
+      _gc_tracer_cm->report_concurrent_mode_failure();
+    }
     _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
 
     _concurrent_cycle_started = false;
--- a/src/share/vm/gc_implementation/shared/gcTrace.cpp	Sun Apr 14 14:16:12 2013 -0400
+++ b/src/share/vm/gc_implementation/shared/gcTrace.cpp	Sun Apr 14 22:26:06 2013 +0100
@@ -161,7 +161,7 @@
   _parallel_old_gc_info.report_dense_prefix(dense_prefix);
 }
 
-void CMSTracer::report_concurrent_mode_failure() {
+void OldGCTracer::report_concurrent_mode_failure() {
   assert_set_gc_id();
 
   send_concurrent_mode_failure_event();
--- a/src/share/vm/gc_implementation/shared/gcTrace.hpp	Sun Apr 14 14:16:12 2013 -0400
+++ b/src/share/vm/gc_implementation/shared/gcTrace.hpp	Sun Apr 14 22:26:06 2013 +0100
@@ -162,8 +162,12 @@
   OldGCTracer(GCName name) : GCTracer(name) {}
   virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
 
+ public:
+  void report_concurrent_mode_failure();
+
  private:
   void send_old_gc_event() const;
+  void send_concurrent_mode_failure_event();
 };
 
 class ParallelOldTracer : public OldGCTracer {
@@ -220,11 +224,6 @@
 class CMSTracer : public OldGCTracer {
  public:
   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
-
-  void report_concurrent_mode_failure();
-
- private:
-  void send_concurrent_mode_failure_event();
 };
 
 class G1OldTracer : public OldGCTracer {
--- a/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Sun Apr 14 14:16:12 2013 -0400
+++ b/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Sun Apr 14 22:26:06 2013 +0100
@@ -114,7 +114,8 @@
   }
 }
 
-void CMSTracer::send_concurrent_mode_failure_event() {
+// Common to CMS and G1
+void OldGCTracer::send_concurrent_mode_failure_event() {
   EventConcurrentModeFailure e;
   if (e.should_commit()) {
     e.set_gcId(_shared_gc_info.id());