< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page

        

@@ -5313,10 +5313,20 @@
 
   double ref_enq_time = os::elapsedTime() - ref_enq_start;
   g1_policy()->phase_times()->record_ref_enq_time(ref_enq_time * 1000.0);
 }
 
+class TimedTask : public AbstractGangTask {
+ public:
+  TimedTask() : AbstractGangTask("TimedTask") {}
+  void work(uint worker_id) {
+    // Do nothing.
+  }
+};
+
+#include "utilities/ticks.inline.hpp"
+
 void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
   _expand_heap_after_alloc_failure = true;
   _evacuation_failed = false;
 
   // Should G1EvacuationFailureALot be in effect for this GC?

@@ -5335,10 +5345,22 @@
 
   assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty");
   double start_par_time_sec = os::elapsedTime();
   double end_par_time_sec;
 
+  for (int i = 0; i < NewCodeParameter; i++) {
+    TimedTask task;
+    jlong start = os::elapsed_counter();
+    workers()->run_task(&task);
+    jlong end = os::elapsed_counter();
+
+    gclog_or_tty->print_cr("TimedTask %f ms (%f - %f)",
+        TimeHelper::counter_to_millis(end - start),
+        TimeHelper::counter_to_millis(start),
+        TimeHelper::counter_to_millis(end));
+  }
+
   {
     G1RootProcessor root_processor(this, n_workers);
     G1ParTask g1_par_task(this, _task_queues, &root_processor, n_workers);
     // InitialMark needs claim bits to keep track of the marked-through CLDs.
     if (g1_policy()->during_initial_mark_pause()) {
< prev index next >