< 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,7 +1,7 @@
/*
- * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -105,18 +105,39 @@
_average = (double)_sum / (double)_length;
_has_new_data = false;
}
};
+class GCPhaseTimeData : public PhaseTimeData {
+private:
+ WorkerDataArray<double>** _data;
+ uint _num_phases;
+ uint _worker_id;
+public:
+ GCPhaseTimeData(WorkerDataArray<double>** data, uint num_phases, uint worker_id) :
+ _data(data), _num_phases(num_phases), _worker_id(worker_id) { }
+
+ virtual bool active() const { return _num_phases > 0; }
+
+ virtual void set_value(uint phase, double value) {
+ assert(_data != NULL, "just checking");
+ _data[phase]->set(_worker_id, value);
+ }
+};
+
class G1GCPhaseTimes : public CHeapObj<mtGC> {
private:
uint _active_gc_threads;
uint _max_gc_threads;
+ uint _num_ext_root_scan_phases;
+
+ bool track_ext_root_scan_phases() const { return _num_ext_root_scan_phases > 0; }
WorkerDataArray<double> _last_gc_worker_start_times_ms;
WorkerDataArray<double> _last_ext_root_scan_times_ms;
+ WorkerDataArray<double>** _last_ext_root_scan_phase_times_ms;
WorkerDataArray<double> _last_satb_filtering_times_ms;
WorkerDataArray<double> _last_update_rs_times_ms;
WorkerDataArray<int> _last_update_rs_processed_buffers;
WorkerDataArray<double> _last_scan_rs_times_ms;
WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
@@ -169,11 +190,16 @@
void print_stats(int level, const char* str, double value);
void print_stats(int level, const char* str, size_t value);
void print_stats(int level, const char* str, double value, uint workers);
public:
- G1GCPhaseTimes(uint max_gc_threads);
+ G1GCPhaseTimes(uint max_gc_threads, uint num_ext_root_scan_phases);
+ virtual ~G1GCPhaseTimes();
+
+ WorkerDataArray<double>** get_ext_root_scan_phase_times() const { return _last_ext_root_scan_phase_times_ms; }
+ uint num_ext_root_scan_phases() const { return _num_ext_root_scan_phases; }
+
void note_gc_start(uint active_gc_threads);
void note_gc_end();
void print(double pause_time_sec);
void record_gc_worker_start_time(uint worker_i, double ms) {
< prev index next >