< prev index next >

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

Print this page
rev 13061 : imported patch 8178148-more-detailed-scan-rs-logging
rev 13062 : imported patch 8178148-sangheon-review
   1 /*
   2  * Copyright (c) 2013, 2016, 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  *


  59     ScanHCC,
  60     ScanRS,
  61     CodeRoots,
  62 #if INCLUDE_AOT
  63     AOTCodeRoots,
  64 #endif
  65     ObjCopy,
  66     Termination,
  67     Other,
  68     GCWorkerTotal,
  69     GCWorkerEnd,
  70     StringDedupQueueFixup,
  71     StringDedupTableFixup,
  72     RedirtyCards,
  73     PreserveCMReferents,
  74     YoungFreeCSet,
  75     NonYoungFreeCSet,
  76     GCParPhasesSentinel
  77   };
  78 






  79  private:
  80   // Markers for grouping the phases in the GCPhases enum above
  81   static const int GCMainParPhasesLast = GCWorkerEnd;
  82   static const int StringDedupPhasesFirst = StringDedupQueueFixup;
  83   static const int StringDedupPhasesLast = StringDedupTableFixup;
  84 
  85   WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];

  86   WorkerDataArray<size_t>* _update_rs_processed_buffers;





  87   WorkerDataArray<size_t>* _termination_attempts;

  88   WorkerDataArray<size_t>* _redirtied_cards;
  89 
  90   double _cur_collection_par_time_ms;
  91   double _cur_collection_code_root_fixup_time_ms;
  92   double _cur_strong_code_root_purge_time_ms;
  93 
  94   double _cur_evac_fail_recalc_used;
  95   double _cur_evac_fail_restore_remsets;
  96   double _cur_evac_fail_remove_self_forwards;
  97 
  98   double _cur_string_dedup_fixup_time_ms;
  99 
 100   double _cur_prepare_tlab_time_ms;
 101   double _cur_resize_tlab_time_ms;
 102 
 103   double _cur_derived_pointer_table_update_time_ms;
 104 
 105   double _cur_clear_ct_time_ms;
 106   double _cur_expand_heap_time_ms;
 107   double _cur_ref_proc_time_ms;


 153   void debug_time(const char* name, double value) const;
 154   void trace_time(const char* name, double value) const;
 155   void trace_count(const char* name, size_t value) const;
 156 
 157   double print_pre_evacuate_collection_set() const;
 158   double print_evacuate_collection_set() const;
 159   double print_post_evacuate_collection_set() const;
 160   void print_other(double accounted_ms) const;
 161 
 162  public:
 163   G1GCPhaseTimes(uint max_gc_threads);
 164   void note_gc_start();
 165   void print();
 166 
 167   // record the time a phase took in seconds
 168   void record_time_secs(GCParPhases phase, uint worker_i, double secs);
 169 
 170   // add a number of seconds to a phase
 171   void add_time_secs(GCParPhases phase, uint worker_i, double secs);
 172 
 173   void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count);
 174 
 175   // return the average time for a phase in milliseconds
 176   double average_time_ms(GCParPhases phase);
 177 
 178   size_t sum_thread_work_items(GCParPhases phase);
 179 
 180  public:
 181 
 182   void record_prepare_tlab_time_ms(double ms) {
 183     _cur_prepare_tlab_time_ms = ms;
 184   }
 185 
 186   void record_resize_tlab_time_ms(double ms) {
 187     _cur_resize_tlab_time_ms = ms;
 188   }
 189 
 190   void record_derived_pointer_table_update_time(double ms) {
 191     _cur_derived_pointer_table_update_time_ms = ms;
 192   }
 193 
 194   void record_clear_ct_time(double ms) {
 195     _cur_clear_ct_time_ms = ms;
 196   }
 197 
 198   void record_expand_heap_time(double ms) {


   1 /*
   2  * Copyright (c) 2013, 2017, 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  *


  59     ScanHCC,
  60     ScanRS,
  61     CodeRoots,
  62 #if INCLUDE_AOT
  63     AOTCodeRoots,
  64 #endif
  65     ObjCopy,
  66     Termination,
  67     Other,
  68     GCWorkerTotal,
  69     GCWorkerEnd,
  70     StringDedupQueueFixup,
  71     StringDedupTableFixup,
  72     RedirtyCards,
  73     PreserveCMReferents,
  74     YoungFreeCSet,
  75     NonYoungFreeCSet,
  76     GCParPhasesSentinel
  77   };
  78 
  79   enum GCScanRSWorkItems {
  80     ScannedCards,
  81     ClaimedCards,
  82     SkippedCards
  83   };
  84 
  85  private:
  86   // Markers for grouping the phases in the GCPhases enum above
  87   static const int GCMainParPhasesLast = GCWorkerEnd;
  88   static const int StringDedupPhasesFirst = StringDedupQueueFixup;
  89   static const int StringDedupPhasesLast = StringDedupTableFixup;
  90 
  91   WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
  92 
  93   WorkerDataArray<size_t>* _update_rs_processed_buffers;
  94 
  95   WorkerDataArray<size_t>* _scan_rs_scanned_cards;
  96   WorkerDataArray<size_t>* _scan_rs_claimed_cards;
  97   WorkerDataArray<size_t>* _scan_rs_skipped_cards;
  98 
  99   WorkerDataArray<size_t>* _termination_attempts;
 100 
 101   WorkerDataArray<size_t>* _redirtied_cards;
 102 
 103   double _cur_collection_par_time_ms;
 104   double _cur_collection_code_root_fixup_time_ms;
 105   double _cur_strong_code_root_purge_time_ms;
 106 
 107   double _cur_evac_fail_recalc_used;
 108   double _cur_evac_fail_restore_remsets;
 109   double _cur_evac_fail_remove_self_forwards;
 110 
 111   double _cur_string_dedup_fixup_time_ms;
 112 
 113   double _cur_prepare_tlab_time_ms;
 114   double _cur_resize_tlab_time_ms;
 115 
 116   double _cur_derived_pointer_table_update_time_ms;
 117 
 118   double _cur_clear_ct_time_ms;
 119   double _cur_expand_heap_time_ms;
 120   double _cur_ref_proc_time_ms;


 166   void debug_time(const char* name, double value) const;
 167   void trace_time(const char* name, double value) const;
 168   void trace_count(const char* name, size_t value) const;
 169 
 170   double print_pre_evacuate_collection_set() const;
 171   double print_evacuate_collection_set() const;
 172   double print_post_evacuate_collection_set() const;
 173   void print_other(double accounted_ms) const;
 174 
 175  public:
 176   G1GCPhaseTimes(uint max_gc_threads);
 177   void note_gc_start();
 178   void print();
 179 
 180   // record the time a phase took in seconds
 181   void record_time_secs(GCParPhases phase, uint worker_i, double secs);
 182 
 183   // add a number of seconds to a phase
 184   void add_time_secs(GCParPhases phase, uint worker_i, double secs);
 185 
 186   void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
 187 
 188   // return the average time for a phase in milliseconds
 189   double average_time_ms(GCParPhases phase);
 190 
 191   size_t sum_thread_work_items(GCParPhases phase, uint index = 0);
 192 
 193  public:
 194 
 195   void record_prepare_tlab_time_ms(double ms) {
 196     _cur_prepare_tlab_time_ms = ms;
 197   }
 198 
 199   void record_resize_tlab_time_ms(double ms) {
 200     _cur_resize_tlab_time_ms = ms;
 201   }
 202 
 203   void record_derived_pointer_table_update_time(double ms) {
 204     _cur_derived_pointer_table_update_time_ms = ms;
 205   }
 206 
 207   void record_clear_ct_time(double ms) {
 208     _cur_clear_ct_time_ms = ms;
 209   }
 210 
 211   void record_expand_heap_time(double ms) {


< prev index next >