< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp

Print this page

  1 /*
  2  * Copyright (c) 2017, 2021, Red Hat, Inc. 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  *

 27 
 28 #include "jfr/jfrEvents.hpp"
 29 #include "gc/shenandoah/shenandoahNumberSeq.hpp"
 30 #include "gc/shared/workerDataArray.hpp"
 31 #include "memory/allocation.hpp"
 32 
 33 class ShenandoahCollectorPolicy;
 34 class outputStream;
 35 
 36 #define SHENANDOAH_PAR_PHASE_DO(CNT_PREFIX, DESC_PREFIX, f)                            \
 37   f(CNT_PREFIX ## TotalWork,                DESC_PREFIX "<total>")                     \
 38   f(CNT_PREFIX ## ThreadRoots,              DESC_PREFIX "Thread Roots")                \
 39   f(CNT_PREFIX ## CodeCacheRoots,           DESC_PREFIX "Code Cache Roots")            \
 40   f(CNT_PREFIX ## VMStrongRoots,            DESC_PREFIX "VM Strong Roots")             \
 41   f(CNT_PREFIX ## VMWeakRoots,              DESC_PREFIX "VM Weak Roots")               \
 42   f(CNT_PREFIX ## CLDGRoots,                DESC_PREFIX "CLDG Roots")                  \
 43   f(CNT_PREFIX ## CodeCacheUnload,          DESC_PREFIX "Unload Code Caches")          \
 44   f(CNT_PREFIX ## CLDUnlink,                DESC_PREFIX "Unlink CLDs")                 \
 45   f(CNT_PREFIX ## WeakRefProc,              DESC_PREFIX "Weak References")             \
 46   f(CNT_PREFIX ## ParallelMark,             DESC_PREFIX "Parallel Mark")               \

 47   // end
 48 
 49 #define SHENANDOAH_PHASE_DO(f)                                                         \
 50   f(conc_reset,                                     "Concurrent Reset")                \
 51                                                                                        \
 52   f(init_mark_gross,                                "Pause Init Mark (G)")             \
 53   f(init_mark,                                      "Pause Init Mark (N)")             \
 54   f(init_manage_tlabs,                              "  Manage TLABs")                  \


 55   f(init_update_region_states,                      "  Update Region States")          \
 56                                                                                        \



 57   f(conc_mark_roots,                                "Concurrent Mark Roots ")          \
 58   SHENANDOAH_PAR_PHASE_DO(conc_mark_roots,          "  CMR: ", f)                      \
 59   f(conc_mark,                                      "Concurrent Marking")              \

 60   f(conc_mark_satb_flush,                           "  Flush SATB")                    \
 61                                                                                        \
 62   f(final_mark_gross,                               "Pause Final Mark (G)")            \
 63   f(final_mark,                                     "Pause Final Mark (N)")            \
 64   f(finish_mark,                                    "  Finish Mark")                   \
 65   SHENANDOAH_PAR_PHASE_DO(finish_mark_,             "    FM: ", f)                     \
 66   f(purge,                                          "  System Purge")                  \
 67   SHENANDOAH_PAR_PHASE_DO(purge_cu_par_,            "      CU: ", f)                   \
 68   f(purge_weak_par,                                 "    Weak Roots")                  \
 69   SHENANDOAH_PAR_PHASE_DO(purge_weak_par_,          "      WR: ", f)                   \
 70   f(final_update_region_states,                     "  Update Region States")          \
 71   f(final_manage_labs,                              "  Manage GC/TLABs")               \
 72   f(choose_cset,                                    "  Choose Collection Set")         \
 73   f(final_rebuild_freeset,                          "  Rebuild Free Set")              \
 74   f(init_evac,                                      "  Initial Evacuation")            \
 75   SHENANDOAH_PAR_PHASE_DO(evac_,                    "    E: ", f)                      \
 76                                                                                        \
 77   f(conc_thread_roots,                              "Concurrent Thread Roots")         \
 78   SHENANDOAH_PAR_PHASE_DO(conc_thread_roots_,       "  CTR: ", f)                      \
 79   f(conc_weak_refs,                                 "Concurrent Weak References")      \
 80   SHENANDOAH_PAR_PHASE_DO(conc_weak_refs_,          "  CWRF: ", f)                     \
 81   f(conc_weak_roots,                                "Concurrent Weak Roots")           \
 82   f(conc_weak_roots_work,                           "  Roots")                         \
 83   SHENANDOAH_PAR_PHASE_DO(conc_weak_roots_work_,    "    CWR: ", f)                    \
 84   f(conc_weak_roots_rendezvous,                     "  Rendezvous")                    \
 85   f(conc_cleanup_early,                             "Concurrent Cleanup")              \
 86   f(conc_class_unload,                              "Concurrent Class Unloading")      \
 87   f(conc_class_unload_unlink,                       "  Unlink Stale")                  \
 88   f(conc_class_unload_unlink_sd,                    "    System Dictionary")           \
 89   f(conc_class_unload_unlink_weak_klass,            "    Weak Class Links")            \
 90   f(conc_class_unload_unlink_code_roots,            "    Code Roots")                  \
 91   f(conc_class_unload_rendezvous,                   "  Rendezvous")                    \
 92   f(conc_class_unload_purge,                        "  Purge Unlinked")                \
 93   f(conc_class_unload_purge_coderoots,              "    Code Roots")                  \
 94   f(conc_class_unload_purge_cldg,                   "    CLDG")                        \
 95   f(conc_class_unload_purge_ec,                     "    Exception Caches")            \
 96   f(conc_strong_roots,                              "Concurrent Strong Roots")         \
 97   SHENANDOAH_PAR_PHASE_DO(conc_strong_roots_,       "  CSR: ", f)                      \
 98   f(conc_evac,                                      "Concurrent Evacuation")           \
 99                                                                                        \
100   f(final_roots_gross,                              "Pause Final Roots (G)")           \
101   f(final_roots,                                    "Pause Final Roots (N)")           \
102                                                                                        \
103   f(init_update_refs_gross,                         "Pause Init Update Refs (G)")      \
104   f(init_update_refs,                               "Pause Init Update Refs (N)")      \
105   f(init_update_refs_manage_gclabs,                 "  Manage GCLABs")                 \
106                                                                                        \
107   f(conc_update_refs,                               "Concurrent Update Refs")          \
108   f(conc_update_thread_roots,                       "Concurrent Update Thread Roots")  \
109                                                                                        \
110   f(final_update_refs_gross,                        "Pause Final Update Refs (G)")     \
111   f(final_update_refs,                              "Pause Final Update Refs (N)")     \
112   f(final_update_refs_finish_work,                  "  Finish Work")                   \
113   f(final_update_refs_update_region_states,         "  Update Region States")          \
114   f(final_update_refs_trash_cset,                   "  Trash Collection Set")          \
115   f(final_update_refs_rebuild_freeset,              "  Rebuild Free Set")              \
116                                                                                        \
117   f(conc_cleanup_complete,                          "Concurrent Cleanup")              \


118                                                                                        \
119   f(degen_gc_gross,                                 "Pause Degenerated GC (G)")        \
120   f(degen_gc,                                       "Pause Degenerated GC (N)")        \
121   f(degen_gc_stw_mark,                              "  Degen STW Mark")                \
122   SHENANDOAH_PAR_PHASE_DO(degen_gc_stw_mark_,       "    DSM: ", f)                    \
123   f(degen_gc_mark,                                  "  Degen Mark")                    \
124   SHENANDOAH_PAR_PHASE_DO(degen_gc_mark_,           "    DM: ", f)                     \
125   f(degen_gc_purge,                                 "    System Purge")                \
126   f(degen_gc_weakrefs,                              "      Weak References")           \
127   SHENANDOAH_PAR_PHASE_DO(degen_gc_weakrefs_p_,     "        WRP: ", f)                \
128   f(degen_gc_purge_class_unload,                    "      Unload Classes")            \
129   SHENANDOAH_PAR_PHASE_DO(degen_gc_purge_cu_par_,   "        DCU: ", f)                \
130   f(degen_gc_purge_weak_par,                        "      Weak Roots")                \
131   SHENANDOAH_PAR_PHASE_DO(degen_gc_purge_weak_p_,   "        DWR: ", f)                \
132   f(degen_gc_purge_cldg,                            "      CLDG")                      \
133   f(degen_gc_final_update_region_states,            "  Update Region States")          \
134   f(degen_gc_final_manage_labs,                     "  Manage GC/TLABs")               \
135   f(degen_gc_choose_cset,                           "  Choose Collection Set")         \
136   f(degen_gc_final_rebuild_freeset,                 "  Rebuild Free Set")              \
137   f(degen_gc_stw_evac,                              "  Evacuation")                    \
138   f(degen_gc_init_update_refs_manage_gclabs,        "  Manage GCLABs")                 \
139   f(degen_gc_updaterefs,                            "  Update References")             \
140   f(degen_gc_final_update_refs_finish_work,         "  Finish Work")                   \
141   f(degen_gc_final_update_refs_update_region_states,"  Update Region States")          \
142   f(degen_gc_final_update_refs_trash_cset,          "  Trash Collection Set")          \
143   f(degen_gc_final_update_refs_rebuild_freeset,     "  Rebuild Free Set")              \
144   f(degen_gc_update_roots,                          "  Degen Update Roots")            \
145   SHENANDOAH_PAR_PHASE_DO(degen_gc_update_,         "    DU: ", f)                     \
146   f(degen_gc_cleanup_complete,                      "  Cleanup")                       \



147                                                                                        \
148   f(full_gc_gross,                                  "Pause Full GC (G)")               \
149   f(full_gc,                                        "Pause Full GC (N)")               \
150   f(full_gc_heapdump_pre,                           "  Pre Heap Dump")                 \
151   f(full_gc_prepare,                                "  Prepare")                       \
152   f(full_gc_update_roots,                           "    Update Roots")                \
153   SHENANDOAH_PAR_PHASE_DO(full_gc_update_roots_,    "      FU: ", f)                   \
154   f(full_gc_mark,                                   "  Mark")                          \
155   SHENANDOAH_PAR_PHASE_DO(full_gc_mark_,            "    FM: ", f)                     \
156   f(full_gc_purge,                                  "    System Purge")                \
157   f(full_gc_weakrefs,                               "      Weak References")           \
158   SHENANDOAH_PAR_PHASE_DO(full_gc_weakrefs_p_,      "        WRP: ", f)                \
159   f(full_gc_purge_class_unload,                     "      Unload Classes")            \
160   SHENANDOAH_PAR_PHASE_DO(full_gc_purge_cu_par_,    "        CU: ", f)                 \
161   f(full_gc_purge_weak_par,                         "      Weak Roots")                \
162   SHENANDOAH_PAR_PHASE_DO(full_gc_purge_weak_p_,    "        WR: ", f)                 \
163   f(full_gc_purge_cldg,                             "      CLDG")                      \
164   f(full_gc_calculate_addresses,                    "  Calculate Addresses")           \
165   f(full_gc_calculate_addresses_regular,            "    Regular Objects")             \
166   f(full_gc_calculate_addresses_humong,             "    Humongous Objects")           \
167   f(full_gc_adjust_pointers,                        "  Adjust Pointers")               \
168   f(full_gc_adjust_roots,                           "  Adjust Roots")                  \
169   SHENANDOAH_PAR_PHASE_DO(full_gc_adjust_roots_,    "    FA: ", f)                     \
170   f(full_gc_copy_objects,                           "  Copy Objects")                  \
171   f(full_gc_copy_objects_regular,                   "    Regular Objects")             \
172   f(full_gc_copy_objects_humong,                    "    Humongous Objects")           \

173   f(full_gc_copy_objects_reset_complete,            "    Reset Complete Bitmap")       \
174   f(full_gc_copy_objects_rebuild,                   "    Rebuild Region Sets")         \

175   f(full_gc_heapdump_post,                          "  Post Heap Dump")                \
176                                                                                        \
177   f(conc_uncommit,                                  "Concurrent Uncommit")             \
178   f(pacing,                                         "Pacing")                          \
179                                                                                        \
180   f(heap_iteration_roots,                           "Heap Iteration")                  \
181   SHENANDOAH_PAR_PHASE_DO(heap_iteration_roots_,    "  HI: ", f)                       \
182   // end
183 
184 typedef WorkerDataArray<double> ShenandoahWorkerData;
185 
186 class ShenandoahPhaseTimings : public CHeapObj<mtGC> {
187   friend class ShenandoahGCPhase;
188   friend class ShenandoahWorkerTimingsTracker;
189 public:
190 #define SHENANDOAH_PHASE_DECLARE_ENUM(type, title)   type,
191 
192   enum Phase {
193     SHENANDOAH_PHASE_DO(SHENANDOAH_PHASE_DECLARE_ENUM)
194     _num_phases,

233 
234   static const char* phase_name(Phase phase) {
235     assert(phase >= 0 && phase < _num_phases, "Out of bound");
236     return _phase_names[phase];
237   }
238 
239   void print_cycle_on(outputStream* out) const;
240   void print_global_on(outputStream* out) const;
241 };
242 
243 class ShenandoahWorkerTimingsTracker : public StackObj {
244 private:
245   ShenandoahPhaseTimings*          const _timings;
246   ShenandoahPhaseTimings::Phase    const _phase;
247   ShenandoahPhaseTimings::ParPhase const _par_phase;
248   uint const _worker_id;
249 
250   double _start_time;
251   EventGCPhaseParallel _event;
252 public:
253   ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase, uint worker_id);



254   ~ShenandoahWorkerTimingsTracker();
255 };
256 
257 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHPHASETIMINGS_HPP

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

 28 
 29 #include "jfr/jfrEvents.hpp"
 30 #include "gc/shenandoah/shenandoahNumberSeq.hpp"
 31 #include "gc/shared/workerDataArray.hpp"
 32 #include "memory/allocation.hpp"
 33 
 34 class ShenandoahCollectorPolicy;
 35 class outputStream;
 36 
 37 #define SHENANDOAH_PAR_PHASE_DO(CNT_PREFIX, DESC_PREFIX, f)                            \
 38   f(CNT_PREFIX ## TotalWork,                DESC_PREFIX "<total>")                     \
 39   f(CNT_PREFIX ## ThreadRoots,              DESC_PREFIX "Thread Roots")                \
 40   f(CNT_PREFIX ## CodeCacheRoots,           DESC_PREFIX "Code Cache Roots")            \
 41   f(CNT_PREFIX ## VMStrongRoots,            DESC_PREFIX "VM Strong Roots")             \
 42   f(CNT_PREFIX ## VMWeakRoots,              DESC_PREFIX "VM Weak Roots")               \
 43   f(CNT_PREFIX ## CLDGRoots,                DESC_PREFIX "CLDG Roots")                  \
 44   f(CNT_PREFIX ## CodeCacheUnload,          DESC_PREFIX "Unload Code Caches")          \
 45   f(CNT_PREFIX ## CLDUnlink,                DESC_PREFIX "Unlink CLDs")                 \
 46   f(CNT_PREFIX ## WeakRefProc,              DESC_PREFIX "Weak References")             \
 47   f(CNT_PREFIX ## ParallelMark,             DESC_PREFIX "Parallel Mark")               \
 48   f(CNT_PREFIX ## ScanClusters,             DESC_PREFIX "Scan Clusters")               \
 49   // end
 50 
 51 #define SHENANDOAH_PHASE_DO(f)                                                         \
 52   f(conc_reset,                                     "Concurrent Reset")                \
 53   f(conc_reset_old,                                 "Concurrent Reset (OLD)")          \
 54   f(init_mark_gross,                                "Pause Init Mark (G)")             \
 55   f(init_mark,                                      "Pause Init Mark (N)")             \
 56   f(init_manage_tlabs,                              "  Manage TLABs")                  \
 57   f(init_swap_rset,                                 "  Swap Remembered Set")           \
 58   f(init_transfer_satb,                             "  Transfer Old From SATB")        \
 59   f(init_update_region_states,                      "  Update Region States")          \
 60                                                                                        \
 61   f(init_scan_rset,                                 "Concurrent Scan Remembered Set")  \
 62   SHENANDOAH_PAR_PHASE_DO(init_scan_rset_,          "  RS: ", f)                       \
 63                                                                                        \
 64   f(conc_mark_roots,                                "Concurrent Mark Roots ")          \
 65   SHENANDOAH_PAR_PHASE_DO(conc_mark_roots,          "  CMR: ", f)                      \
 66   f(conc_mark,                                      "Concurrent Marking")              \
 67   SHENANDOAH_PAR_PHASE_DO(conc_mark,                "  CM: ", f)                       \
 68   f(conc_mark_satb_flush,                           "  Flush SATB")                    \
 69                                                                                        \
 70   f(final_mark_gross,                               "Pause Final Mark (G)")            \
 71   f(final_mark,                                     "Pause Final Mark (N)")            \
 72   f(finish_mark,                                    "  Finish Mark")                   \
 73   SHENANDOAH_PAR_PHASE_DO(finish_mark_,             "    FM: ", f)                     \
 74   f(purge,                                          "  System Purge")                  \
 75   SHENANDOAH_PAR_PHASE_DO(purge_cu_par_,            "      CU: ", f)                   \
 76   f(purge_weak_par,                                 "    Weak Roots")                  \
 77   SHENANDOAH_PAR_PHASE_DO(purge_weak_par_,          "      WR: ", f)                   \
 78   f(final_update_region_states,                     "  Update Region States")          \
 79   f(final_manage_labs,                              "  Manage GC/TLABs")               \
 80   f(choose_cset,                                    "  Choose Collection Set")         \
 81   f(final_rebuild_freeset,                          "  Rebuild Free Set")              \
 82   f(init_evac,                                      "  Initial Evacuation")            \
 83   SHENANDOAH_PAR_PHASE_DO(evac_,                    "    E: ", f)                      \
 84                                                                                        \
 85   f(conc_thread_roots,                              "Concurrent Thread Roots")         \
 86   SHENANDOAH_PAR_PHASE_DO(conc_thread_roots_,       "  CTR: ", f)                      \
 87   f(conc_weak_refs,                                 "Concurrent Weak References")      \
 88   SHENANDOAH_PAR_PHASE_DO(conc_weak_refs_,          "  CWRF: ", f)                     \
 89   f(conc_weak_roots,                                "Concurrent Weak Roots")           \
 90   f(conc_weak_roots_work,                           "  Roots")                         \
 91   SHENANDOAH_PAR_PHASE_DO(conc_weak_roots_work_,    "    CWR: ", f)                    \
 92   f(conc_weak_roots_rendezvous,                     "  Rendezvous")                    \
 93   f(conc_cleanup_early,                             "Concurrent Cleanup")              \
 94   f(conc_class_unload,                              "Concurrent Class Unloading")      \
 95   f(conc_class_unload_unlink,                       "  Unlink Stale")                  \
 96   f(conc_class_unload_unlink_sd,                    "    System Dictionary")           \
 97   f(conc_class_unload_unlink_weak_klass,            "    Weak Class Links")            \
 98   f(conc_class_unload_unlink_code_roots,            "    Code Roots")                  \
 99   f(conc_class_unload_rendezvous,                   "  Rendezvous")                    \
100   f(conc_class_unload_purge,                        "  Purge Unlinked")                \
101   f(conc_class_unload_purge_coderoots,              "    Code Roots")                  \
102   f(conc_class_unload_purge_cldg,                   "    CLDG")                        \
103   f(conc_class_unload_purge_ec,                     "    Exception Caches")            \
104   f(conc_strong_roots,                              "Concurrent Strong Roots")         \
105   SHENANDOAH_PAR_PHASE_DO(conc_strong_roots_,       "  CSR: ", f)                      \
106   f(conc_evac,                                      "Concurrent Evacuation")           \
107   f(promote_in_place,                               "Concurrent Promote Regions")      \
108   f(final_roots_gross,                              "Pause Final Roots (G)")           \
109   f(final_roots,                                    "Pause Final Roots (N)")           \
110                                                                                        \
111   f(init_update_refs_gross,                         "Pause Init Update Refs (G)")      \
112   f(init_update_refs,                               "Pause Init Update Refs (N)")      \
113   f(init_update_refs_manage_gclabs,                 "  Manage GCLABs")                 \
114                                                                                        \
115   f(conc_update_refs,                               "Concurrent Update Refs")          \
116   f(conc_update_thread_roots,                       "Concurrent Update Thread Roots")  \
117                                                                                        \
118   f(final_update_refs_gross,                        "Pause Final Update Refs (G)")     \
119   f(final_update_refs,                              "Pause Final Update Refs (N)")     \
120   f(final_update_refs_finish_work,                  "  Finish Work")                   \
121   f(final_update_refs_update_region_states,         "  Update Region States")          \
122   f(final_update_refs_trash_cset,                   "  Trash Collection Set")          \
123   f(final_update_refs_rebuild_freeset,              "  Rebuild Free Set")              \
124                                                                                        \
125   f(conc_cleanup_complete,                          "Concurrent Cleanup")              \
126   f(conc_coalesce_and_fill,                         "Concurrent Coalesce and Fill")    \
127   SHENANDOAH_PAR_PHASE_DO(conc_coalesce_,           "  CC&F: ", f)                     \
128                                                                                        \
129   f(degen_gc_gross,                                 "Pause Degenerated GC (G)")        \
130   f(degen_gc,                                       "Pause Degenerated GC (N)")        \
131   f(degen_gc_stw_mark,                              "  Degen STW Mark")                \
132   SHENANDOAH_PAR_PHASE_DO(degen_gc_stw_mark_,       "    DSM: ", f)                    \
133   f(degen_gc_mark,                                  "  Degen Mark")                    \
134   SHENANDOAH_PAR_PHASE_DO(degen_gc_mark_,           "    DM: ", f)                     \
135   f(degen_gc_purge,                                 "    System Purge")                \
136   f(degen_gc_weakrefs,                              "      Weak References")           \
137   SHENANDOAH_PAR_PHASE_DO(degen_gc_weakrefs_p_,     "        WRP: ", f)                \
138   f(degen_gc_purge_class_unload,                    "      Unload Classes")            \
139   SHENANDOAH_PAR_PHASE_DO(degen_gc_purge_cu_par_,   "        DCU: ", f)                \
140   f(degen_gc_purge_weak_par,                        "      Weak Roots")                \
141   SHENANDOAH_PAR_PHASE_DO(degen_gc_purge_weak_p_,   "        DWR: ", f)                \
142   f(degen_gc_purge_cldg,                            "      CLDG")                      \
143   f(degen_gc_final_update_region_states,            "  Update Region States")          \
144   f(degen_gc_final_manage_labs,                     "  Manage GC/TLABs")               \
145   f(degen_gc_choose_cset,                           "  Choose Collection Set")         \
146   f(degen_gc_final_rebuild_freeset,                 "  Rebuild Free Set")              \
147   f(degen_gc_stw_evac,                              "  Evacuation")                    \
148   f(degen_gc_init_update_refs_manage_gclabs,        "  Manage GCLABs")                 \
149   f(degen_gc_updaterefs,                            "  Update References")             \
150   f(degen_gc_final_update_refs_finish_work,         "  Finish Work")                   \
151   f(degen_gc_final_update_refs_update_region_states,"  Update Region States")          \
152   f(degen_gc_final_update_refs_trash_cset,          "  Trash Collection Set")          \
153   f(degen_gc_final_update_refs_rebuild_freeset,     "  Rebuild Free Set")              \
154   f(degen_gc_update_roots,                          "  Degen Update Roots")            \
155   SHENANDOAH_PAR_PHASE_DO(degen_gc_update_,         "    DU: ", f)                     \
156   f(degen_gc_cleanup_complete,                      "  Cleanup")                       \
157   f(degen_gc_promote_regions,                       "  Degen Promote Regions")         \
158   f(degen_gc_coalesce_and_fill,                     "  Degen Coalesce and Fill")       \
159   SHENANDOAH_PAR_PHASE_DO(degen_coalesce_,          "    DC&F", f)                     \
160                                                                                        \
161   f(full_gc_gross,                                  "Pause Full GC (G)")               \
162   f(full_gc,                                        "Pause Full GC (N)")               \
163   f(full_gc_heapdump_pre,                           "  Pre Heap Dump")                 \
164   f(full_gc_prepare,                                "  Prepare")                       \
165   f(full_gc_update_roots,                           "    Update Roots")                \
166   SHENANDOAH_PAR_PHASE_DO(full_gc_update_roots_,    "      FU: ", f)                   \
167   f(full_gc_mark,                                   "  Mark")                          \
168   SHENANDOAH_PAR_PHASE_DO(full_gc_mark_,            "    FM: ", f)                     \
169   f(full_gc_purge,                                  "    System Purge")                \
170   f(full_gc_weakrefs,                               "      Weak References")           \
171   SHENANDOAH_PAR_PHASE_DO(full_gc_weakrefs_p_,      "        WRP: ", f)                \
172   f(full_gc_purge_class_unload,                     "      Unload Classes")            \
173   SHENANDOAH_PAR_PHASE_DO(full_gc_purge_cu_par_,    "        CU: ", f)                 \
174   f(full_gc_purge_weak_par,                         "      Weak Roots")                \
175   SHENANDOAH_PAR_PHASE_DO(full_gc_purge_weak_p_,    "        WR: ", f)                 \
176   f(full_gc_purge_cldg,                             "      CLDG")                      \
177   f(full_gc_calculate_addresses,                    "  Calculate Addresses")           \
178   f(full_gc_calculate_addresses_regular,            "    Regular Objects")             \
179   f(full_gc_calculate_addresses_humong,             "    Humongous Objects")           \
180   f(full_gc_adjust_pointers,                        "  Adjust Pointers")               \
181   f(full_gc_adjust_roots,                           "  Adjust Roots")                  \
182   SHENANDOAH_PAR_PHASE_DO(full_gc_adjust_roots_,    "    FA: ", f)                     \
183   f(full_gc_copy_objects,                           "  Copy Objects")                  \
184   f(full_gc_copy_objects_regular,                   "    Regular Objects")             \
185   f(full_gc_copy_objects_humong,                    "    Humongous Objects")           \
186   f(full_gc_recompute_generation_usage,             "    Recompute generation usage")  \
187   f(full_gc_copy_objects_reset_complete,            "    Reset Complete Bitmap")       \
188   f(full_gc_copy_objects_rebuild,                   "    Rebuild Region Sets")         \
189   f(full_gc_reconstruct_remembered_set,             "    Reconstruct Remembered Set")  \
190   f(full_gc_heapdump_post,                          "  Post Heap Dump")                \
191                                                                                        \
192   f(conc_uncommit,                                  "Concurrent Uncommit")             \
193   f(pacing,                                         "Pacing")                          \
194                                                                                        \
195   f(heap_iteration_roots,                           "Heap Iteration")                  \
196   SHENANDOAH_PAR_PHASE_DO(heap_iteration_roots_,    "  HI: ", f)                       \
197   // end
198 
199 typedef WorkerDataArray<double> ShenandoahWorkerData;
200 
201 class ShenandoahPhaseTimings : public CHeapObj<mtGC> {
202   friend class ShenandoahGCPhase;
203   friend class ShenandoahWorkerTimingsTracker;
204 public:
205 #define SHENANDOAH_PHASE_DECLARE_ENUM(type, title)   type,
206 
207   enum Phase {
208     SHENANDOAH_PHASE_DO(SHENANDOAH_PHASE_DECLARE_ENUM)
209     _num_phases,

248 
249   static const char* phase_name(Phase phase) {
250     assert(phase >= 0 && phase < _num_phases, "Out of bound");
251     return _phase_names[phase];
252   }
253 
254   void print_cycle_on(outputStream* out) const;
255   void print_global_on(outputStream* out) const;
256 };
257 
258 class ShenandoahWorkerTimingsTracker : public StackObj {
259 private:
260   ShenandoahPhaseTimings*          const _timings;
261   ShenandoahPhaseTimings::Phase    const _phase;
262   ShenandoahPhaseTimings::ParPhase const _par_phase;
263   uint const _worker_id;
264 
265   double _start_time;
266   EventGCPhaseParallel _event;
267 public:
268   ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase,
269                                  ShenandoahPhaseTimings::ParPhase par_phase,
270                                  uint worker_id,
271                                  bool cumulative = false);
272   ~ShenandoahWorkerTimingsTracker();
273 };
274 
275 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHPHASETIMINGS_HPP
< prev index next >