< prev index next >

src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp

Print this page
rev 7854 : imported patch 8027962-per-phase-timing-measurements-for-strong-roots-processing
rev 7855 : [mq]: 8027962-bengt-suggestions
   1 /*
   2  * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  90     return _sum;
  91   }
  92 
  93   void print(int level, const char* title);
  94 
  95   void reset() PRODUCT_RETURN;
  96   void verify() PRODUCT_RETURN;
  97 
  98  private:
  99 
 100   void calculate_totals(){
 101     _sum = (T)0;
 102     for (uint i = 0; i < _length; ++i) {
 103       _sum += _data[i];
 104     }
 105     _average = (double)_sum / (double)_length;
 106     _has_new_data = false;
 107   }
 108 };
 109 
 110 class GCPhaseTimeTracker VALUE_OBJ_CLASS_SPEC {
 111 private:
 112   friend class G1GCPhaseTimes;
 113 
 114   WorkerDataArray<double>** _data;
 115   uint _num_phases;
 116   uint _worker_id;
 117 public:
 118   GCPhaseTimeTracker(WorkerDataArray<double>** data, uint num_phases, uint worker_id) :
 119     _data(data), _num_phases(num_phases), _worker_id(worker_id) { }
 120 
 121   bool active() const { return _num_phases > 0; }
 122 
 123   void set_value(uint phase, double value) {
 124     assert(_data != NULL, "just checking");
 125     _data[phase]->set(_worker_id, value);
 126   }
 127 };
 128 
 129 class G1GCPhaseTimes : public CHeapObj<mtGC> {
 130 
 131  private:
 132   uint _active_gc_threads;
 133   uint _max_gc_threads;
 134   uint _num_ext_root_scan_phases;
 135 
 136   bool track_ext_root_scan_phases() const { return _num_ext_root_scan_phases > 0; }
 137 
 138   WorkerDataArray<double> _last_gc_worker_start_times_ms;
 139   WorkerDataArray<double> _last_ext_root_scan_times_ms;
 140   WorkerDataArray<double>** _last_ext_root_scan_phase_times_ms;
 141   WorkerDataArray<double> _last_satb_filtering_times_ms;
 142   WorkerDataArray<double> _last_update_rs_times_ms;
 143   WorkerDataArray<int>    _last_update_rs_processed_buffers;


   1 /*
   2  * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  90     return _sum;
  91   }
  92 
  93   void print(int level, const char* title);
  94 
  95   void reset() PRODUCT_RETURN;
  96   void verify() PRODUCT_RETURN;
  97 
  98  private:
  99 
 100   void calculate_totals(){
 101     _sum = (T)0;
 102     for (uint i = 0; i < _length; ++i) {
 103       _sum += _data[i];
 104     }
 105     _average = (double)_sum / (double)_length;
 106     _has_new_data = false;
 107   }
 108 };
 109 
 110 class GCPhaseTimeData : public PhaseTimeData {
 111 private:


 112   WorkerDataArray<double>** _data;
 113   uint _num_phases;
 114   uint _worker_id;
 115 public:
 116   GCPhaseTimeData(WorkerDataArray<double>** data, uint num_phases, uint worker_id) :
 117     _data(data), _num_phases(num_phases), _worker_id(worker_id) { }
 118 
 119   virtual bool active() const { return _num_phases > 0; }
 120 
 121   virtual void set_value(uint phase, double value) {
 122     assert(_data != NULL, "just checking");
 123     _data[phase]->set(_worker_id, value);
 124   }
 125 };
 126 
 127 class G1GCPhaseTimes : public CHeapObj<mtGC> {
 128 
 129  private:
 130   uint _active_gc_threads;
 131   uint _max_gc_threads;
 132   uint _num_ext_root_scan_phases;
 133 
 134   bool track_ext_root_scan_phases() const { return _num_ext_root_scan_phases > 0; }
 135 
 136   WorkerDataArray<double> _last_gc_worker_start_times_ms;
 137   WorkerDataArray<double> _last_ext_root_scan_times_ms;
 138   WorkerDataArray<double>** _last_ext_root_scan_phase_times_ms;
 139   WorkerDataArray<double> _last_satb_filtering_times_ms;
 140   WorkerDataArray<double> _last_update_rs_times_ms;
 141   WorkerDataArray<int>    _last_update_rs_processed_buffers;


< prev index next >