< prev index next >
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
Print this page
rev 49680 : imported patch 6672778-partial-queue-trimming
rev 49681 : [mq]: 6672778-refactoring
*** 1,7 ****
/*
! * Copyright (c) 2013, 2017, 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.
--- 1,7 ----
/*
! * Copyright (c) 2013, 2018, 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.
*** 164,176 ****
_gc_start_counter = os::elapsed_counter();
reset();
}
#define ASSERT_PHASE_UNINITIALIZED(phase) \
! assert(_gc_par_phases[phase]->get(i) == uninitialized, "Phase " #phase " reported for thread that was not started");
double G1GCPhaseTimes::worker_time(GCParPhases phase, uint worker) {
double value = _gc_par_phases[phase]->get(worker);
if (value != WorkerDataArray<double>::uninitialized()) {
return value;
}
return 0.0;
--- 164,179 ----
_gc_start_counter = os::elapsed_counter();
reset();
}
#define ASSERT_PHASE_UNINITIALIZED(phase) \
! assert(_gc_par_phases[phase] == NULL || _gc_par_phases[phase]->get(i) == uninitialized, "Phase " #phase " reported for thread that was not started");
double G1GCPhaseTimes::worker_time(GCParPhases phase, uint worker) {
+ if (_gc_par_phases[phase] == NULL) {
+ return 0.0;
+ }
double value = _gc_par_phases[phase]->get(worker);
if (value != WorkerDataArray<double>::uninitialized()) {
return value;
}
return 0.0;
*** 189,198 ****
--- 192,202 ----
record_time_secs(GCWorkerTotal, i , total_worker_time);
double worker_known_time =
worker_time(ExtRootScan, i)
+ worker_time(SATBFiltering, i)
+ + worker_time(ScanHCC, i)
+ worker_time(UpdateRS, i)
+ worker_time(ScanRS, i)
+ worker_time(CodeRoots, i)
+ worker_time(ObjCopy, i)
+ worker_time(Termination, i);
*** 201,210 ****
--- 205,215 ----
} else {
// Make sure all slots are uninitialized since this thread did not seem to have been started
ASSERT_PHASE_UNINITIALIZED(GCWorkerEnd);
ASSERT_PHASE_UNINITIALIZED(ExtRootScan);
ASSERT_PHASE_UNINITIALIZED(SATBFiltering);
+ ASSERT_PHASE_UNINITIALIZED(ScanHCC);
ASSERT_PHASE_UNINITIALIZED(UpdateRS);
ASSERT_PHASE_UNINITIALIZED(ScanRS);
ASSERT_PHASE_UNINITIALIZED(CodeRoots);
ASSERT_PHASE_UNINITIALIZED(ObjCopy);
ASSERT_PHASE_UNINITIALIZED(Termination);
*** 222,231 ****
--- 227,241 ----
// add a number of seconds to a phase
void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
_gc_par_phases[phase]->add(worker_i, secs);
}
+ void G1GCPhaseTimes::move_time_secs(GCParPhases from, GCParPhases to, uint worker_i, double secs) {
+ add_time_secs(from, worker_i, -secs);
+ add_time_secs(to, worker_i, secs);
+ }
+
void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index) {
_gc_par_phases[phase]->set_thread_work_item(worker_i, count, index);
}
// return the average time for a phase in milliseconds
< prev index next >