Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit

Permalink
8256825: Cleanup WeakProcessorPhaseTimes
Browse files Browse the repository at this point in the history
Reviewed-by: sjohanss, stefank
  • Loading branch information
Kim Barrett committed Nov 23, 2020
1 parent 47a78e8 commit b50b99d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/hotspot/share/gc/shared/weakProcessorPhaseTimes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,27 @@ static const char* indent_str(size_t i) {

#define TIME_FORMAT "%.1lfms"

void WeakProcessorPhaseTimes::log_mt_phase_summary(WeakProcessorPhase phase,
uint indent) const {
void WeakProcessorPhaseTimes::log_phase_summary(WeakProcessorPhase phase,
uint indent) const {
LogTarget(Debug, gc, phases) lt;
LogStream ls(lt);
ls.print("%s", indents[indent]);
worker_data(phase)->print_summary_on(&ls, true);
log_mt_phase_details(worker_data(phase), indent + 1);
log_phase_details(worker_data(phase), indent + 1);

for (uint i = 0; i < worker_data(phase)->MaxThreadWorkItems; i++) {
WorkerDataArray<size_t>* work_items = worker_data(phase)->thread_work_items(i);
if (work_items != NULL) {
ls.print("%s", indents[indent + 1]);
work_items->print_summary_on(&ls, true);
log_mt_phase_details(work_items, indent + 1);
log_phase_details(work_items, indent + 1);
}
}
}

template <typename T>
void WeakProcessorPhaseTimes::log_mt_phase_details(WorkerDataArray<T>* data,
uint indent) const {
void WeakProcessorPhaseTimes::log_phase_details(WorkerDataArray<T>* data,
uint indent) const {
LogTarget(Trace, gc, phases) lt;
if (lt.is_enabled()) {
LogStream ls(lt);
Expand All @@ -205,7 +205,7 @@ void WeakProcessorPhaseTimes::log_print_phases(uint indent) const {
if (log_is_enabled(Debug, gc, phases)) {
typedef WeakProcessorPhases::Iterator Iterator;
for (Iterator it = WeakProcessorPhases::oopstorage_iterator(); !it.is_end(); ++it) {
log_mt_phase_summary(*it, indent);
log_phase_summary(*it, indent);
}
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/hotspot/share/gc/shared/weakProcessorPhaseTimes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

template<typename T> class WorkerDataArray;

class WeakProcessorPhaseTimes : public CHeapObj<mtGC> {
class WeakProcessorPhaseTimes {
enum {
DeadItems,
TotalItems
Expand All @@ -49,10 +49,9 @@ class WeakProcessorPhaseTimes : public CHeapObj<mtGC> {

WorkerDataArray<double>* worker_data(WeakProcessorPhase phase) const;

void log_st_phase(WeakProcessorPhase phase, uint indent) const;
void log_mt_phase_summary(WeakProcessorPhase phase, uint indent) const;
void log_phase_summary(WeakProcessorPhase phase, uint indent) const;
template <typename T>
void log_mt_phase_details(WorkerDataArray<T>* data, uint indent) const;
void log_phase_details(WorkerDataArray<T>* data, uint indent) const;

public:
WeakProcessorPhaseTimes(uint max_threads);
Expand All @@ -63,12 +62,9 @@ class WeakProcessorPhaseTimes : public CHeapObj<mtGC> {
void set_active_workers(uint n);

double total_time_sec() const;
double phase_time_sec(WeakProcessorPhase phase) const;
double worker_time_sec(uint worker_id, WeakProcessorPhase phase) const;

void record_total_time_sec(double time_sec);
void record_phase_time_sec(WeakProcessorPhase phase, double time_sec);
void record_phase_items(WeakProcessorPhase phase, size_t num_dead, size_t num_total);
void record_worker_time_sec(uint worker_id, WeakProcessorPhase phase, double time_sec);
void record_worker_items(uint worker_id, WeakProcessorPhase phase, size_t num_dead, size_t num_total);

Expand Down

0 comments on commit b50b99d

Please sign in to comment.