Commit 74145159 authored by ulan's avatar ulan Committed by Commit bot

[heap] Remove --print-cumulative-gc-stat flag.

The same information can be obtained by processing --trace-gc-nvp output
or using trace event and GC metric of catapult in Chrome.

BUG=

Review-Url: https://codereview.chromium.org/2361073002
Cr-Commit-Position: refs/heads/master@{#39780}
parent 4f02ff7e
......@@ -713,8 +713,6 @@ DEFINE_BOOL(trace_idle_notification, false,
"print one trace line following each idle notification")
DEFINE_BOOL(trace_idle_notification_verbose, false,
"prints the heap state used by the idle notification")
DEFINE_BOOL(print_cumulative_gc_stat, false,
"print cumulative GC statistics in name=value format on exit")
DEFINE_BOOL(print_max_heap_committed, false,
"print statistics of the maximum memory committed for the heap "
"in name=value format on exit")
......
......@@ -116,8 +116,6 @@ GCTracer::GCTracer(Heap* heap)
cumulative_incremental_marking_bytes_(0),
cumulative_incremental_marking_duration_(0.0),
cumulative_pure_incremental_marking_duration_(0.0),
cumulative_marking_duration_(0.0),
cumulative_sweeping_duration_(0.0),
allocation_time_ms_(0.0),
new_space_allocation_counter_bytes_(0),
old_generation_allocation_counter_bytes_(0),
......@@ -136,13 +134,11 @@ void GCTracer::ResetForTesting() {
cumulative_incremental_marking_bytes_ = 0.0;
cumulative_incremental_marking_duration_ = 0.0;
cumulative_pure_incremental_marking_duration_ = 0.0;
cumulative_marking_duration_ = 0.0;
for (int i = 0; i < Scope::NUMBER_OF_INCREMENTAL_SCOPES; i++) {
incremental_marking_scopes_[i].cumulative_duration = 0.0;
incremental_marking_scopes_[i].steps = 0;
incremental_marking_scopes_[i].longest_step = 0.0;
}
cumulative_sweeping_duration_ = 0.0;
allocation_time_ms_ = 0.0;
new_space_allocation_counter_bytes_ = 0.0;
old_generation_allocation_counter_bytes_ = 0.0;
......@@ -305,9 +301,7 @@ void GCTracer::Stop(GarbageCollector collector) {
}
}
double spent_in_mutator = Max(current_.start_time - previous_.end_time, 0.0);
heap_->UpdateCumulativeGCStatistics(duration, spent_in_mutator,
current_.scopes[Scope::MC_MARK]);
heap_->UpdateTotalGCTime(duration);
if (current_.type == Event::SCAVENGER && FLAG_trace_gc_ignore_scavenger)
return;
......@@ -394,7 +388,6 @@ void GCTracer::AddSurvivalRatio(double promotion_ratio) {
void GCTracer::AddIncrementalMarkingStep(double duration, intptr_t bytes) {
cumulative_incremental_marking_bytes_ += bytes;
cumulative_incremental_marking_duration_ += duration;
cumulative_marking_duration_ += duration;
if (bytes > 0) {
cumulative_pure_incremental_marking_duration_ += duration;
}
......
......@@ -294,26 +294,6 @@ class GCTracer {
// Log an incremental marking step.
void AddIncrementalMarkingStep(double duration, intptr_t bytes);
// Log time spent in marking.
void AddMarkingTime(double duration) {
cumulative_marking_duration_ += duration;
}
// Time spent in marking.
double cumulative_marking_duration() const {
return cumulative_marking_duration_;
}
// Log time spent in sweeping on main thread.
void AddSweepingTime(double duration) {
cumulative_sweeping_duration_ += duration;
}
// Time spent in sweeping on main thread.
double cumulative_sweeping_duration() const {
return cumulative_sweeping_duration_;
}
// Compute the average incremental marking speed in bytes/millisecond.
// Returns 0 if no events have been recorded.
double IncrementalMarkingSpeedInBytesPerMillisecond() const;
......@@ -462,24 +442,11 @@ class GCTracer {
// tracer.
double cumulative_pure_incremental_marking_duration_;
// Total marking time.
// This timer is precise when run with --print-cumulative-gc-stat
double cumulative_marking_duration_;
// Incremental scopes carry more information than just the duration. The infos
// here are merged back upon starting/stopping the GC tracer.
IncrementalMarkingInfos
incremental_marking_scopes_[Scope::NUMBER_OF_INCREMENTAL_SCOPES];
// Total sweeping time on the main thread.
// This timer is precise when run with --print-cumulative-gc-stat
// TODO(hpayer): Account for sweeping time on sweeper threads. Add a
// different field for that.
// TODO(hpayer): This timer right now just holds the sweeping time
// of the initial atomic sweeping pause. Make sure that it accumulates
// all sweeping operations performed on the main thread.
double cumulative_sweeping_duration_;
double incremental_marking_start_time_;
// Timestamp and allocation counter at the last sampled allocation event.
......
......@@ -125,12 +125,6 @@ Heap::Heap()
nodes_copied_in_new_space_(0),
nodes_promoted_(0),
maximum_size_scavenges_(0),
max_gc_pause_(0.0),
total_gc_time_ms_(0.0),
max_alive_after_gc_(0),
min_in_mutator_(kMaxInt),
marking_time_(0.0),
sweeping_time_(0.0),
last_idle_notification_time_(0.0),
last_gc_time_(0.0),
scavenge_collector_(nullptr),
......@@ -5607,20 +5601,6 @@ void Heap::TearDown() {
UpdateMaximumCommitted();
if (FLAG_print_cumulative_gc_stat) {
PrintF("\n");
PrintF("gc_count=%d ", gc_count_);
PrintF("mark_sweep_count=%d ", ms_count_);
PrintF("max_gc_pause=%.1f ", get_max_gc_pause());
PrintF("total_gc_time=%.1f ", total_gc_time_ms_);
PrintF("min_in_mutator=%.1f ", get_min_in_mutator());
PrintF("max_alive_after_gc=%" V8PRIdPTR " ", get_max_alive_after_gc());
PrintF("total_marking_time=%.1f ", tracer()->cumulative_marking_duration());
PrintF("total_sweeping_time=%.1f ",
tracer()->cumulative_sweeping_duration());
PrintF("\n\n");
}
if (FLAG_print_max_heap_committed) {
PrintF("\n");
PrintF("maximum_committed_by_heap=%" V8PRIdPTR " ",
......@@ -6389,20 +6369,10 @@ void Heap::TracePathToGlobal() {
}
#endif
void Heap::UpdateCumulativeGCStatistics(double duration,
double spent_in_mutator,
double marking_time) {
if (FLAG_print_cumulative_gc_stat) {
total_gc_time_ms_ += duration;
max_gc_pause_ = Max(max_gc_pause_, duration);
max_alive_after_gc_ = Max(max_alive_after_gc_, SizeOfObjects());
min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator);
} else if (FLAG_trace_gc_verbose) {
void Heap::UpdateTotalGCTime(double duration) {
if (FLAG_trace_gc_verbose) {
total_gc_time_ms_ += duration;
}
marking_time_ += marking_time;
}
void Heap::ExternalStringTable::CleanUp() {
......
......@@ -1807,18 +1807,7 @@ class Heap {
return old_generation_allocation_limit_ - PromotedTotalSize();
}
// Returns maximum GC pause.
double get_max_gc_pause() { return max_gc_pause_; }
// Returns maximum size of objects alive after GC.
intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; }
// Returns minimal interval between two subsequent collections.
double get_min_in_mutator() { return min_in_mutator_; }
// Update GC statistics that are tracked on the Heap.
void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator,
double marking_time);
void UpdateTotalGCTime(double duration);
bool MaximumSizeScavenge() { return maximum_size_scavenges_ > 0; }
......@@ -2212,24 +2201,9 @@ class Heap {
// of the allocation site.
unsigned int maximum_size_scavenges_;
// Maximum GC pause.
double max_gc_pause_;
// Total time spent in GC.
double total_gc_time_ms_;
// Maximum size of objects alive after GC.
intptr_t max_alive_after_gc_;
// Minimal interval between two subsequent collections.
double min_in_mutator_;
// Cumulative GC time spent in marking.
double marking_time_;
// Cumulative GC time spent in sweeping.
double sweeping_time_;
// Last time an idle notification happened.
double last_idle_notification_time_;
......
......@@ -801,7 +801,6 @@ void IncrementalMarking::FinalizeIncrementally() {
double end = heap_->MonotonicallyIncreasingTimeInMs();
double delta = end - start;
heap_->tracer()->AddMarkingTime(delta);
if (FLAG_trace_incremental_marking) {
heap()->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Finalize incrementally round %d, "
......@@ -950,7 +949,7 @@ void IncrementalMarking::Hurry() {
// because should_hurry_ will force a full GC.
if (!heap_->mark_compact_collector()->marking_deque()->IsEmpty()) {
double start = 0.0;
if (FLAG_trace_incremental_marking || FLAG_print_cumulative_gc_stat) {
if (FLAG_trace_incremental_marking) {
start = heap_->MonotonicallyIncreasingTimeInMs();
if (FLAG_trace_incremental_marking) {
heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Hurry\n");
......@@ -960,10 +959,9 @@ void IncrementalMarking::Hurry() {
// was stopped.
ProcessMarkingDeque(0, FORCE_COMPLETION);
state_ = COMPLETE;
if (FLAG_trace_incremental_marking || FLAG_print_cumulative_gc_stat) {
if (FLAG_trace_incremental_marking) {
double end = heap_->MonotonicallyIncreasingTimeInMs();
double delta = end - start;
heap_->tracer()->AddMarkingTime(delta);
if (FLAG_trace_incremental_marking) {
heap()->isolate()->PrintWithTimestamp(
"[IncrementalMarking] Complete (hurry), spent %d ms.\n",
......
......@@ -2289,10 +2289,6 @@ void MarkCompactCollector::RecordObjectStats() {
void MarkCompactCollector::MarkLiveObjects() {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK);
double start_time = 0.0;
if (FLAG_print_cumulative_gc_stat) {
start_time = heap_->MonotonicallyIncreasingTimeInMs();
}
// The recursive GC marker detects when it is nearing stack overflow,
// and switches to a different marking system. JS interrupts interfere
// with the C stack limit check.
......@@ -2382,11 +2378,6 @@ void MarkCompactCollector::MarkLiveObjects() {
}
}
}
if (FLAG_print_cumulative_gc_stat) {
heap_->tracer()->AddMarkingTime(heap_->MonotonicallyIncreasingTimeInMs() -
start_time);
}
}
......@@ -3973,11 +3964,6 @@ void MarkCompactCollector::StartSweepSpace(PagedSpace* space) {
void MarkCompactCollector::SweepSpaces() {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_SWEEP);
double start_time = 0.0;
if (FLAG_print_cumulative_gc_stat) {
start_time = heap_->MonotonicallyIncreasingTimeInMs();
}
#ifdef DEBUG
state_ = SWEEP_SPACES;
#endif
......@@ -4003,11 +3989,6 @@ void MarkCompactCollector::SweepSpaces() {
// Deallocate unmarked large objects.
heap_->lo_space()->FreeUnmarkedObjects();
if (FLAG_print_cumulative_gc_stat) {
heap_->tracer()->AddSweepingTime(heap_->MonotonicallyIncreasingTimeInMs() -
start_time);
}
}
Isolate* MarkCompactCollector::isolate() const { return heap_->isolate(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment