< prev index next >
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
Print this page
*** 35,45 ****
#include "logging/logStream.hpp"
#include "runtime/timer.hpp"
#include "runtime/os.hpp"
#include "utilities/macros.hpp"
! static const char* Indents[5] = {"", " ", " ", " ", " "};
G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_max_gc_threads(max_gc_threads),
_gc_start_counter(0),
_gc_pause_time_ms(0.0),
--- 35,51 ----
#include "logging/logStream.hpp"
#include "runtime/timer.hpp"
#include "runtime/os.hpp"
#include "utilities/macros.hpp"
! static void generate_indent(int num_indent, char* buf, size_t buflen){
! if (num_indent <= 0) {
! *buf = '\0';
! } else {
! jio_snprintf(buf, buflen, "%*c", num_indent * 2, ' ');
! }
! }
G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_max_gc_threads(max_gc_threads),
_gc_start_counter(0),
_gc_pause_time_ms(0.0),
*** 307,326 ****
phase->print_details_on(&ls);
}
}
void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum) const {
! out->print("%s", Indents[indent]);
phase->print_summary_on(out, print_sum);
! details(phase, Indents[indent]);
for (uint i = 0; i < phase->MaxThreadWorkItems; i++) {
WorkerDataArray<size_t>* work_items = phase->thread_work_items(i);
if (work_items != NULL) {
! out->print("%s", Indents[indent + 1]);
work_items->print_summary_on(out, true);
! details(work_items, Indents[indent + 1]);
}
}
}
void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase, uint extra_indent) const {
--- 313,335 ----
phase->print_details_on(&ls);
}
}
void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum) const {
! char buf[O_BUFLEN];
! generate_indent(indent, buf, O_BUFLEN);
! out->print("%s", buf);
phase->print_summary_on(out, print_sum);
! details(phase, buf);
for (uint i = 0; i < phase->MaxThreadWorkItems; i++) {
WorkerDataArray<size_t>* work_items = phase->thread_work_items(i);
if (work_items != NULL) {
! generate_indent(indent + 1, buf, O_BUFLEN);
! out->print("%s", buf);
work_items->print_summary_on(out, true);
! details(work_items, buf);
}
}
}
void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase, uint extra_indent) const {
*** 341,376 ****
}
#define TIME_FORMAT "%.1lfms"
void G1GCPhaseTimes::info_time(const char* name, double value) const {
! log_info(gc, phases)("%s%s: " TIME_FORMAT, Indents[1], name, value);
}
void G1GCPhaseTimes::debug_time(const char* name, double value) const {
! log_debug(gc, phases)("%s%s: " TIME_FORMAT, Indents[2], name, value);
}
void G1GCPhaseTimes::debug_time_for_reference(const char* name, double value) const {
LogTarget(Debug, gc, phases) lt;
LogTarget(Debug, gc, phases, ref) lt2;
if (lt.is_enabled()) {
LogStream ls(lt);
! ls.print_cr("%s%s: " TIME_FORMAT, Indents[2], name, value);
} else if (lt2.is_enabled()) {
LogStream ls(lt2);
! ls.print_cr("%s%s: " TIME_FORMAT, Indents[2], name, value);
}
}
void G1GCPhaseTimes::trace_time(const char* name, double value) const {
! log_trace(gc, phases)("%s%s: " TIME_FORMAT, Indents[3], name, value);
}
void G1GCPhaseTimes::trace_count(const char* name, size_t value) const {
! log_trace(gc, phases)("%s%s: " SIZE_FORMAT, Indents[3], name, value);
}
double G1GCPhaseTimes::print_pre_evacuate_collection_set() const {
const double sum_ms = _root_region_scan_wait_time_ms +
_recorded_young_cset_choice_time_ms +
--- 350,396 ----
}
#define TIME_FORMAT "%.1lfms"
void G1GCPhaseTimes::info_time(const char* name, double value) const {
! char buf[O_BUFLEN];
! generate_indent(1, buf, O_BUFLEN);
! log_info(gc, phases)("%s%s: " TIME_FORMAT, buf, name, value);
}
void G1GCPhaseTimes::debug_time(const char* name, double value) const {
! char buf[O_BUFLEN];
! generate_indent(2, buf, O_BUFLEN);
! log_debug(gc, phases)("%s%s: " TIME_FORMAT, buf, name, value);
}
void G1GCPhaseTimes::debug_time_for_reference(const char* name, double value) const {
+ char buf[O_BUFLEN];
+ generate_indent(2, buf, O_BUFLEN);
+
LogTarget(Debug, gc, phases) lt;
LogTarget(Debug, gc, phases, ref) lt2;
if (lt.is_enabled()) {
LogStream ls(lt);
! ls.print_cr("%s%s: " TIME_FORMAT, buf, name, value);
} else if (lt2.is_enabled()) {
LogStream ls(lt2);
! ls.print_cr("%s%s: " TIME_FORMAT, buf, name, value);
}
}
void G1GCPhaseTimes::trace_time(const char* name, double value) const {
! char buf[O_BUFLEN];
! generate_indent(3, buf, O_BUFLEN);
! log_trace(gc, phases)("%s%s: " TIME_FORMAT, buf, name, value);
}
void G1GCPhaseTimes::trace_count(const char* name, size_t value) const {
! char buf[O_BUFLEN];
! generate_indent(3, buf, O_BUFLEN);
! log_trace(gc, phases)("%s%s: " SIZE_FORMAT, buf, name, value);
}
double G1GCPhaseTimes::print_pre_evacuate_collection_set() const {
const double sum_ms = _root_region_scan_wait_time_ms +
_recorded_young_cset_choice_time_ms +
< prev index next >